Description

This article will assist with Dynamic Host Configuration Protocol (DHCP) troubleshooting in a step-by-step approach with Juniper Networks MX Series Routers.

Symptoms

Issue is reported with client does not receive IP address from DHCP server

The DHCP relay agent operates as the interface between DHCP clients and the server. The DHCP Relay Agent relays DHCP messages between DHCP clients and DHCP servers on different IP networks.

Considering the below Topology

 

Screenshot 2024-10-03 at 10.41.01 AM.png

 

The DHCP relay binding is not in bound state

{master}

User-R1-re> show dhcp relay binding

IP address       Session Id Hardware address  Expires    State     Interface

0.0.0.0          340872069  xx:xx:xx:xx:xx:e0 0          SELECTING ae4.3126           

 

{master}

User-R1-re> show dhcp relay binding   

IP address       Session Id Hardware address  Expires    State     Interface

0.0.0.0          340872069  xx:xx:xx:xx:xx:e0 0          SELECTING ae4.3126           

 

Solution

Perform the following steps to troubleshoot DHCP issue

DHCP – server Ip - XXX.XX.126.28

  1. Map out the network topology and identify the components.

 

  • DHCP Server
  • DHCP Relay Agent
  • DHCP Client

 

The Above topology represent the MX working as DHCP relay agent

The client MAC address (Dekstop MAC ) - xx:xx:xx:xx:xx:e0 is connected to either LHR-KB / LHR-JH

2.        Is the DHCP client connected to the DHCP Server with a DHCP Relay Agent?
·         Yes - Continue to Step 3.

The DHCP server is connected to the DHCP client through the Relay Agent 
3.        A DHCP Relay Agent needs to be configured if the DHCP client and the DHCP Servers are connected in different broadcast domains.
 
R1-RE0 – >

set forwarding-options dhcp-relay server-group TEST xxx.xx.126.28

set forwarding-options dhcp-relay active-server-group TEST

set forwarding-options dhcp-relay group ALL forward-only -- >>>>Forward specified DHCP client packets

set forwarding-options dhcp-relay group ALL interface ae3.0

set forwarding-options dhcp-relay group ALL interface ae3.20

set forwarding-options dhcp-relay group ALL interface ae3.3123

set forwarding-options dhcp-relay group ALL interface ae3.3138

 
R5-RE0 -- > 

set interfaces ae4 unit 3126 description TEST-DHCP

set forwarding-options dhcp-relay server-group TEST xxx.xx.126.28

set forwarding-options dhcp-relay active-server-group TEST

set forwarding-options dhcp-relay group ALL overrides

set forwarding-options dhcp-relay group ALL interface ae4.6

set forwarding-options dhcp-relay group ALL interface ae4.3123

set forwarding-options dhcp-relay group ALL interface ae4.3126

 

4.      Do a packet capture on the interfaces to analyze if the DORA process works.

Collect the below outputs

monitor traffic interface x matching "port 67 || port 68" no-resolve detail

monitor traffic interface x matching "upd port 67 || upd port 68" no-resolve detail

 

Laptop ---R5-RE0 -– > ae4.2 -- R5-RE0 -- ae4.3123  --- ae3.3123-- R1-RE0 – ae3.20 ->>---<< Switch-QFX -> Firewall-SRX1500-> DHCP server --> Not working

DHCP, Request packets – on interface ae4.2

 

{master}

User-Re0>  monitor traffic interface ae4.2 matching "udp port 67 || udp port 68" no-resolve detail      

Address resolution is OFF.

Listening on ae4.2, capture size 1514 bytes

 

16:55:45.649373 Out IP (tos 0x0, ttl 63, id 46185, offset 0, flags [DF], proto: UDP (17), length: 576) xx.x.177.199.68 > xxx.xx.126.28.67: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:e0, length 548, xid 0x32d1d10a, Flags [none]

         Client-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:e0

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: Release

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:e0

           Hostname Option 12, length 11: "EG8145X6-10"

           Requested-IP Option 50, length 4: <IP Address>

           Server-ID Option 54, length 4: xxx.xx.xxx.28

16:55:56.014246 Out IP (tos 0x0, ttl 64, id 40460, offset 0, flags [none], proto: UDP (17), length: 576) <IP Address>.67 > xxx.xx.126.28.67: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:e0, length 548, hops 1, xid 0x27b39276, Flags [none]

         Gateway-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:e0

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: Discover

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:e0

           Hostname Option 12, length 11: "EG8145X6-10"

           Requested-IP Option 50, length 4: 10.2.177.199

           Parameter-Request Option 55, length 15:

             Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname

             Domain-Name, BR, Static-Route, YD

             YS, NTP, Vendor-Option, POSIX-TZ

             Option 120, Classless-Static-Route, Classless-Static-Route-Microsoft

 

DHCP, Request and DHCP, Reply going out from  ae3.3123

 

{master}

User-Re0> monitor traffic interface ae3.3123 matching "udp port 67 || udp port 68" no-resolve detail  

Address resolution is OFF.

Listening on ae3.3123, capture size 1514 bytes

 

