DHCP option 66 not being sent out

Hi

I have to provision Voip phones and in order to do so need options 160 and 66 to be issued by DHCP. I have installed OpenWrt on a Raspberry Pi and all seemed well but the phones will not provision. I downloaded a program called DHCPtest and when connected to my original router I can see option 66 being delivered, however when I connect to OpenWrt and run the same test it is not delivered.
In /etc/config/dhcp it is set like this....

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'
        list dhcp_option '160,ascii,https://polydms.digitalbusiness.telstra.com/
        list dhcp_option '6,8.8.8.8'
        list dhcp_option '66,dms.digitalbusiness.telstra.com'

How can I force OpenWrt to send option 66 to all users?

are the other DHCP options sent out ?
I'm asking, since there's a ' missing in the 1st dhcp_option parameter, or is it perhaps a C&P error ?

1 Like

Probably copy and paste as option 160 goes out but I don't see how. will have to get back in there.

Ok so just checked and that option 160 is a longer string than that, it has just pasted to the width of the window, there is a ' at the end.

Try using the dnsmasq dhcp-option-force.

Remove options 66 and 160 from /etc/config/dhcp

Move the dnsmasq additional configuration directory from tmp to etc:

uci set dhcp.@dnsmasq[0].confdir=/etc/dnsmasq.d
uci commit dhcp
/etc/init.d/dnsmasq restart

Create a config file in /etc/dnsmasq.d/ and restart the service.

cat << "EOF" >> /etc/dnsmasq.d/telstra.conf
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/"
EOF
/etc/init.d/dnsmasq restart

@pavelgl
As a total newbie it is pleasing to know there is a solution, I just need to work out how to do what you are saying! :frowning:

Log into the router using SSH.

Execute the following commands (copy / paste the whole block and press Enter).

uci delete dhcp.lan.option
uci add_list dhcp.lan.option="6,8.8.8.8"
uci set dhcp.@dnsmasq[0].confdir=/etc/dnsmasq.d
uci commit dhcp
/etc/init.d/dnsmasq restart
cat << "EOF" >> /etc/dnsmasq.d/telstra.conf
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/"
EOF
/etc/init.d/dnsmasq restart

Check the result.

is this a copy&paste error or actually you miss the closing quote?

Already answered above

Will try later, early morning here.

Unfortunately still the same
output from test below

Sending packet:
  op=BOOTREQUEST chaddr=BD:E0:D4:25:FD:03 hops=0 xid=C5858403 secs=0 flags=8000
  ciaddr=0.0.0.0 yiaddr=0.0.0.0 siaddr=0.0.0.0 giaddr=0.0.0.0 sname= file=
  1 options:
     53 (DHCP Message Type): discover
Received packet from 192.168.1.1:67:
  op=BOOTREPLY chaddr=BD:E0:D4:25:FD:03 hops=0 xid=C5858403 secs=0 flags=8000
  ciaddr=0.0.0.0 yiaddr=192.168.1.224 siaddr=192.168.1.1 giaddr=0.0.0.0 sname=dms.digitalbusiness.telstra.com file=
  11 options:
     53 (DHCP Message Type): offer
     54 (Server Identifier): 192.168.1.1
     51 (IP Address Lease Time): 43200 (12 hours)
     58 (Renewal (T1) Time Value): 21600 (6 hours)
     59 (Rebinding (T2) Time Value): 37800 (10 hours and 30 minutes)
      1 (Subnet Mask): 255.255.255.0
     28 (Broadcast Address Option): 192.168.1.255
      3 (Router Option): 192.168.1.1
     15 (Domain Name): lan
      6 (Domain Name Server Option): 8.8.8.8
    160 (Unknown): "ascii,https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4" (61 73 63 69 69 2C 68 74 74 70 73 3A 2F 2F 70 6F 6C 79 64 6D 73 2E 64 69 67 69 74 61 6C 62 75 73 69 6E 65 73 73 2E 74 65 6C 73 74 72 61 2E 63 6F 6D 2F 64 6D 73 2F 62 6F 6F 74 73 74 72 61 70 20 56 34)
