简单组网(DHCP+EASY IP)
简单网络环境,实现地址自动分配+访问互联网
1、网络拓扑
PC1的IP地址为218.246.109.1
2、AR1配置
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 218.246.109.28 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.254 24
[Huawei-GigabitEthernet0/0/1]quit
DHCP配置
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]dhcp server group dhcp192.168.1.0
Info:It's successful to create a DHCP server group.
[Huawei-dhcp-server-group-dhcp192.168.1.0]dhcp-server 192.168.1.0
[Huawei-dhcp-server-group-dhcp192.168.1.0]quit
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select interface
[Huawei-GigabitEthernet0/0/1]quit
EASY IP 配置
[Huawei]acl 2000
[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[Huawei-acl-basic-2000]quit
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]nat outbound 2000
[Huawei-GigabitEthernet0/0/0]quit
路由配置
[Huawei]ip route-static 0.0.0.0 0 218.246.109.1
3、测试
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fec9:52aa
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.252
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.254
Physical address..................: 54-89-98-C9-52-AA
DNS server........................:PC>ping 218.246.109.1
Ping 218.246.109.1: 32 data bytes, Press Ctrl_C to break
From 218.246.109.1: bytes=32 seq=1 ttl=127 time=47 ms
From 218.246.109.1: bytes=32 seq=2 ttl=127 time=32 ms
From 218.246.109.1: bytes=32 seq=3 ttl=127 time=31 ms
From 218.246.109.1: bytes=32 seq=4 ttl=127 time=47 ms
From 218.246.109.1: bytes=32 seq=5 ttl=127 time=31 ms--- 218.246.109.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/37/47 msPC>
读书和健身总有一个在路上