Community discussions

MikroTik App
 
migdsb
just joined
Topic Author
Posts: 3
Joined: Wed Sep 15, 2021 2:54 pm

domain-search DHCP option not taking effect

Wed Sep 15, 2021 3:07 pm

I'm trying to set up the "domain-search" option on the DHCP server running on a hEx S router, but after trying everything I could think of, I've finally decided to ask the experts here on the forum!

Please consider the following DHCP configuration:
/ip dhcp-server print detail 
Flags: D - dynamic, X - disabled, I - invalid 
 0    name="defconf" interface=bridge lease-time=10m address-pool=dhcp authoritative=yes use-radius=no lease-script="" 
      dhcp-option-set=defconf-options 

 /ip dhcp-server option sets print detail
 0 name="defconf-options" options=domain-search 

/ip dhcp-server option print detail
0 name="domain-search" code=119 value="0x02'softgeist'0x03'lan'0x00" raw-value="02736f66746765697374036c616e00" 
As you can see from the above, an options set is associated with the DHCP server and it contains a single option, "domain-search" (code 119), which is set to the string "softgeist.lan". I may have botched the escaping and/or pointers that the spec requires though.

The problem I'm having is that whenever I establish a connection via DHCP, I don't see `domain-search` being set at all, as you can see in the following logs:
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4668] dhcp4 (eno1): activation: beginning transaction (timeout in 45 seconds)
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4853] dhcp4 (eno1): option dhcp_lease_time      => '600'
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4853] dhcp4 (eno1): option domain_name_servers  => '192.168.1.2 62.169.70.160 212.113.177.241'
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4854] dhcp4 (eno1): option domain_search        => ''
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4854] dhcp4 (eno1): option expiry               => '1631707108'
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4854] dhcp4 (eno1): option ip_address           => '192.168.1.21'
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4854] dhcp4 (eno1): option next_server          => '192.168.1.2'
Sep 15 12:48:28 tux NetworkManager[895]: <info>  [1631706508.4854] dhcp4 (eno1): option ntp_servers          => '213.205.64.213 213.205.64.149'
Can someone please help me diagnose what's going wrong here?
 
migdsb
just joined
Topic Author
Posts: 3
Joined: Wed Sep 15, 2021 2:54 pm

Re: domain-search DHCP option not taking effect

Wed Sep 15, 2021 4:31 pm

I ended up solving this. Turns out the encoding of the string assigned to the `domain-search` option was wrong. The correct encoded value is:
0x09'softgeist'0x03'lan'0x00
Thankfully, I stumbled upon https://jjjordan.github.io/dhcp119/, which does the encoding and even shows the commands one needs to input for several router OSes.

Who is online

Users browsing this forum: AkosGergely, araqiel, GoogleOther [Bot], Marc1963, miks and 84 guests