![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/83c3404ace9bd77536d0bffa44620fbc.png)
1、划分网段
因为题中要求使用192.168.1.0/24,所以对这个网段进行划分
192.168.1.0/24
六条骨干: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
R1环回:192.168.1.32/27
192.168.1.32/28
192.168.1.48/28
R2环回:192.168.1.64/27
192.168.1.64/28
192.168.1.80/28
R3:192.168.1.96/27
R4环回:192.168.1.128/27
192.168.1.128/28
192.168.1.144/28
R5环回:192.168.1.160/27
2.配置IP
配置骨干
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
[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
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
[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
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
[R3]int g 0/0/2
[R3-GigabitEthernet0/0/0]ip add 192.168.1.97 27
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.21 30
[R4-GigabitEthernet4/0/0]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[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
R5:
[R5]int g0/0/0
[R5-GigabitEthernet0/0/2]ip add 192.168.1.18 30
[R5-GigabitEthernet0/0/2]int g0/0/2
[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 12.0.0.1 24
[R5]int LoopBack 0
[R5-LoopBack0]ip add 192.168.1.161 27
R6:
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R6]int LoopBack 0
[R6-LoopBack0]ip add 6.6.6.6 24
对R3进行DHCP配置
[R3]dhcp enable
[R3]ip pool pool1
[R3-ip-pool-pool1]network 192.168.1.96 mask 27
[R3-ip-pool-pool1]gateway-list 192.168.1.97
[R3-ip-pool-pool1]dns-list 114.114.114.114 8.8.8.8
进入端口激活协议,然后电脑就可以进行IP获取
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
电脑dhcp自动获取IP
配置路由
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 12.0.0.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
为了能够访问外部网络,需要搭建一个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 70
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 preference 70
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 70
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 70
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 70
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 70
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 70
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 70
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 70
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