Received packet from 192.168.1.1:67:
  op=BOOTREPLY chaddr=BD:E0:D4:25:FD:03 hops=0 xid=C5858403 secs=0 flags=8000
  ciaddr=0.0.0.0 yiaddr=192.168.1.224 siaddr=192.168.1.1 giaddr=0.0.0.0 sname=dms.digitalbusiness.telstra.com file=
  11 options:
     53 (DHCP Message Type): offer
     54 (Server Identifier): 192.168.1.1
     51 (IP Address Lease Time): 43200 (12 hours)
     58 (Renewal (T1) Time Value): 21600 (6 hours)
     59 (Rebinding (T2) Time Value): 37800 (10 hours and 30 minutes)
      1 (Subnet Mask): 255.255.255.0
     28 (Broadcast Address Option): 192.168.1.255
      3 (Router Option): 192.168.1.1
     15 (Domain Name): lan
      6 (Domain Name Server Option): 8.8.8.8
    160 (Unknown): "ascii,https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4" (61 73 63 69 69 2C 68 74 74 70 73 3A 2F 2F 70 6F 6C 79 64 6D 73 2E 64 69 67 69 74 61 6C 62 75 73 69 6E 65 73 73 2E 74 65 6C 73 74 72 61 2E 63 6F 6D 2F 64 6D 73 2F 62 6F 6F 74 73 74 72 61 70 20 56 34)

I corrected the shortened option 160 string before loading your script.

Just to show the difference, I will post the same test on my normal router (I will just post the first half as it gets repetitive)

`Sending packet:
op=BOOTREQUEST chaddr=24:34:7E:28:D5:21 hops=0 xid=D881A7E5 secs=0 flags=8000
ciaddr=0.0.0.0 yiaddr=0.0.0.0 siaddr=0.0.0.0 giaddr=0.0.0.0 sname= file=
1 options:
53 (DHCP Message Type): discover
Received packet from 192.168.10.254:67:
op=BOOTREPLY chaddr=24:34:7E:28:D5:21 hops=0 xid=D881A7E5 secs=0 flags=8000
ciaddr=0.0.0.0 yiaddr=192.168.10.21 siaddr=192.168.10.254 giaddr=0.0.0.0 sname= file=
13 options:

 53 (DHCP Message Type): offer
 54 (Server Identifier): 192.168.10.254
 58 (Renewal (T1) Time Value): 43200 (12 hours)
 59 (Rebinding (T2) Time Value): 75600 (21 hours)
 51 (IP Address Lease Time): 86400 (1 day)
 42 (Network Time Protocol Servers Option): 103.76.40.123
 66 (TFTP server name): dms.digitalbusiness.telstra.com
150 (Unknown): CB 34 00 CE CB 34 01 CE
160 (Unknown): "https://polydms.digitalbusiness.telstra.com/dms/bootstrap" (68 74 74 70 73 3A 2F 2F 70 6F 6C 79 64 6D 73 2E 64 69 67 69 74 61 6C 62 75 73 69 6E 65 73 73 2E 74 65 6C 73 74 72 61 2E 63 6F 6D 2F 64 6D 73 2F 62 6F 6F 74 73 74 72 61 70)`

As you can see 66 is in there so it can't just be a case of the type of equipment requesting the DHCP.

I tested the configuration with versions 19.07 and 21.02 and the results look good.

Please post the output of the following commands

