02-22-2018 05:47 PM - edited 03-05-2019 09:58 AM
On a router with multiple interfaces using DHCP to get its IP address. Is there a more direct way to find out which default-gateway (next-hop IP) is assigned to which interface?
I have tried the "show dhcp lease" command but it does not give the default-gateway for all interfaces. It shows the DHCP Lease server which may not be the default-gateway.
02-22-2018 06:11 PM
Hi,
The router should put the default-gateway assigned via dhcp in the routing table. I am assuming if you have multiple interfaces getting ip address from dhcp, there will be multiple default routes pointing to different gateways.
What do you find when you look in the routing table by running the "show ip route" command?
Thanks
John
02-23-2018 03:39 PM
Because I don't want multiple routes, I assign each DHCP interface different route distance. When I show route, I only see 1 route with the next-hop of the most preferred route, like:
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
The route for the other DHCP interfaces are no where to be seen.
However, if I add a more specific route, like "ip route 172.16.0.0 255.255.255.0 Vlan 50 dhcp", show ip route will show something like:
172.16.0.0/24 is subnetted, 1 subnets
S 172.16.0.0 [1/0] via 192.168.1.1, Vlan50
But of course I don't want to put in dummy routes just to show the next-hop.
02-24-2018 09:34 PM
Hi,
As per my best knowledge When We are getting IP from DHCP on a cisco router. The router will automatically add a route in routing table with AD value 254.
Can you check complete routing table.
Regards,
Deepak Kumar
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