Monday, April 16, 2012

Configuring Cisco On-Demand Routing (ODR)

One of the goals at the CCIE level is to gain a mastery of the configuration of most of the features on the Cisco IOS platform. On Demand Routing (ODR) is not often used and not often tested and covered superficially on lower level certifications like the CCNP and CCNA.

ODR is primarily applicable in a hub and spoke network where CDP can be used and it is not desirable to add the overhead of a routing protocol like RIP, EIGRP, or OSPF. The main idea is that the prefixes can be exchanged from the spoke routers (also known as stub routers) to the hub router and the hub router can advertise a default route to the spoke routers. Prefixes learned via ODR can be redistributed into another routing protocol to enure full end-to-end connectivity with other parts f the network.

ODR relies on Cisco Discovery Protocol (CDP), so only networks that support CDP can be part of an ODR configuration. This immediately eliminates Frame Relay with point-to-multipoint subinterfaces interfaces and other non-broadcast topologies.

The following topologies show demonstrations of ODR using IPv4. IPv6 is not currently supported in ODR. This lab is built on Dynamips/GNS3 using Cisco c7200 routers running the Advanced Enterprise Services release of 15.0(1)M4. 



ODR is only enabled on the hub router with the router odr command. On ASBR_HUB, we configure ODR and redistribution into OSPF:

router odr
!
router ospf 1
 log-adjacency-changes
 redistribute odr subnets
 network 10.0.0.0 0.0.0.255 area 0
!


After the network converges and routes are communicated via CDP, we can see the default route advertised via ODR on any spoke router:

Stub2#show ip route
Codes: L - local, 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, + - replicated route

Gateway of last resort is 10.0.2.1 to network 0.0.0.0

o*    0.0.0.0/0 [160/1] via 10.0.2.1, 00:00:56, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.2.0/30 is directly connected, FastEthernet0/0
L        10.0.2.2/32 is directly connected, FastEthernet0/0
      192.168.1.0/32 is subnetted, 1 subnets
C        192.168.1.1 is directly connected, Loopback0



On the hub router, we see the networks connected to the spoke routers advertised via CDP and included in the routing table as ODR routes:

ASBR_HUB#show ip route odr
Codes: L - local, 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, + - replicated route


Gateway of last resort is not set

      192.168.0.0/32 is subnetted, 1 subnets
o        192.168.0.1 [160/1] via 10.0.1.2, 00:00:59, FastEthernet0/1
      192.168.1.0/32 is subnetted, 1 subnets
o        192.168.1.1 [160/1] via 10.0.2.2, 00:00:39, FastEthernet1/0
      192.168.2.0/32 is subnetted, 1 subnets
o        192.168.2.1 [160/1] via 10.0.3.2, 00:00:59, FastEthernet1/1

With the redistribution into OSPF, we can confirm end-to-end connectivity from the OSPF router and from one of the spoke routers:

Area0#ping 192.168.1.1 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/74/92 ms

Stub2#ping 172.16.1.1 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/57/76 ms


Troubleshooting ODR isn't very complicated compared to other protocols because there is not a lot of complexity. 90% of troubleshooting ODR is making sure CDP is functioning properly and ensuring that it is not disabled globally or on the interfaces that are propagating routes.

Most often, people don;t know which router(s) to configure the router odr command on (since it is only enabled on the hub router). Using the debug cdp ip command helps to identify possible issues if the routing tables are not being populated.

ASBR_HUB#debug cdp ip
CDP IP info debugging is on


*Apr 16 11:54:29.915: CDP-IP: IP TLV length (4) invalid for IP prefixes.
                      Expecting IP prefix from stub router

The message above indicates that more than one hub has been configured. Removing the router odr command from the misconfigured spoke router should resolve this issue. Proper operation shows the hub router writing default routes to the spoke routers and updating routes from spoke-connected networks:

*Apr 16 11:57:29.703: CDP-IP: Writing default route 10.0.1.1 for FastEthernet0/1
*Apr 16 11:57:29.703: CDP-IP: Writing default route 10.0.2.1 for FastEthernet1/0
*Apr 16 11:57:29.707: CDP-IP: Writing default route 10.0.3.1 for FastEthernet1/1
ASBR_HUB#
*Apr 16 11:57:30.651: CDP-IP: Writing default route 10.0.0.2 for FastEthernet0/0
ASBR_HUB#
*Apr 16 11:57:34.951: CDP-IP: Aging routes
ASBR_HUB#
*Apr 16 11:57:38.511: CDP-IP: Reading prefix 192.168.1.1/32 source 10.0.2.2 via FastEthernet1/0
*Apr 16 11:57:38.511: CDP-IP: Updating prefix 192.168.1.1/32 in routing table


Routing updates can be controlled using distribute lists and timers can be configured using the timers router command. By default, ODR sends updates every 60 seconds. If updates are not received in 180 seconds, routes are marked as invalid and flushed after 240 seconds.

The Road to the CCIE

No comments:

Post a Comment