16:41:41.327475 In IP (tos 0x0, ttl 63, id 8090, offset 0, flags [DF], proto: UDP (17), length: 576) <IP Address>.68 > xxx.xx.126.28.67: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:e0, length 548, xid 0xf66f852c, Flags [none]

         Client-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:e0

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: Release

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:e0

           Hostname Option 12, length 11: "EG8145X6-10"

           Requested-IP Option 50, length 4: <IP Address>

           Server-ID Option 54, length 4: xxx.xx.126.28

16:41:51.540410 Out IP (tos 0x10, ttl 125, id 16306, offset 0, flags [DF], proto: UDP (17), length: 328) xx.xx.126.28.67 > <IP Address>.67: BOOTP/DHCP, Reply, length 300, hops 1, xid 0x1777f410, Flags [none]

         Your-IP <IP Address>

         Gateway-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:e0

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: Offer

           Subnet-Mask Option 1, length 4: 255.255.255.0

           Default-Gateway Option 3, length 4: <IP Address>

           Domain-Name-Server Option 6, length 8: xx.xx.100.37,xxx.xx.100.38

           Hostname Option 12, length 11: "eg8145x6-10"

           Lease-Time Option 51, length 4: 7200

           Server-ID Option 54, length 4: xx.xx.126.28

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:e0

 

To check if DHCP request  packet is going out from ae3.20 towards QFX and SRX

Enable Firewall filter to count packets for DHCP request and reply

 

set firewall family inet filter DHCP-RELAY-TEST-IN term 1 from protocol udp

set firewall family inet filter DHCP-RELAY-TEST-IN term 1 from source-port 68

set firewall family inet filter DHCP-RELAY-TEST-IN term 1 then count BOOTP-REQUEST-COUNT

set firewall family inet filter DHCP-RELAY-TEST-IN term 1 then log

set firewall family inet filter DHCP-RELAY-TEST-IN term 1 then accept

set firewall family inet filter DHCP-RELAY-TEST-IN term 2 then accept

set firewall family inet filter DHCP-RELAY-TEST-OUT term 1 from protocol udp

set firewall family inet filter DHCP-RELAY-TEST-OUT term 1 from destination-port 67

set firewall family inet filter DHCP-RELAY-TEST-OUT term 1 then count BOOTP-REPLY-COUNT

set firewall family inet filter DHCP-RELAY-TEST-OUT term 1 then log

set firewall family inet filter DHCP-RELAY-TEST-OUT term 1 then accept

set firewall family inet filter DHCP-RELAY-TEST-OUT term 2 then accept

 

 

set interface ae3.20 family inet filter input DHCP-RELAY-TEST-IN

set interface ae3.20 family inet filter output DHCP-RELAY-TEST-OUT

 

Verification : 

The Below Output will state the DHCP relay state should be in selecting state under working conditions

show dhcp relay binding

show dhcp relay statistics

 

In the Above case no issue was reported on MX

As per the testing Client tested in a different MW with a different Dekstop MAC 5c:60:ba:70:59:6b and found DHCP, Request and DHCP, Reply

Hence concluded no issue with MX

 

{master}

[User]RE1-re0> monitor traffic interface ae3.20 matching "port 67 || port 68" no-resolve detail   

Address resolution is OFF.

Listening on ae3.20, capture size 1514 bytes

 

16:44:57.620160 Out IP (tos 0x0, ttl 127, id 53247, offset 0, flags [none], proto: UDP (17), length: 344) <IP Address> > xxx.xx.126.28.67: BOOTP/DHCP, Request from xx:xx:xx:xx:xx:6b, length 316, xid 0x93cafb6b, Flags [none]

         Client-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:6b

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: Request

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:6b

           Hostname Option 12, length 15: "DESKTOP-BRPE7R0"

           FQDN Option 81, length 18: "DESKTOP-BRPE7R0"

           Vendor-Class Option 60, length 8: "MSFT 5.0"

           Parameter-Request Option 55, length 14:

             Subnet-Mask, Default-Gateway, Domain-Name-Server, Domain-Name

             Router-Discovery, Static-Route, Vendor-Option, Netbios-Name-Server

             Netbios-Node, Netbios-Scope, Option 119, Classless-Static-Route

             Classless-Static-Route-Microsoft, Option 252

16:44:57.674738 In IP (tos 0x10, ttl 126, id 0, offset 0, flags [DF], proto: UDP (17), length: 336) xxx.xx.126.28.67 > <IP Address>.68: BOOTP/DHCP, Reply, length 308, xid 0x93cafb6b, Flags [none]

         Client-IP <IP Address>

         Your-IP <IP Address>

         Client-Ethernet-Address xx:xx:xx:xx:xx:6b

         Vendor-rfc1048 Extensions

           Magic Cookie 0x63825363

           DHCP-Message Option 53, length 1: ACK

           Subnet-Mask Option 1, length 4: 255.255.255.0

           Default-Gateway Option 3, length 4: <IP Address>

           Domain-Name-Server Option 6, length 8: xxx.xx.100.37,xxx.xx.100.38

           Lease-Time Option 51, length 4: 7200

           Server-ID Option 54, length 4: xxx.xx.126.28

           Client-ID Option 61, length 7: ether xx:xx:xx:xx:xx:6b

           FQDN Option 81, length 19: [N] "desktop-brpe7r0."

 

Modification History

2024-09-29 : Article Created