cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
365
Views
10
Helpful
2
Replies

Default gateway and tracking

John Blakley
VIP Alumni
VIP Alumni

All,

I have a situation where I don't want a default gateway unless an interface is down. The default gateway is still getting put into the table even though I'm tracking based on this interface:

router# sh track

Track 1

Interface FastEthernet0/0 line-protocol

Line protocol is Up

1 change, last change 00:01:15

Delay up 20 secs, down 10 secs

Tracked by:

STATIC-IP-ROUTING 0

router# sh run | inc track

track 1 interface FastEthernet0/0 line-protocol

ip route 0.0.0.0 0.0.0.0 10.125.95.3 name Anira track 1

Is there a way of keeping a default route out of the table unless F0/0 goes down?

Thanks!

John

HTH, John *** Please rate all useful posts ***
2 Replies 2

xcz504d1114
Level 4
Level 4

If you're not monitoring the distant end's reachability, you can just use a floating static route.

I'm assuming you have a static route going out your fa0/0 when it is up, and it has the default AD of 1.

ip route 0.0.0.0 0.0.0.0 10.125.95.3 2

Both your solution and this solution only protect you if your interface actually goes down, it doesn't verify that the next hop going out of fa0/0 has NLRI. If you want to have that capability, you will need to setup IP SLA and track the SLA.

HTH,

Craig

Joe Clarke
Cisco Employee
Cisco Employee

Depending on the version of IOS, you could use the Embedded Event Manager to do this. For example, assuming 12.4(2)T or higher:

event manager applet add-default-route

event track 1 state down

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "ip route 0.0.0.0 0.0.0.0 10.125.95.3 name Anira"

action 4.0 cli command "end"

event manager applet no-default-route

event track 1 state up

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 10.125.95.3 name Anira"

action 4.0 cli command "end"

Getting Started

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:

Review Cisco Networking products for a $25 gift card