10-29-2012 01:06 PM - edited 03-01-2019 04:51 PM
In conditional default routing, route-map attached under the "default-information originate" command check the matched subnets present in the IP routing table. Once uplink goes down, router removes route from routing table and the originated default route is withdrawn from OSPF domain. Monitoring layer 2 interface status is not accurate indication of end-to-end reachability. Sometimes it might be possible that interface status is showing UP/UP locally but the circuit itself could be down .In such situation router will not remove connected interface subnet or any configure static route to that interface can still cause default route advertisement. A good design is to employ IP SLA tracking which is more reliable than layer 2 interface status; this provides accurate end-to-end reachability information.
It is assumed that reader already has knowledge of OSPF Conditional default routing and IP SLA.
To know about OSPF condition route advertisement please read this document:
Conditional default route advertisement in OSPF
OSPF default route advertisement
1) Configure IP SLA instance and corresponding track object.
2) Use reliable static routing to configure a static host route for a bogus IP address pointing to null0 interface.
As best practices use bogus IP address as link local address because link-local address is intended only for communications within the segment of a local network that a host is connected to. Routers do not forward packets with link-local addresses. Address block for ipv4 is 169.254.0.0/16.
3) Conditionally advertise default route into OSPF based on presence of the static host route.
R1 and R2 runs OSPF in area 0 .One end of the router R1 is connected to service provider router ISP1 through the Ethernet switch Sw1 while other end is connected to R2. If you configured a default conditional route on R1 matching interface prefix 192.168.1.0/24, R1 will advertise default route in OSPF domain i.e.to R2.But the problem here is even if ISP1 link to Sw1 goes down, R1 links to Sw1 will be in UP/UP state and shows connected route 192.168.1.0/24 in its routing table. Hence even if there is no end to end connectivity between R1 and ISP1, R1 still advertise default route to OSPF domain. To avoid such case you need to configure reliable default routing by using IP SLA.
Basic configuration:
R2R1
interface FastEthernet0/0 router ospf 100 | interface FastEthernet0/0 ip address 10.1.1.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 192.168.1.1 255.255.255.0 duplex auto speed auto ! router ospf 100 log-adjacency-changes network 10.1.1.1 0.0.0.0 area 0 |
Configure Reliable default routing on R1:
Step1:Configure IP SLA and Tracking object: Configure IP SLA to check reachability of ISP1 interface IP address using ICMP.
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip sla 1
R1(config-ip-sla)#icmp-echo 192.168.1.2 source-ip 192.168.1.1
R1(config-ip-sla-echo)#frequency 5
R1(config-ip-sla-echo)#exit
R1(config)#ip sla schedule 1 start-time now life forever
R1(config)#track 1 rtr 1 reachability
R1(config)#
*Mar 1 01:28:25.683: %TRACKING-5-STATE: 1 rtr 1 reachability Down->Up
Step2:Configure a static host route for a bogus IP address pointing to null0 interface. When we attach track argument to static route, failure of track cause the static route to be remove from routing table.
R1(config)#ip route 169.254.1.1 255.255.255.255 null 0 track 1
Step3:Conditionally advertise default route into OSPF based on presence of the above static route in routing table.
R1(config)#ip prefix-list default_route seq 10 permit 169.254.1.1/32
R1(config)#route-map OSPF_default permit 10
R1(config-route-map)# match ip address prefix-list default_route
R1(config-route-map)#exit
R1(config)#router ospf 100
R1(config-router)#default-information originate always route-map OSPF_default
R1(config-router)#exit
As per condition,
1) R1 will advertise default route when there is 169.254.1.1/32 prefix present in routing table.
2) R1 will remove 169.254.1.1/32 prefix from routing table when there is failure in tracking object.
3) Tracking object failure depends on the failure of ping response from ISP1 interface.
On R1 tracking object is showing UP
R1#sh track
Track 1
Response Time Reporter 1 reachability
Reachability is Up
2 changes, last change 00:00:51
Latest operation return code: OK
Latest RTT (millisecs) 320
Tracked by:
STATIC-IP-ROUTING 0
As tracking object is UP static route pointed to null 0 must be in routing Table:
R1#sh ip route | in Null0
S 169.254.1.1 is directly connected, Null0
As configure bogus static route in routing table, R1 will advertise default route in OSPF domain. Let’s verify default route on R2.
R2#sh ip ospf database | in 0.0.0.0
0.0.0.0 192.168.1.1 282 0x80000001 0x001FC4 100
R2#sh ip route ospf
O*E2 0.0.0.0/0 [110/1] via 10.1.1.1, 00:04:48, FastEthernet0/0
If you disable ISP1 interface, R1 interface to Sw1 remain UP/UP but ICMP failure to R1 to ISP1 cause to tracking object failure. Due to same R1 remove static route from routing table that will instruct OSPF process to stop default route advertisement.
ISP1(config)#int fa0/0
ISP1(config-if)#sh
ISP1(config-if)#
*Mar 1 01:38:18.719: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Mar 1 01:38:19.719: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1#sh ip int brief | exclude un
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.1.1 YES manual up up
FastEthernet0/1 192.168.1.1 YES manual up up
R1#
*Mar 1 01:38:30.683: %TRACKING-5-STATE: 1 rtr 1 reachability Up->Down
R1#sh track
Track 1
Response Time Reporter 1 reachability
Reachability is Down
3 changes, last change 00:00:22
Latest operation return code: Timeout
Tracked by:
STATIC-IP-ROUTING 0
R1#sh ip route | in Null0
R1#
Turned on debug in R2 to get closer view of default route deletion.
R2#debug ip routing
IP routing debugging is on
R2#
*Mar 1 01:42:39.283: RT: del 0.0.0.0 via 10.1.1.1, ospf metric [110/1]
*Mar 1 01:42:39.287: RT: delete network route to 0.0.0.0
*Mar 1 01:42:39.287: RT: NET-RED 0.0.0.0/0
*Mar 1 01:42:39.287: RT: NET-RED 0.0.0.0/0
How Does OSPF Generate Default Routes?
How OSPF Injects a Default Route into a Normal Area
Base Initial configuration:
Any idea what we could do in the case when IP sla is not available? e.g multy-context firewall ?
How do we make a condition to remove the static route in the event when we lose an uplink for example ?
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: