cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4158
Views
4
Helpful
4
Replies

How to View Gateway Address of an Interface Configured with: IP Address DHCP?

Matthew Martin
Level 5
Level 5

Hello All,

Router: ISR4321
IOS: 15.4(3)S4
IOS-XE: 03.13.04.S

I have a GigabitEthernet interface that is configured with "ip address dhcp" to get a dynamic IP Address from the Cable modem/router connected to this interface. And I'm wondering if there is a command that will show you info about that Interface's DHCP lease. Info like it's DHCP IP Address, the Gateway Address, etc... I know if you run "show int Gi0/0/0" it will show you the "Internet Address" in the output, which I think would be that interface's DHCP IP Address that it received, but it doesn't show you the Gateway Address.

If I create an IP Route like this one below, I can run "show ip route" to get the Gateway address. But, is there a way to do this without needing to create an IP Route?

If this is the IP Route:

ip route 8.8.8.8 255.255.255.255 GigabitEthernet0/0/0 dhcp

Then, "show ip route" would give me something like this:

Router# show ip route
S        8.8.8.8 [1/0] via <gw_address>, GigabitEthernet0/0/0


So I can find that information by running a few different commands and by creating an ip route. But, it seems like a bit overkill just to find that info. So if there's a single command that can show you that information, it would make life much easier...

Any thoughts or suggestions would be greatly appreciated!

Thanks in Advance,
Matt

4 Replies 4

Richard Burts
Hall of Fame
Hall of Fame

Matt

I would think that the output of show arp (or show ip arp depending on platform and version of code) would give you the gateway address.

HTH

Rick

HTH

Rick

Hey Rick, thanks for the reply!

Ok, right, that does also show the Gateway. I was kind of hoping for a command that had similar output as the Windows' ipconfig /all, where you can see the Interface's IP Address, Gateway, DNS servers, etc...

But, thanks again for the reply. Much appreciated!

Thanks,
Matt

Matt

I understand wanting a single IOS command that gave you the information similar to ipconfig. But I do not know of any single command that does it.

HTH

Rick

HTH

Rick

Uday Chennupati
Level 1
Level 1

Hi Matt,

"show dhcp lease" should show you IP, GW and Mask. For DNS info, I think you can use "show dhcp server"

-Uday