DHCP

DHCP Client

Sections: 

Overview: 

  • Just like PC clients on the network, Cisco routers and layer 3 switches can serve as DHCP clients receiving an IP address from a DHCP server
  • This is commonly implemented in situations where a router or any other layer 3 device such as a switch or firewall is connected to a Internet Service Provider or ISP to acquire a WAN IP address
  • A WAN IP address is a public IP address that connects to the Internet or an external network

Lab Topology

Scenario: 

  • In this lab scenario, we will configure the WAN interface Gi0/0 of the Gateway-R1 router as a DHCP client towards the ISP device for external Internet access
  • Trunk links, VLAN assignments, and ROAS Inter-VLAN routing have already been configured in the topology
  • In this lab example, I will use a Raspberry Pi to simulate the ISP device to get out to the Internet 
  • My Raspberry Pi will act as an intermediary device facilitating communication between my GNS3 lab topology and my home ISP router equipment. I will configure my own DHCP server on the Raspberry Pi also acting as a DHCP client to get a IP address from my ISP router via wireless
  • I will create a DHCP server scope on the Raspberry Pi serving as the primary DHCP server for my GNS3 topology
  • We will analyze a packet capture on the Gateway-R1 router WAN link to analyze the D.O.R.A process messages between client and server

Configuration

Raspberry Pi DHCP Setup 

Using the management GUI of the Raspberry Pi running OpenWRT firmware, I have setup the DHCP server to serve the LAN interface and to assign an IP address to my GNS3 Gateway-R1 router. 

LAN interface of the Raspberry Pi using the 192.168.99.0/24 subnet.

DHCP server scope range and lease time parameters.

DHCP server options including options for default gateway and DNS. 

Active LAN DHCP leases including my GNS3 virtual machine.

Raspberry Pi acting as a DHCP client towards my ISP router via wireless.

Gateway-R1

Verify no IP address is assigned on the WAN Gi0/0 interface. 

Configure the Gi0/0 WAN interface as a DHCP client and optionally assign a DHCP hostname for the device.

Verify the DHCP IP address of the Gi0/0 interface. 

Test gateway and Internet connectivity from the router. 

Verify the active DHCP leases of the Raspberry Pi DHCP server for the router entry - hostname GNS3_Gateway-R1.

DHCP Client Packet Captures 

Scenario: 

  • In this scenario, we will analyze a packet capture on Gateway-R1's Gi0/0 interface and examine the D.O.R.A process messages between the Raspberry Pi DHCP server and the Gateway-R1 router

Discover Packet 

Offer Packet

Request Packet

Acknowledgement Packet 

ICMP Packets 

ICMP Packets from the router destined to the default gateway Raspberry Pi and the Internet.