Cisco routers can be configure as both DHCP servers and DHCP clients. An interface on a router that connects to the Internet Service Provider (ISP) is often configured as a DHCP client. This way, the ISP can provide the IP information to the client device.
To configure an interface as a DHCP client, the ip address dhcp interface mode command is used. Consider the following example:
We have a small network consisting of a router and a DHCP server. We want to configure the interface Gi0/0 on the router as a DHCP client. This is how this is done:
R1(config)#int Gi0/0 R1(config-if)#ip address dhcp
We can verify that the Gi0/0 interface has indeed got its IP address from the DHCP server by running the show ip int brief command:
R1#show ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.0.1 YES DHCP up up GigabitEthernet0/1 unassigned YES unset administratively down down
The DHCP keyword in the method column indicates that the IP information were obtained by the DHCP server.
If you want to configure a Cisco switch as a DHCP client, the ip address dhcp command is used under the VLAN 1 configuration mode.
Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.
We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: