08-05-2025 05:03 PM - edited 08-05-2025 05:03 PM
Hi,
I currently have 3 connections -
ip route 0.0.0.0 0.0.0.0 Ethernet0/2/0 <ITS_GW_IP> 20 track 2 ip route 0.0.0.0 0.0.0.0 Cellular0/1/0 30 track 3 ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/2 dhcp
I want to change the Gig0/2 to be able to have a metric of 10 and track on 1. (Tracks are all now working thanks to this group.)
So I tried this -
C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 ? <1-255> Distance metric for this route A.B.C.D Forwarding router's address DHCP Default Gateway obtained from DHCP multicast multicast route name Specify name of the next hop permanent permanent route tag Set tag for this route track Install route depending on tracked item <cr> <cr>
Which says I have DHCP and track available. So, I do DHCP, but...
C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 dhcp ? <1-255> Distance metric for this route <cr> <cr> C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 dhcp 10 ? <cr> <cr>
It won't let me go past that. I was hoping to add a 2nd with a metric so that I can add it and then remove the current. I'd be more bold, but I'm 500 miles away, I'm "reload in 10 reason Lost_Control" before I do these things just incase.
So if I try to use track....
C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 track ? <1-1000> tracked object number C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 track 1 ? <1-255> Distance metric for this route multicast multicast route name Specify name of the next hop tag Set tag for this route <cr> <cr> C3945e-1(config)#ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 track 1 10 ? multicast multicast route name Specify name of the next hop tag Set tag for this route <cr> <cr>
I lose the ability to DHCP.
I'm fairly convinced that "config net" of
no ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/2 dhcp ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/2 dhcp 10 track 1
wouldn't work, as I tried setting another interface to dhcp and did
ip route 0.0.0.0 gig0/3 dhcp 50 ?
and just got "<cr> <cr>"
I'm a bit hung up on having the dhcp with the interface, I've heard more input that having it is belt and suspenders. But if it's not viable, then.......
Thanks, Tuc
Solved! Go to Solution.
08-06-2025 12:09 AM
Hello
You can track dhcp interface, but you need to apply the client track on the isp facing interface BEFORE you enable for dhcp
Create the ipsla and track 1 accordingly then:
int gigabitEthernet0/2
description ISP
ip dhcp client route track 1
ip address dhcp
ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 dhcp 10
08-05-2025 10:23 PM
@Tuc hello there, and sick question!!! Alright basically, u can't use both dhcp and track in the same ip route command. Once u specify dhcp, the router gets the gateway dynamically and installs the default route BUT that route can't be tied to a track object directly. U also can’t apply a metric and track after dhcp in the syntax. BEcause the CLI just doesn’t support it, and as u saw, it stops parsing after the metric.
And dont get me wrong my Cisco friend, because ur desire to try something like the ip route 0.0.0.0..... gig0/2 dhcp 10 track 1 is TOTALLY LOGICAL, but yeah, not supported by IOs (meaning that the moment u say dhcp, Ios owns that route and doesnt let u bind it to a track object......
But still, u have some options:
If your DHCP gateway is fairly static (some setups use a reserved IP), u could manually enter the next-hop like:
ip route 0.0.0.0 0.0.0.0 Gig0/2 x.x.x.x 10 track 1 .
And if the gateway changes regularly and u must stick with DHCP, then u're kind of stuck not being able to tie tracking to it directly. What you can do is track the interface status itself wiht the track 1 int gig0/2 line-protocol then this is going to work; IP ROUTE 0.0.0.0 0.0.0.0 GIG0/2 X.X.X 10 TRACK 1
so as a RECAP: U can use IP SLA to ping something (like 8.8.8.8) and track that, but u’ll still need to hardcode the next-hop, DHCP won't work with it. TL;DR: DHCP routes can't use track. If ur gateway isn't static, u're stuck letting DHCP handle it and relying on interface status for failover.
and this link it outlines how ip route ... dhcp works and stuff..: https://www.cisco.com/c/en/us/td/docs/ios/12_2sb/12_2sba/feature/guide/ddgtwy.html
HOPE IT WASNT A LOOONG ANSWER, HOPE IT HELPS AND PEACE!
-Enes
08-06-2025 12:09 AM
Hello
You can track dhcp interface, but you need to apply the client track on the isp facing interface BEFORE you enable for dhcp
Create the ipsla and track 1 accordingly then:
int gigabitEthernet0/2
description ISP
ip dhcp client route track 1
ip address dhcp
ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2 dhcp 10
08-06-2025 06:42 PM
Implemented. Didn't drop network. Nothing seems to be different, which is what I expected. But I guess I'll find out if it works when we drop ISP again
08-06-2025 11:15 PM
Hello
Please note even though its applied it may not work the client route needs to be applied before the interface obtains an ip allocation otherwise you will need either shutdown the interface and bring it back up or remove dhcp from the interface and have it re obtain an allocation
To verify if the dhcp client route track taken correctly :
sh ip route track-table
08-08-2025 08:09 AM
08-08-2025 09:06 AM
Can I see last config
MHM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide