cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
12185
Views
0
Helpful
3
Replies

How to find default-gateway assigned via to interface DHCP

pingduck
Level 1
Level 1

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.

 

3 Replies 3

johnd2310
Level 8
Level 8

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

**Please rate posts you find helpful**

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.

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 

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!
Review Cisco Networking products for a $25 gift card