uci show dhcp; echo ""; head -n -0 -v /etc/dnsmasq.d/*.*
1 Like
root@OpenWrt:~# uci show dhcp; echo ""; head -n -0 -v /etc/dnsmasq.d/*.*
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.@dnsmasq[0].nonwildcard='1'
dhcp.@dnsmasq[0].localservice='1'
dhcp.@dnsmasq[0].ednspacket_max='1232'
dhcp.@dnsmasq[0].confdir='/etc/dnsmasq.d'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.start='100'
dhcp.lan.limit='150'
dhcp.lan.leasetime='12h'
dhcp.lan.dhcpv4='server'
dhcp.lan.dhcpv6='server'
dhcp.lan.ra='server'
dhcp.lan.ra_flags='managed-config' 'other-config'
dhcp.lan.force='1'
dhcp.lan.dhcp_option='66,"dms.digitalbusiness.telstra.com"' '160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"' '6,8.8.8.8'
dhcp.lan.option='6,8.8.8.8'
dhcp.@dnsmasq[1]=dnsmasq
dhcp.@dnsmasq[1].domainneeded='1'
dhcp.@dnsmasq[1].boguspriv='1'
dhcp.@dnsmasq[1].filterwin2k='0'
dhcp.@dnsmasq[1].localise_queries='1'
dhcp.@dnsmasq[1].rebind_protection='1'
dhcp.@dnsmasq[1].rebind_localhost='1'
dhcp.@dnsmasq[1].local='/lan/'
dhcp.@dnsmasq[1].domain='lan'
dhcp.@dnsmasq[1].expandhosts='1'
dhcp.@dnsmasq[1].nonegcache='0'
dhcp.@dnsmasq[1].authoritative='1'
dhcp.@dnsmasq[1].readethers='1'
dhcp.@dnsmasq[1].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[1].resolvfile='/tmp/resolv.conf.d/resolv.conf.auto'
dhcp.@dnsmasq[1].nonwildcard='1'
dhcp.@dnsmasq[1].localservice='1'
dhcp.@dnsmasq[1].ednspacket_max='1232'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='0'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dhcp.odhcpd.loglevel='4'

==> /etc/dnsmasq.d/telstra.conf <==
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"
root@OpenWrt:~#

I'm running 21.02.02

The tester doesn't show option 66 and the phones are not provisioning as they should. I'm beginning to think I need to investigate other options.

uci delete dhcp.lan.dhcp_option
uci delete dhcp.lan.option
uci add_list dhcp.lan.option="6,8.8.8.8"
uci commit dhcp
cat << "EOF" > /etc/dnsmasq.d/telstra.conf
dhcp-option-force=66,"dms.digitalbusiness.telstra.com"
dhcp-option-force=160,"https://polydms.digitalbusiness.telstra.com/dms/bootstrap V4/"
EOF
/etc/init.d/dnsmasq restart

Thanks again for trying, I tried that and no change. I may try rebuilding the router this afternoon and try again.

1 Like

Ok so rebuilt it, no change, built it again on a ras pi 4 and no change! Time to give up I think.

Each time the dnsmasq service starts, the UCI /etc/config/dhcp file is parsed into a temporary dnsmasq native format configuration file, which is what actually configures dnsmasq. That file can be examined in /tmp/etc/dnsmasq.conf.cfg* (it will have a random number at the end). Check that the DHCP options have been properly parsed into dhcp-option= lines.

Seems you have hit the nail on the head. Only option being sent is one I added which was for a NTP server.

# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
enable-ubus=dnsmasq
expand-hosts
bind-dynamic
local-service
edns-packet-max=1232
domain=lan
local=/lan/
addn-hosts=/tmp/hosts
dhcp-leasefile=/tmp/dhcp.leases
resolv-file=/tmp/resolv.conf.d/resolv.conf.auto
stop-dns-rebind
rebind-localhost-ok
dhcp-broadcast=tag:needs-broadcast
conf-dir=/etc/dnsmasq.d
user=dnsmasq
group=dnsmasq


dhcp-ignore-names=tag:dhcp_bogus_hostname
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf


bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,12h
dhcp-option=lan,42,103.76.40.123

Any idea what I am getting wrong?