Relentless Coding

A Developer’s Blog

How to Enable a DHCP Client on a Cisco Interface

Let’s look at how to automatically get an IP addresses assigned on an interface on a Cisco device. This could not be simpler.

To make interface g0/0/0 a DHCP client:

ISR4321(config)# int g0/0/0
ISR4321(config-if)# ip address dhcp
ISR4321(config-if)# no shutdown

If there is a DHCP server on the network, the interfaces DHCP Discover probes will be honored and the interface will now have an IP address:

ISR4321# sh ip int brief
Interface             IP-Address      OK?  Method  Status  Protocol
GigabitEthernet0/0/0  192.168.88.254  YES  DHCP    up      up
GigabitEthernet0/0/1  unassigned      YES  unset   down    down
GigabitEthernet0      unassigned      YES  unset   down    down