cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1115
Views
0
Helpful
1
Replies

The IOS "ip address dhcp" interface command

sheidelbach
Level 1
Level 1

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.

Thanks.

1 Reply 1

thisisshanky
Level 11
Level 11

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* 0.0.0.0/0 [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 0.0.0.0 0.0.0.0 X

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

Hope that helps

Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: