Home » Network Services » Configuring Cisco router as a DHCP client

Configuring Cisco router as a DHCP client

A Cisco router interface can be configured to obtain an IP Address from DHCP server.

Router(config-if)# ip address dhcp

Once I was configuring a router via console which I had to replace with the current production router in the site over the weekend. It was a broadcast network; I had to connect the router to the LAN to pull the standard IOS image from the TFTP server. I didn’t want to get a static IP assigned to the interface – it takes time to get an unused static IP – so I configured one unused interface on the router to be a DHCP client and connected to the network to gain access to the TFTP server temporarily.

Well, the router got an IP address assigned; I could reach the TFTP server and was loading the image. While the image was loading, I started getting alerts stating that DHCP server is not reachable. What? It can’t be!! I just got an IP assigned from the server. Soon helpdesk started receiving complaints that users are not getting IP assigned by DHCP server. It seems like I was the last one to get an IP address from the server. No one is able to reach the server after.

I too couldn’t ping the server. When I did a traceroute it was not taking the default gateway instead it was dropping at the first-hop which seems to be an IP address that doesn’t belongs to any device. Wait a second….. Is it not the IP that the new router been assigned just now? Yes it is!! How could this happen?

When I checked the routing table on the new router, I could see a /32 entry for the DHCP server address in it.

 S*    0.0.0.0/0 [254/0] via 10.31.34.1

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

S        10.31.13.214/32 [254/0] via 10.31.34.1, FastEthernet0/0

C        10.31.34.0/23 is directly connected, FastEthernet0/0

L        10.31.34.182/32 is directly connected, FastEthernet0/0

When a Cisco router gets an IP address assigned to an interface by a DHCP server, it installs a static host route (/32) for the DHCP server (10.31.13.214) pointing it to the exiting interface. To make things worse, I already configured the router which had EIGRP and “redistribute static” statement in it. The new router formed an EIGRP neighborship with the existing site router and distributed the host route of the DHCP server to the entire network. This attracted all the traffic for DHCP server towards the new router black holing the DHCP server.

I can imagine why Cisco wanted to do this; they always wanted the router to prefer the interface via which the IP address was assigned to reach the server if you configure more than one interface on the same router to be a DHCP client.

 

 



Incoming search terms for the article:

Leave a Reply