Hi, new to OPNsense / testing for potential deployement [25.7.7_4]
Searched the forum about this, but didn't see any results specific to hostname.
With debian/network-manager, dhcp-send-hostname=0 omits sending hostname in the request to my DHCP server.
I've tested OPNsense WAN interface on a private network with a DHCP server and can confirm it's sending the hostname in the DHCP request even if hostname is unset in dhcp client options under WAN interface [GUI].
Is there a way to omit sending hostname information in the DHCP request to a DHCP server?
Many thanks in advance.
What are you hoping to achieve with that?
Your upstream (ISP) DHCP server identifies you by the MAC address of your WAN interface, if you get the IP by pure DHCP, if no PPPoE is involved. And they will have to identify you to be able to determine that you are a valid customer.
As a result I don't think you gain anything by that.
But you can set the DHCP client configuration to 'Config File Override' and supply your own dhclient.conf with sending an empty hostname and dhcp-client identifier. The generate one is usually called /var/etc/dhclient_wan.conf and you copy and modify that.
Addition: setting the hostname to one character like "x" or "_" (in the GUI) did also make it show up as empty on the upstream OPNsense. But maybe that's just how they handle it, or it's a voilation of DHCP protocol, or or or.
No hostname should be sent if you don't specify one in the DHCP client settings.
Double check
- the generated config file (/var/etc/dhclient_{$interface}.conf) and
- a packet capture of the DHCP handshake.
Cheers
Maurice
Quote from: Maurice on Today at 01:01:50 AMNo hostname should be sent if you don't specify one in the DHCP client settings.
That is certainly not true for me on a 25.10_2 business edition.
I changed the name of the OPNsense installation, made sure the 'hostname' field was empty and did a WAN refresh and the upstream router (otherSense in that case) shows the new name.
In the dhclient_wan.conf file no hostname or client identifier is set.
I'll do a package capture next.
-> Done : the hostname is send if the field is empty. The client sends 'OPNsense' (the System hostname set) and the server responses with hostname field 'opnsense'.
That is a sensible behavior for me. Like if you don't set anything for DNS in the DHCP settings, the router IP is assumed. What is maybe somewhat surprising is that if hostname or client-id is no set in the conf file and dhclient sends the hostname anyway.