一、写实验第一步,先划分IP,本题按照要求2配置IP
192.168.1.0/27—骨干链路
192.168.1.0/30
192.168.1.4/30
192.168.1.8/30
192.168.1.12/30
192.168.1.16/30
192.168.1.20/30
192.168.1.24/30
192.168.1.28/30
192.168.1.32/27—R1
192.168.1.32/28
192.168.1.48/28
192.168.1.64/27—R2
192.168.1.64/28
192.168.1.80/28
192.168.1.96/27—R3
192.168.1.128/27—R4
192.168.1.128/28
192.168.1.144/28
192.168.1.160/27—R5
二、配置
1)先配置环回地址
R1配置回环
[Huawei]sys R1
[R1]int LoopBack 0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1-LoopBack0]int LoopBack 1
[R1-LoopBack1]ip add 192.168.1.49 28
[R1-LoopBack1]qu
R2配置回环
[Huawei]sys R2
[R2]int LoopBack 0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]int LoopBack 1
[R2-LoopBack1]ip add 192.168.1.81 28
[R2-LoopBack1]quit
R4配置回环
[Huawei]sy R4
[R4]int LoopBack 0
[R4-LoopBack0] ip add 192.168.1.129 28
[R4-LoopBack0]int LoopBack 1
[R4-LoopBack1]ip add 192.168.1.145 28
[R4-LoopBack1]qu
R5配置回环
[Huawei]sy R5
[R5]int LoopBack 0
[R5-LoopBack0]ip add 192.168.1.161 27
[R5-LoopBack0]qu
R6配置回环
[Huawei]sy R6
[R6]int lo
[R6]int LoopBack 0
[R6-LoopBack0]ip add 6.6.6.6 24
2)下面对R3进行配置DHCP和基本端口
[Huawei]sy R3
[R3]int g 0/0/2
[R3-GigabitEthernet0/0/0]ip add 192.168.1.97 27
[R3-GigabitEthernet0/0/2]q
[R3]dhcp enable
[R3]ip pool dizhi
[R3-ip-pool-dizhi]network 192.168.1.96 mask 27
[R3-ip-pool-dizhi]gateway-list 192.168.1.97
[R3-ip-pool-dizhi]dns-list 114.114.114.114 8.8.8.8
[R3-ip-pool-dizhi]display this
[V200R003C00]
ip pool dizhi
gateway-list 192.168.1.97
network 192.168.1.96 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
return
[R3-ip-pool-dizhi]q #进入端口激活协议,然后电脑就可以进行IP获取
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
[R3-GigabitEthernet0/0/2]q
三、配置骨干
1)配置R1骨干
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
2)配置R2骨干
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
3)配置R3骨干
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
4)配置R4骨干
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g4/0/0
[R4-GigabitEthernet4/0/0]ip add 192.168.1.17 30
[R4-GigabitEthernet4/0/0]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.21 30
5)配置R5骨干
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 192.168.1.18 30
[R5-GigabitEthernet0/0/2]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 56.1.1.1 24
6)配置R6骨干
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
四、配置路由
提示:缺省路由,防止环化
R1:
缺省
ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.6
ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.6
优化路由,其余负载均衡
ip route-static 192.168.1.64 27 192.168.1.2
ip route-static 192.168.1.8 30 192.168.1.2
ip route-static 192.168.1.96 27 192.168.1.6
ip route-static 192.168.1.12 30 192.168.1.6
R2:
ip route-static 0.0.0.0 0 192.168.1.10
ip route-static 192.168.1.32 27 192.168.1.1
ip route-static 192.168.1.4 30 192.168.1.1
ip route-static 192.168.1.96 27 192.168.1.1
ip route-static 192.168.1.96 27 192.168.1.10
R3
ip route-static 0.0.0.0 0 192.168.1.14
ip route-static 192.168.1.32 27 192.168.1.5
ip route-static 192.168.1.0 30 192.168.1.5
ip route-static 192.168.1.64 27 192.168.1.5
ip route-static 192.168.1.64 27 192.168.1.14
R4
ip route-static 0.0.0.0 0 192.168.1.18
ip route-static 192.168.1.0 30 192.168.1.9
ip route-static 192.168.1.64 27 192.168.1.9
ip route-static 192.168.1.4 30 192.168.1.13
ip route-static 192.168.1.96 27 192.168.1.13
ip route-static 192.168.1.32 27 192.168.1.13
ip route-static 192.168.1.32 27 192.168.1.9
R5
ip route-static 0.0.0.0 0 56.1.1.2
ip route-static 192.168.1.128 27 192.168.1.17
ip route-static 192.168.1.64 27 192.168.1.17
ip route-static 192.168.1.96 27 192.168.1.17
ip route-static 192.168.1.32 27 192.168.1.17
ip route-static 192.168.1.0 30 192.168.1.17
ip route-static 192.168.1.4 30 192.168.1.17
ip route-static 192.168.1.8 30 192.168.1.17
ip route-static 192.168.1.12 30 192.168.1.17
调整电脑为自动获取IP
DHCP运行成功
为了能够访问外部网络,需要搭建一个NAT服务(网络地址转换)
在R5的g0/0/1接口
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5-acl-basic-2000]int g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
为之前的汇总做防环操作
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
r4与r5正常通过1000兆链路,故障时通过100兆链路
R4
ip route-static 0.0.0.0 0 192.168.1.22 preference 61
R5
ip route-static 0.0.0.0 0.0.0.0 56.1.1.2
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 pr 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 pr 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 pr 61
测试故障
[R5]int g4/0/0
[R5-GigabitEthernet4/0/0]shutdown
备份成功
R6 telnet R5的 公有ip地址时,实际登录到R1上
先在R1上开启telnet
[R1]aaa
[R1-aaa]local-user bai password cipher 123
Info: Add a new user.
[R1-aaa]local-user bai service-type telnet
[R1-aaa]q
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
在R5上进行端口映射
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 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