Default route with object tracking

Brad Tarratt btarratt at clearrate.com
Mon Feb 1 15:46:05 UTC 2010


Make sure you source your icmp-echos from the address on the interface
facing your primary ISP, otherwise your routing table will oscillate
continually until your primary ISP comes back up.  Here's how I did it
with a cable ISP (note my event manager stuff uses no email body to get
around the bug in previous versions of IOS, this may no longer be
necessary):

ip sla 1
 icmp-echo <random root dns server> source-interface <internet-facing
interface>
 timeout 3000
 frequency 10
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo <random root dns server> source-interface <internet-facing
interface>
 timeout 3000
 frequency 10
ip sla schedule 2 life forever start-time now
ip sla 3
 icmp-echo <random root dns server> source-interface <internet-facing
interface>
 timeout 3000
 frequency 10
ip sla schedule 3 life forever start-time now

track 1 rtr 1 reachability
 delay down 30 up 30
track 2 rtr 2 reachability
 delay down 30 up 30
track 3 rtr 3 reachability
 delay down 30 up 30
track 4 list boolean or
 object 1
 object 2
 object 3

interface <internet-facing interface>
 ip dhcp client route track 4
 ip address dhcp
 ip nat outside
end

ip dhcp-client default-router distance 5

ip route 0.0.0.0 0.0.0.0 somewhereelse 10

event manager applet ISPDown
 event syslog pattern "%TRACKING-5-STATE: 4 list boolean or Up->Down"
 action ISPDown.1 mail server "<cellprovidersmx>" to
"<mynumber>@<mycellprovider>" from "routers@<mydomain>" subject "ISP
Service Down"
event manager applet ISPUp
 event syslog pattern "%TRACKING-5-STATE: 4 list boolean or Down->Up"
 action ISPUp.1 mail server "<cellprovidersmx>" to
"<mynumber>@<mycellprovider>" from "routers@<mydomain>" subject "ISP
Service Up"



-----Original Message-----
From: Andrey Gordon [mailto:andrey.gordon at gmail.com] 
Sent: Monday, February 01, 2010 10:14 AM
To: Nanog
Subject: Default route with object tracking

Hi list.

I'd like to setup my default routes to the Interwebz to be conditional
on
reachability of something on the Interwebz. I got two different ISPs (no
BGP). I'm trying to figure out what would be a reliable object to track?
Meaning, it's probably not reasonable to track my ISPs default gateway,
since it does not protect me from someone on the ISP side screwing up.
I'm
thinking of tracking something like google.com, but am not sure if after
I
resolve google.com for the first time, it will be simply tracking an
arbitrary server (or some load balancer).

I wanted to see what experienced folks think is a reliable tracking
target.
Any comments are much appreciated.

thank you,


-----
Andrey Gordon [andrey.gordon at gmail.com]




More information about the NANOG mailing list