Description

Switch is registering itself with its serial number when sending DHCP requests instead of hostname.

Symptoms

To change the behavior of the EX DHCP client to send the actual configured hostname as the DHCP Client option 12 Hostname, instead of the serial number, please follow the below:
 

EXAMPLE:

Below are the 2 examples where the interface/vme connected towards the server is shared:


A)Cx config example

The device in question along with the default vme interface configuration:

> show chassis hardware
Hardware inventory:
Item Version Part number Serial number Description
Chassis HV1234567890 EX2300-C-12P

> show configuration interfaces vme
unit 0 {
  family inet {
    dhcp {
      client-identifier {
      user-id ascii 8403280bcff0-M4aLquH9;
    }
      retransmission-attempt 60;
      vendor-id Juniper;
      force-discover;


When looking at a packet capture on the DHCP server, following is in the DHCP request:

  Client-ID Option 61, length 22: "8403280bcff0-M4aLquH9"
  Hostname Option 12, length 12: "
HV1234567890"

B )Lab example

root@d10-10> show configuration interfaces xe-0/1/0 

unit 0 {

    family inet {

        dhcp {

            client-identifier {

                user-id ascii JZ0216360016;

            }

            retransmission-attempt 60;

            vendor-id Juniper;

            force-discover;

}

Solution

We were able to get the switch to send the hostname by using the config knob highlighted below:
 
root@d10-10> show configuration interfaces xe-0/1/0 
unit 0 {
    family inet {
        dhcp {
            client-identifier {
                user-id ascii JZ0216360016;
            }
            retransmission-attempt 60;
            vendor-id Juniper;
            force-discover;
            options {
                number 12 hex-string 6431302d3130;
            }
        }

    }
}
  
set interfaces <Logical interface towards server/vme) family inet dhcp options number 12 hex-string <hex value needs to be put converted by hostname>


Example: set interfaces xe-0/1/0.0 family inet dhcp options number 12 hex-string 6431302d3130
 

You will have to convert the hostname from text to hex string (can do it herehttps://string-functions.com/string-hex.aspx)
 


Here are the Packet capture results from Lab device:
 
08:01:12.643554  In 
       Juniper PCAP Flags [Ext, no-L2, In], PCAP Extension(s) total length 16
         Device Media Type Extension TLV #3, length 1, value: Ethernet (1)
         Logical Interface Encapsulation Extension TLV #6, length 1, value: Ethernet (14)
         Device Interface Index Extension TLV #1, length 2, value: 674
         Logical Interface Index Extension TLV #4, length 4, value: 557
       -----original packet-----
       PFE proto 2 (ipv4): (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto: UDP (17), length: 415) 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from 40:71:83:55:08:71, length 319, xid 0x1a8d6f9a, Flags [Broadcast] (0x8000)
         Client-Ethernet-Address 40:71:83:55:08:71
         Vendor-rfc1048 Extensions
           Magic Cookie 0x63825363
           Parameter-Request Option 55, length 14: 
             Default-Gateway, Lease-Time, Subnet-Mask, Domain-Name
             Domain-Name-Server, TFTP, BF, Option 120
             Netbios-Name-Server, Vendor-Option, Option 150, Hostname
             LOG, NTP
           Requested-IP Option 50, length 4: 10.3.3.2
           DHCP-Message Option 53, length 1: Request
           Client-ID Option 61, length 13: "JZ0216360016"
           Hostname Option 12, length 12: "JZ0216360016"
           Vendor-Class Option 60, length 7: "Juniper"
           Lease-Time Option 51, length 4: 86400
           Hostname Option 12, length 6: "d10-10"

 

Modification History

2024-04-15 : Modified 
2024-03-13 : Article Created