1.首先分配ip,配置ip和环回
[Huawei]sysname R1
[R1]interface LoopBack 0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1-LoopBack0]q
[R1]int l 1
[R1-LoopBack1]ip add 192.168.1.49 28
[R1-LoopBack1]q
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
其他同理
2.给R3设置DHCP服务
[R3]dhcp enable
[R3]ip pool huawei
Info: It’s successful to create an IP address pool.
[R3-ip-pool-huawei]network 192.168.1.96 mask 27
[R3-ip-pool-huawei]gateway-list 192.168.1.97
[R3-ip-pool-huawei]dns-list 114.114.114.114
[R3-ip-pool-huawei]q
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
3.配置缺省路由指向运营商。
R4上配置备用
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R5]ip route-static 0.0.0.0 0 56.1.1.2
[R2]ip route-static 0.0.0.0 0 192.168.1.10
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 192.168.1.6
4.配置下一跳使得全网通
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.8 30 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R2]ip route-static 192.168.1.4 30 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.10
[R3]ip route-static 192.168.1.32 27 192.168.1.5
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.5
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.4 30 192.168.1.13
[R4]ip route-static 192.168.1.64 27 192.168.1.9
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.9
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.96 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.32 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.64 27 192.168.1.21 p 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 p 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 p 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 p 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 p 61
5.设置nat使外网可以通
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-GigabitEthernet0/0/1]nat outbound 2000
6.在R1,R2,R4上配置空接口防环
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
7.在R1上开启远程登录
[R1]aaa
[R1-aaa]local-user gzw privilege level 15 password cipher 123456
Info: Add a new user.
[R1-aaa]local-user gzw service-type telnet
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
8.做映射
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.33 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:Y