Router as DHCP client

How to Configure Router as DHCPv4 Client

In some cases, we need a router to be configured as DHCPv4 clients just like a client computer. But this method is not recommended for routers in an internal network. The dynamic addressing is extremely useful for routers that connect to the Internet through an ISP.

We can simply connect a router using with just plug-in the Ethernet cable. To configure an Ethernet interface as a DHCPv4 client we use the ip address dhcp command in interface configuration mode.

When an interface on the router is configured with ip address dhcp command, it can dynamically learn its IP address, and network mask, via DHCP. The router can also learn its TFTP server address, NETBIOS name server, DNS servers, vendor-specific information, static routes, domain name, and default router information.

Configuration

The Figure below contains the topology including DHCPSERVER and Client. You may suppose that the DHCPSEVER is an ISP server configured to provide DHCP service to clients with IP addresses from the selected of 192.168.1.2 – 192.168.1.100.

After the Fa0/0 interface of the client, the router is configured with the ip address dhcp command, We can verify the configuration using the show ip interface fa0/0 command confirms that the interface is up and that the address was allocated by a DHCPv4 server. Now lets come to the configuration:

DHCPv4 client

DHCP Server Configuration

  • server(config)#ip dhcp excluded-address 192.168.1.1
  • server(config)#ip dhcp pool My-pool
  • server(dhcp-config)#network 192.168.1.0 255.255.255.0
  • server(dhcp-config)#default-router 192.168.1.1
  • server(dhcp-config)#exit
  • server(config)#

DHCP Client Configuration

  • client(config)#interface fastEthernet 0/0
  • client(config-if)#ip address dhcp
  • client(config-if)#exit
  • client(config)#

Now check and verify that the address configuration using the show ip interface fa0/0 command. The figure below illustrates the output of this command.

DHCP client output
Avatar of Asad Ijaz

Asad Ijaz

NetworkUstad's lead networking architect with CCIE certification. Specializes in CCNA exam preparation and enterprise network design. Authored 2,800+ technical guides on Cisco systems, BGP routing, and network security protocols since 2018. Picture this: I'm not just someone who writes about tech; I'm a certified expert in the field. I proudly hold the titles of Cisco Certified Network Professional (CCNP) and Cisco Certified Network Associate (CCNA). So, when I talk about networking, I'm not just whistling in the dark; I know my stuff! My website is like a treasure trove of knowledge. You'll find a plethora of articles and tutorials covering a wide range of topics related to networking and cybersecurity. It's not just a website; it's a learning hub for anyone who's eager to dive into the world of bits, bytes, and secure connections. And here's a fun fact: I'm not a lone wolf in this journey. I'm a proud member and Editor of Team NetworkUstad. Together, we're on a mission to empower people with the knowledge they need to navigate the digital landscape safely and effectively. So, if you're ready to embark on a tech-savvy adventure, stick around with me, Asad Ijaz Khattak. We're going to unravel the mysteries of technology, one article at a time!"