现在,来看看路由器2的IP地址配置:
interface Ethernet0 ip address 10.1.1.1 255.255.255.0 ! interface Serial0 ip address 2.2.2.2 255.255.255.0 clockrate 250000 |
这是路由器2的路由配置:
router ospf 1 network 10.1.1.0 0.0.0.255 area 0 network 2.2.2.0 0.0.0.255 area 0 |
注意路由器2仅仅运行OSPF.
接下来,让我们在路由器1上运行show ip route命令。下面就是输出结果:
R1# show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B?BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 1.1.1.126 to network 0.0.0.0 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Ethernet0 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Serial0 10.0.0.0/24 is subnetted, 1 subnets O 10.1.1.0 [110/74] via 2.2.2.2, 00:13:19, Serial0 R* 0.0.0.0/0 [120/1] via 1.1.1.126, 00:00:03, Ethernet0 |
注意,路由器1通过RIP接收到了默认路由,正如输出信息最后面仅靠0.0.0.0/0默认路由的R标志所表示的那样。你还需要注意,路由器1和路由器2通过OSPF通信。因为路由器1对路由器2上的以太网有10.1.1.0/24这条路由。
现在在路由器2上运行show ip route,结果如下:
R2# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B?BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E?EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 2.2.2.1 to network 0.0.0.0 1.0.0.0/8 is subnetted, 1 subnets O E2 1.1.1.0 [110/20] via 2.2.2.1, 00:12:39, Serial0 2.0.0.0/8 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Serial0 10.0.0.0/8 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet0 O*E2 0.0.0.0/0 [110/1] via 2.2.2.1, 00:12:31, Serial0 R2# |
注意,路由器2有指向路由器1的0.0.0.0/0默认路由(本例中即2.2.2.1),并且路由信息带有O标志,即表示这是OSPF路由。
这是一条外部OSPF路由,正如E2标志所示。这表明路由的原并不是OSPF路由,而是另一种路由协议重分配而来。
路由器2并没有RIP路由,因为它并没有运行RIP.但是,通过重分配,路由器2能够接收防火墙所广播的RIP路由。

