要求
1.全网所有网段全部基于192.168.1.0/24划分所得
2.R1-R4每台设备均有两个环回
3.全网可达
4.尽量减少路由条目,且防止环路
5.R5的环回1.1.1.1/24不能出现在其他设备的路由表中
6.按图做静态浮动路由(R4与R5之间上为百兆链路,下为千兆链路)
首先在R4上边添加端口
1、IP地址规划
全网所有网段均基于192.168.1.0/24划分所得
2、配置环回接口和IP
R1:
R2:
R3:
R4:
R5:
测试直连
3、配置静态路由
R1:
R2:
R3:
R4:
ip route-static 192.168.1.0 255.255.255.252 192.168.1.13
ip route-static 192.168.1.4 255.255.255.252 192.168.1.9
ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
ip route-static 192.168.1.64 255.255.255.224 192.168.1.13
ip route-static 192.168.1.96 255.255.255.224 192.168.1.9
R5:
[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.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.1
[R5]ip route-static 192.168.1.0 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.8 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
4、添加缺省路由
[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
[R2]ip route-static 0.0.0.0 0 192.168.1.14
[R3]ip route-static 0.0.0.0 0 192.168.1.10
[R4]ip route-static 0.0.0.0 0 192.168.1.18
5、路由备份
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 65
[R5]ip route-static 192.168.1.32 27 192.168.1.21 pr
[R5]ip route-static 192.168.1.32 27 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 65
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 65
6、防环
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R3]ip route-static 192.168.1.96 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
如果第一个不理解,用第二个来
首先,划分网段,将划分好的网段分为骨干网和路由网
接着,配置各个骨干网的IP地址
然后配置R1~R5上的loopback 地址
配置完后再给R1~R5配置静态路由
然后给R1~R4配置缺省
[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.21
[R2]ip route-static 0.0.0.0 0 192.168.1.6
[R3]ip route-static 0.0.0.0 0 192.168.1.17
[R4]ip route-static 0.0.0.0 0 192.168.1.10
[R4]ip route-static 0.0.0.0 0 192.168.1.13
配置浮动静态路由是只需要给R4的缺省加上优先级即可
(ip route-static 0.0.0.0 0 192.168.1.13 preference 80)
最后给R1~R4做防环
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R3]ip route-static 192.168.1.128 27 NULL 0
[R4]ip route-static 192.168.1.96 27 NULL 0