Skip to content

Hostname not sent via DHCP request #2537

Closed
@adydeac

Description

@adydeac

Hardware:

Board: ESP32 Dev Module
Core Installation version: 1.0.1
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Debian

Description:

Hi,
I've noticed that somehow (I guess recently?) the hostname is not sent when making DHCP calls:

tcpdump -Anev -s 1024 -i br-lan port 67 or port 68 or port 69

tcpdump: listening on br-lan, link-type EN10MB (Ethernet), capture size 1024 bytes
01:22:43.011475 30:ae:a4:14:3f:e0 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 350: (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto UDP (17), length 336)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 30:ae:a4:14:3f:e0, length 308, xid 0xaedfb4c4, Flags [none]
Client-Ethernet-Address 30:ae:a4:14:3f:e0
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
MSZ Option 57, length 2: 576
Requested-IP Option 50, length 4: 172.16.0.195
Parameter-Request Option 55, length 12:
Subnet-Mask, Default-Gateway, BR, Domain-Name-Server
Domain-Name, Netbios-Name-Server, Netbios-Node, Netbios-Scope
Router-Discovery, Static-Route, Classless-Static-Route, Vendor-Option
E..P.................D.C.<.}............................0...?...........................................................................................................................................................................................................c.Sc5..9..@2.....7......,./.!y+.........................................
01:22:43.014082 e8:de:27:6d:29:35 > 30:ae:a4:14:3f:e0, ethertype IPv4 (0x0800), length 342: (tos 0x0, ttl 64, id 7494, offset 0, flags [none], proto UDP (17), length 328)
172.16.0.1.67 > 172.16.0.195.68: BOOTP/DHCP, Reply, length 300, xid 0xaedfb4c4, Flags [none]
Your-IP 172.16.0.195
Server-IP 172.16.0.2
Client-Ethernet-Address 30:ae:a4:14:3f:e0
sname "tftp"
file "pxelinux.0"
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: ACK
Server-ID Option 54, length 4: 172.16.0.1
Lease-Time Option 51, length 4: 259200
RN Option 58, length 4: 129600
RB Option 59, length 4: 226800
Subnet-Mask Option 1, length 4: 255.255.255.0
BR Option 28, length 4: 172.16.0.255
Default-Gateway Option 3, length 4: 172.16.0.1
Domain-Name-Server Option 6, length 4: 172.16.0.1
Domain-Name Option 15, length 3: "lan"
E..H.F..@..{.........C.D.4Z*............................0...?...........tftp............................................................pxelinux.0......................................................................................................................c.Sc5..6.....3.....:....@;...u...........................lan....

This is the on the same router, but with an request from an android phone:

I am using the ESP-WROOM-32 chipset and Arduino IDE on Linux.

The code snippet is:

Sketch: (leave the backquotes for code formatting)

//Change the code below by your sketch
#include <Arduino.h>

void setup() {
  WiFi.begin(wifiSSID, wifiPass);
  nodeName = "shower-" + WiFi.macAddress();
  nodeName.replace(":", "");
  char _nodeName[20]; nodeName.toCharArray(_nodeName, 20);
  WiFi.setHostname(_nodeName);
  WiFi.mode(WIFI_STA);
}

void loop() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions