严格说来ODR不算是真正的路由协议,因为它交换的信息仅仅局限在IP前缀信息和默认路由上,ODR没有包含度(metric)的信息.ODR使用跳数(hop count)作为度
配置ODR只需要在hub router上的全局配置模式下起用router odr命令,不需要在stub router上配置IP路由信息,但是必须在接口上开启CDP功能
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 14.1.1.4 to network 0.0.0.0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
14.0.0.0/24 is subnetted, 1 subnets
C 14.1.1.0 is directly connected, Serial1/0
o* 0.0.0.0/0 [160/1] via 14.1.1.4, 00:00:16, Serial1/0
========================================================================================
R4#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
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
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 not set
34.0.0.0/24 is subnetted, 1 subnets
C 34.1.1.0 is directly connected, Serial1/2
172.16.0.0/24 is subnetted, 1 subnets
o 172.16.1.0 [160/1] via 24.1.1.2, 00:00:35, Serial1/1
24.0.0.0/24 is subnetted, 1 subnets
C 24.1.1.0 is directly connected, Serial1/1
10.0.0.0/24 is subnetted, 1 subnets
o 10.1.1.0 [160/1] via 14.1.1.1, 00:00:51, Serial1/0
192.168.1.0/32 is subnetted, 1 subnets
O 192.168.1.1 [110/65] via 34.1.1.3, 00:03:42, Serial1/2
192.168.2.0/32 is subnetted, 1 subnets
O 192.168.2.1 [110/65] via 34.1.1.3, 00:03:42, Serial1/2
14.0.0.0/24 is subnetted, 1 subnets
C 14.1.1.0 is directly connected, Serial1/0
R4#show run
Building configuration...
Current configuration : 936 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R4
!
!
ip subnet-zero
!
!
no ip domain-lookup
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 14.1.1.4 255.255.255.0
serial restart-delay 0
clock rate 64000
!
interface Serial1/1
ip address 24.1.1.4 255.255.255.0
serial restart-delay 0
clock rate 64000
!
interface Serial1/2
ip address 34.1.1.4 255.255.255.0
serial restart-delay 0
clock rate 64000
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router odr
!
router ospf 1
log-adjacency-changes
redistribute connected subnets
redistribute odr subnets
passive-interface default
no passive-interface Serial1/2
network 34.1.1.0 0.0.0.255 area 0
!
ip classless
ip http server
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
end
===========================================================================================
R3#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 not set
34.0.0.0/24 is subnetted, 1 subnets
C 34.1.1.0 is directly connected, Serial1/0
172.16.0.0/24 is subnetted, 1 subnets
O E2 172.16.1.0 [110/20] via 34.1.1.4, 00:00:36, Serial1/0
24.0.0.0/24 is subnetted, 1 subnets
O E2 24.1.1.0 [110/20] via 34.1.1.4, 00:00:03, Serial1/0
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/20] via 34.1.1.4, 00:00:36, Serial1/0
C 192.168.1.0/24 is directly connected, Loopback0
C 192.168.2.0/24 is directly connected, Loopback1
14.0.0.0/24 is subnetted, 1 subnets
O E2 14.1.1.0 [110/20] via 34.1.1.4, 00:00:03, Serial1/0