一:基本配置
r1(config)#router ospf 1
r1(config-router)#net 1.1.0.0 0.0.255.255 area 1
r1(config-router)#net 12.1.1.1 0.0.0.0 area 0
r1(config-router)#redistribute connected subnets
r2(config)#router ospf 1
r2(config-router)#net 12.1.1.2 0.0.0.0 area 0
r2(config-router)#net 2.2.2.2 0.0.0.0 area 0
r2(config-router)#net 23.1.1.1 0.0.0.0 area 2
r3(config)#router ospf 1
r3(config-router)#net 0.0.0.0 255.255.255.255 area 2
r2#show ip ro os
1.0.0.0/32 is subnetted, 2 subnets
O IA 1.1.1.1 [110/65] via 12.1.1.1, 00:00:32, Serial1/0
O IA 1.1.2.1 [110/65] via 12.1.1.1, 00:00:32, Serial1/0
3.0.0.0/32 is subnetted, 2 subnets
O 3.1.2.1 [110/65] via 23.1.1.2, 00:00:32, Serial1/1
O 3.1.1.1 [110/65] via 23.1.1.2, 00:00:32, Serial1/1
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/20] via 12.1.1.1, 00:00:32, Serial1/0
30.0.0.0/32 is subnetted, 1 subnets
O 30.1.1.1 [110/65] via 23.1.1.2, 00:00:32, Serial1/1
二,修改特定邻居源的路由管理距离
r2(config)#router ospf 1
r2(config-router)#distance 122 1.1.2.1 0.0.0.0 一定要写RID和反掩码
r2#show ip ro os
1.0.0.0/32 is subnetted, 2 subnets
O IA 1.1.1.1 [122/65] via 12.1.1.1, 00:00:04, Serial1/0
O IA 1.1.2.1 [122/65] via 12.1.1.1, 00:00:04, Serial1/0
3.0.0.0/32 is subnetted, 2 subnets
O 3.1.2.1 [110/65] via 23.1.1.2, 00:00:04, Serial1/1
O 3.1.1.1 [110/65] via 23.1.1.2, 00:00:04, Serial1/1
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [122/20] via 12.1.1.1, 00:00:04, Serial1/0
30.0.0.0/32 is subnetted, 1 subnets
O 30.1.1.1 [110/65] via 23.1.1.2, 00:00:04, Serial1/1
思考:
r2(config)#router ospf 1
r2(config-router)#distance 122 12.1.1.1 0.0.0.0 使用邻居接口地址可以吗?
r2(config)#router ospf 1
r2(config-router)#distance 122 12.1.1.1 255.255.255.255 使用RID和掩码可以吗?
本文出自 “思科技术交流” 博客,转载请与作者联系!