Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

The IOS "ip address dhcp" interface command

I'm working on getting a router with an IOS current enough to use this new option for obtaining an IP address for an interface via DHCP. Pretty cool. Quick question I have is if I use that to just get an IP address for a specific Ethernet interface (not for full config of the router), I would assume that a "show int" or "show ip int" command would show the IP address that was acquired via DHCP for the interface, correct?

A related question would be if the other data acquired via DHCP like default gateway would/could be pulled in and if what is pulled in can be controlled. I'm sure this is detailed on CCO someplace, but was hoping to get these 2 questions answered quick until I have time for more intense digging.



Re: The IOS "ip address dhcp" interface command

Once you configure the command under the interface you should get a similar message

Interface assigned DHCP address , mask

You should be able to verify this by using "sh ip interface "

or "sh ip interface brief" should tell you the same, with the method of obtaining that ip address listed as DHCP.

You can also see the same using "show interface "

Regarding your second question. Once the DHCP ip address is obtained, a default static route comes up automatically in the ip routing table with an administrative distance of 254 and cost of 0. The next hop would be the default gateway assigned via DHCP.

It would look like this, when u give a "show ip route"

S* [254/0] via

where next-hop is the default gateway assigned by the DHCP server.

You can control this or change this by giving a local default static route with lower admin distance, so that, this route is preferred.

ip route X

where next-hop is the new gateway that you want to use, and X is a value lesser than 254.

Hope that helps