Configure a DHCPv4 Client
Summary
This topic configure a router as a DHCPv4 client. Start learning CCNA 200-301 for free right now!!
Table of Contents
Cisco Router as a DHCPv4 Client
There are scenarios where you might have access to a DHCP server through your ISP. In these instances, you can configure a Cisco IOS router as a DHCPv4 client. This topic walks you through that process.
Sometimes, Cisco routers in a small office or home office (SOHO) and branch sites have to be configured as DHCPv4 clients in a similar manner to client computers. The method used depends on the ISP. However, in its simplest configuration, the Ethernet interface is used to connect to a cable or DSL modem.
To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command.
In the figure, assume that an ISP has been configured to provide select customers with IP addresses from the 209.165.201.0/27 network range after the G0/0/1 interface is configured with the ip address dhcp command.
Configuration Example
To configure an Ethernet interface as a DHCP client, use the ip address dhcp interface configuration mode command, as shown in the example. This configuration assumes that the ISP has been configured to provide select customers with IPv4 addressing information.
SOHO(config)# interface G0/0/1 SOHO(config-if)# ip address dhcp SOHO(config-if)# no shutdown Sep 12 10:01:25.773: %DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0/1 assigned DHCP address 209.165.201.12, mask 255.255.255.224, hostname SOHO
The show ip interface g0/1 command confirms that the interface is up and that the address was allocated by a DHCPv4 server.
SOHO# show ip interface g0/0/1 GigabitEthernet0/0/1 is up, line protocol is up Internet address is 209.165.201.12/27 Broadcast address is 255.255.255.255 Address determined by DHCP (output omitted)
Home Router as a DHCPv4 Client
Home routers are typically already set to receive IPv4 addressing information automatically from the ISP. This is so that customers can easily set up the router and connect to the internet.
For example, the figure shows the default WAN setup page for a Packet Tracer wireless router. Notice that the internet connection type is set to Automatic Configuration – DHCP. This selection is used when the router is connected to a DSL or cable modem and acts as a DHCPv4 client, requesting an IPv4 address from the ISP.
Various manufacturers of home routers will have a similar setup.
Syntax Checker – Configure a Cisco Router as DHCP Client
In this Syntax Checker activity, you will configure a Cisco router as DHCP client.
Enter interface configuration mode. Use g0/0/1 as the interface name.
SOHO(config)#interface g0/0/1
Configure the interface to acquire IPv4 addressing information from the ISP.
SOHO(config-if)#ip address dhcp
Activate the interface.
SOHO(config-if)#no shutdown Sep 12 10:01:25.773: %DHCP-6-ADDRESS\_ASSIGN: Interface GigabitEthernet0/0/1 assigned DHCP address 209.165.201.12, mask 255.255.255.224, hostname SOHO
Return to privileged EXEC mode.
SOHO(config-if)#end
Use the show ip interface g0/0/1 command to verify the IPv4 information.
SOHO#show ip interface g0/0/1 GigabitEthernet0/0/1 is up, line protocol is up Internet address is 209.165.201.12/27 Broadcast address is 255.255.255.255 Address determined by DHCP (output omitted)
Ready to go! Keep visiting our networking course blog, give Like to our fanpage; and you will find more tools and concepts that will make you a networking professional.