ip address dhcp
Configures a router interface to obtain an IP address dynamically from a DHCP server, typically used on LAN interfaces connecting to networks with DHCP services.
ip address dhcpWhen to Use This Command
- Assigning an IP address to a router's LAN interface from a corporate DHCP server to simplify management.
- Obtaining a public IP address on a customer edge router from an ISP's DHCP server.
- Quickly bringing up an interface for testing without manual IP configuration.
- Deploying routers in remote offices where DHCP is used for IP assignment.
Command Examples
Basic DHCP client configuration on GigabitEthernet0/0
interface GigabitEthernet0/0
ip address dhcpGigabitEthernet0/0 up, line protocol is up
Hardware is CN Gigabit Ethernet, address is 0011.2233.4455 (bia 0011.2233.4455)
Internet address is 192.168.1.100/24
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255The output shows the interface is up and has obtained IP address 192.168.1.100 with subnet mask /24. The MAC address is 0011.2233.4455. MTU, bandwidth, delay, and load values are default.
Verifying DHCP lease with show ip interface brief
show ip interface briefInterface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.1.100 YES DHCP up up GigabitEthernet0/1 unassigned YES unset administratively down down
The output lists all interfaces. For GigabitEthernet0/0, the IP address is 192.168.1.100, method is DHCP, and both status and protocol are up, indicating a successful lease.
Understanding the Output
When you configure 'ip address dhcp' on an interface, the router acts as a DHCP client. Use 'show ip interface brief' to see the assigned IP address and method (DHCP). The 'Internet address' line in 'show interfaces' shows the IP and subnet mask. If the interface fails to obtain an address, it will remain 'unassigned' or show '0.0.0.0'. Check 'show dhcp lease' for lease details like server IP, lease time, and renewal timer. A healthy lease shows a valid IP and remaining time. Watch for 'DHCP' in the method column; if it says 'manual' or 'unset', the command may not have been applied correctly.
CCNA Exam Tips
Remember that 'ip address dhcp' is configured in interface configuration mode, not global config.
The router will send a DHCP discover broadcast; ensure the interface is not shutdown.
Use 'show dhcp lease' to verify the obtained IP and lease details; exam may ask about lease renewal.
If the interface is up but no IP is assigned, check that a DHCP server is reachable on that subnet.
Common Mistakes
Applying 'ip address dhcp' in global configuration mode instead of interface mode, causing a syntax error.
Forgetting to enable the interface with 'no shutdown' before or after the command.
Assuming the router will get the same IP every time; DHCP leases are dynamic unless reserved.
Related Commands
ip address [ip] [mask]
Assigns an IPv4 address and subnet mask to an interface, enabling IP communication on that interface.
no shutdown
Enables an interface that has been administratively disabled, allowing it to forward traffic and participate in network operations.
show ip interface brief
Displays a summary of all IP interfaces on the device, including their IP address, status, and protocol state, used for quick verification of interface configuration and connectivity.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions