On Mon, Mar 09, 2020 at 01:09:48PM +0100, Kristian Evensen wrote: > Hello, > > I am trying to configure dnsmasq to export DHCP option 78 (rfc2610) to > the clients on my network, but I am struggling to make it work. My > problems seems to be caused by the "Mandatory" byte that has to be > part of the option. > > My initial attempt was to add the following to dnsmasq.conf: > dhcp-option-force=78,1,192.168.5.14 > > However, this caused dnsmasq to fail with the following error message: > Mon Mar 9 11:55:55 2020 daemon.crit dnsmasq[3232]: bad IPv4 address > at line 38 of /etc/dnsmasq.conf > > I then tried to replace "1" with 0x01 and 1b, but in my packet capture > I see that the values are sent as strings (so "0x01" and "1b"). I then > tried to just add 1 (so dhcp-option-force=78,1), which worked in the > sense that dnsmasq did not fail to start and an integer was sent to my > client. > > Has anyone managed to configure dnsmasq to export option 78 or know > how to combine an integer with an address list? My router is running > dnsmasq verson 2.80.
With 2.81rc3 I can reproduce the error and dhcp-option-force=78,0x01,192.168.5.14 works ... <screenshot> $ sudo systemctl status dnsmasq-virt.service ● dnsmasq-virt.service - dnsmasq virt - DHCP and DNS server Loaded: loaded (/etc/systemd/system/dnsmasq-virt.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Mon 2020-03-09 21:42:31 CET; 25s ago Process: 2998 ExecStart=/home/gs0604/src/mailinglists/dnsmasq/src/dnsmasq --keep-in-foreground --conf-file=/home/gs0604/etc/dnsmasq-virt0.conf (code=exited, statu Main PID: 2998 (code=exited, status=1/FAILURE) mrt 09 21:42:31 trancilo systemd[1]: Started dnsmasq virt - DHCP and DNS server. mrt 09 21:42:31 trancilo dnsmasq[2998]: dnsmasq: bad IPv4 address at line 36 of /home/gs0604/etc/dnsmasq-virt0.conf mrt 09 21:42:31 trancilo dnsmasq[2998]: bad IPv4 address at line 36 of /home/gs0604/etc/dnsmasq-virt0.conf mrt 09 21:42:31 trancilo systemd[1]: dnsmasq-virt.service: Main process exited, code=exited, status=1/FAILURE mrt 09 21:42:31 trancilo dnsmasq[2998]: FAILED to start up mrt 09 21:42:31 trancilo systemd[1]: dnsmasq-virt.service: Failed with result 'exit-code'. $ vi ~/etc/dnsmasq-virt0.conf $ sudo systemctl restart dnsmasq-virt.service gs0604@trancilo:~/src/mailinglists/dnsmasq $ sudo systemctl status dnsmasq-virt.service ● dnsmasq-virt.service - dnsmasq virt - DHCP and DNS server Loaded: loaded (/etc/systemd/system/dnsmasq-virt.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2020-03-09 21:44:23 CET; 9s ago Main PID: 3050 (dnsmasq) Tasks: 1 (limit: 4915) Memory: 340.0K CGroup: /system.slice/dnsmasq-virt.service └─3050 /home/gs0604/src/mailinglists/dnsmasq/src/dnsmasq --keep-in-foreground --conf-file=/home/gs0604/etc/dnsmasq-virt0.conf mrt 09 21:44:23 trancilo dnsmasq-tftp[3050]: warning: /srv/tftp inaccessible mrt 09 21:44:23 trancilo dnsmasq[3050]: reading /etc/resolv.conf mrt 09 21:44:23 trancilo dnsmasq[3050]: using nameserver 172.24.0.7#53 mrt 09 21:44:23 trancilo dnsmasq[3050]: read /etc/hosts - 73 addresses mrt 09 21:44:23 trancilo dnsmasq-dhcp[3050]: read /home/gs0604/etc/dnsmasq-virt0-optsfile mrt 09 21:44:23 trancilo dnsmasq-dhcp[3050]: read /home/gs0604/etc/dnsmasq-virt0-hostsdir/deb10pxe mrt 09 21:44:23 trancilo dnsmasq-dhcp[3050]: read /home/gs0604/etc/dnsmasq-virt0-hostsdir/db10 mrt 09 21:44:23 trancilo dnsmasq-dhcp[3050]: read /home/gs0604/etc/dnsmasq-virt0-hostsdir/nebo mrt 09 21:44:23 trancilo dnsmasq-dhcp[3050]: read /home/gs0604/etc/dnsmasq-virt0-hostsdir/vmrtr mrt 09 21:44:31 trancilo dnsmasq-dhcp[3050]: RTR-ADVERT(ovsbr0) fd45:bd2a:bb0b:1001:: $ grep =78 ~/etc/dnsmasq-virt0.conf dhcp-option-force=78,0x01,192.168.5.14 $ </screenshot> Regards Geert Stappers -- Silence is hard to parse _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss