rip和ospf路由再发布
拓扑结构
主机IP自定义
例如:
10.10.10.100,
10.10.20.100,
10.10.30.100。
路由配置接口
全局模式下
路由A
f0/0
192.168.1.2/24
f0/1
10.10.10.1/24
路由B
f0/0
192.168.1.1/24
f0/1
192.168.2.1/24
e0/1/0
10.10.30.1/24
路由C
f0/0
192.168.2.2/24
f0/1
10.10.20.1/24
rip
路由A
全局模式下
router rip
version 2 //版本2
no auto-summary //关闭自动汇总
network 192.168.1.0 //通告自己周围网段
network 10.10.10.0
路由B
全局模式下
router rip
version 2 //版本2
no auto-summary //关闭自动汇总
network 192.168.1.0
network 10.10.30.0
ospf
路由B
全局模式下
router ospf 1
network 192.168.2.0/24 area 0
//通告 网段 子网掩码或反掩码 所在区域
路由C
全局模式下
router ospf 1
network 192.168.2.0/24 area 0
network 10.10.20.0/24 area 0
引入
router rip
redistribute ospf 1
redistribute ospf 2
router ospf 1
redistribute rip subnets
router ospf 2
redistribute rip subnets
实验结果:
PC0,ping PC1 通
PC0,ping PC2 通
PC1,ping PC0 通
PC1,ping PC2 通
PC2,ping PC0 通
PC2,ping PC1 通
总结:
当在ospf引入rip时输入命令redistribute rip subnets 时
漏掉subnet会出错。
subnets的作用是将从一种路由学到的路由,分发给另一路由协议中去。
结果使路由A学到了
O E2 10.10.20.0 [110/20] via 192.168.1.2, 00:17:02, FastEthernet0/0
O E2 10.10.30.0 [110/20] via 192.168.1.2, 00:17:02, FastEthernet0/0