关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的实验要求:

       1.R1能够访问23.0 24.0  以及R5的所有loopback接口

       2.R1访问R5的Loopback接口 走R2--R3--R5 往返路劲必须一致

       3.当R2--R3之间链路出现故障时,自动切换到R2--R4--R5的链路

       4.R1访问R4时,当R2--R4之间链路出现故障,自动切换到R2--R3--R4

       5.R3和R5之间的直连接口启用RIP协议,R4和R5之间不启用任何动态路由协议

       6.整个实验中,只允许R4和R5之间能够启用静态路由

R1:

int lo0

ip add 172.16.1.1 255.255.255.0

no sh

int e1/0

ip add 12.1.1.1 255.255.255.0

no sh

router eigrp 10

network 12.1.1.0 0.0.0.255

network 172.16.1.0 0.0.0.255

no auto-summary

R2:

int e1/0

ip add 12.1.1.2 255.255.255.0

no sh

int s0/0

ip add 23.1.1.2 255.255.255.0

no sh

int s0/1

ip add 24.1.1.2 255.255.255.0

no shu

router eigrp 10

redistribute rip metric 100 60 100 100 1500

redistribute ospf 100 metric 100 1 150 1 1500

network 12.1.1.0 0.0.0.255

no auto-summary

router ospf 100

log-adjacency-changes

redistribute eigrp 10 metric 2 subnets

redistribute rip metric 4 subnets

network 24.1.1.0 0.0.0.255 area 0

router rip

version 2

redistribute eigrp 10 metric 3

redistribute ospf 100 metric 2

network 23.0.0.0

no auto-summary

R3:

int s0/0

ip add 23.1.1.3 255.255.255.0

no sh

int e1/0

ip add 192.168.1.3 255.255.255.0

no sh

router rip

net 23.1.1.0

net 192.168.1.0

no auto-summary

rouer rip

passsive-interface e1/0    (R3和R5之间使用RIP的单播更新)

neighbor 192.168.1.5  

R4

int s0/1

ip add 24.1.1.4 255.255.255.0

no sh

int lo0

ip add 172.16.4.1 255.255.255.0

no sh

int e1/0

ip add 192.168.1.4 255.255.255.0

no sh

ip route 12.1.1.0 255.255.255.0 192.168.1.3 130

ip route 23.1.1.0 255.255.255.0 192.168.1.3 130        (配置浮动路由)

ip route 172.16.1.0 255.255.255.0 192.168.1.3 130

ip route 172.16.64.0 255.255.252.0 192.168.1.5 130     (把去往R5的换回口的路由汇总)

router ospf 100

net 24.1.1.0 0.0.0.255 a 0

redistribute connected subnets

redistribute static metric 130 subnets                 (冲发布直连和静态路由)


R5

int e1/0

ip add 192.168.1.5 255.255.255.0

no sh

int lo0

ip add 172.16.65.1 255.255.255.0

int lo1

ip add 172.16.66.1 255.255.255.0

int lo2

ip add 172.16.67.1 255.255.255.0

ip route 12.1.1.0 255.255.255.0 192.168.1.4 130

ip route 24.1.1.0 255.255.255.0 192.168.1.4 130 (配置浮动路由 管理距离为130大于RIP的120)

ip route 172.16.1.0 255.255.255.0 192.168.1.4 130

ip route 172.16.4.0 255.255.255.0 192.168.1.4 130

router rip

version 2

net 192.168.1.0

redistribute connected metric 2

redistribute static metric 5

passive-interface Ethernet1/0

network 192.168.1.0

neighbor 192.168.1.3

no auto-summary

现在进行测试,R5上show ip route

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_02


可以发现路由表中没有静态路由条目,这是因为RIP的管理距离小于我们配置的静态路由的管理距离

当动态路由之间链路出现故障时候,静态路由就可以起到冗余的作用

在R1上用traceroute 172.16.66.1 命令来查看数据包的走向:

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_03

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_04

从查看结果可以发现R1去往R5的往返路径是一致的R2--R3--R5

这时,我们在R2上把s0/0接口shutdown掉,R2--R3之间链路就不能走了

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_05

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_06

从测试结果可以发现,当R2--R3之间链路出现故障时,路径自动切换到了R2-R4-R5,而且往返路径是一样的

R5上的路由表中都是静态路由,就没有RIP路由条目了

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_07

当R2上的s0/1接口down掉后,s0/0接口恢复正常

R5路由表

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_08

R5又重新学习到了RIP路由条目

R1上traceroute 172.16.4.1 查看数据包走向

 关于路由重发布、路径控制以及浮动路由的综合实验_ 关于路由重发布、路径控制以及浮动路由的_09

数据包的路径是R2--R3--R4,经过测试所有要求都符合,实验成功。

注意:R3和R5的直连接口上启用单播更新就是为了避免RIP水平分割导致路由不能重发布