DHCP not working after upgrade to TurrisOS 5.3.3

DHCP seems to have stopped working on both lan and wlan since I upgraded to 5.3.3.

Cant really seem to figure out why, all processes seems to be up and running.

root@turris:~# uci show network
network.loopback=interface
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.loopback.ifname='lo'
network.globals=globals
network.globals.ula_prefix='fd49:5034:f9fe::/48'
network.lan=interface
network.lan.type='bridge'
network.lan.proto='static'
network.lan.ip6assign='60'
network.lan.ifname='lan0' 'lan1' 'lan2' 'lan3' 'lan4'
network.lan._turris_mode='managed'
network.lan.ip6class='local'
network.lan.ipaddr='192.168.1.1/24'
network.wan=interface
network.wan.proto='dhcp'
network.wan.peerdns='0'
network.wan.dns='1.0.0.1 1.1.1.1'
network.wan.ifname='eth2'
network.wan6=interface
network.wan6.proto='dhcpv6'
network.wan6.reqaddress='try'
network.wan6.reqprefix='auto'
network.wan6.noserverunicast='1'
network.wan6.ifname='@wan'

root@turris:~# uci show dhcp
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
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].expandhosts='1'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].localservice='1'
dhcp.@dnsmasq[0].port='0'
dhcp.@dnsmasq[0].domain='wberg.com'
dhcp.@dnsmasq[0].nonwildcard='0'
dhcp.lan=dhcp
dhcp.lan.interface='lan'
dhcp.lan.dhcpv6='server'
dhcp.lan.ra='server'
dhcp.lan.ra_management='1'
dhcp.lan.leasetime='86400'
dhcp.lan.limit='100'
dhcp.lan.dhcp_option='6,192.168.1.1'
dhcp.lan.force='1'
dhcp.lan.start='100'
dhcp.wan=dhcp
dhcp.wan.interface='wan'
dhcp.wan.ignore='1'
dhcp.odhcpd=odhcpd
dhcp.odhcpd.maindhcp='1'
dhcp.odhcpd.leasefile='/tmp/hosts/odhcpd'
dhcp.odhcpd.leasetrigger='/usr/sbin/odhcpd-update'
dhcp.@host[0]=host
dhcp.@host[0].name='nova'
dhcp.@host[0].mac='38:2c:4a:6e:bb:a7'
dhcp.@host[0].leasetime='24h'
dhcp.@host[0].ip='192.168.1.2'

Other commands

root@turris:~# logread -e odhcpd
Jan  5 00:32:10 turris odhcpd[4368]: A default route is present but there is no public prefix on lan thus we don't announce a default route!
Jan  5 00:35:19 turris odhcpd[4368]: A default route is present but there is no public prefix on lan thus we don't announce a default route!
Jan  5 00:35:19 turris odhcpd[4368]: Failed to send to ff02::1%lan@br-lan (Address not available)
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(IPV6_ADD_MEMBERSHIP): No such device
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(SO_BINDTODEVICE): No such device
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(SO_BINDTODEVICE): No such device
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(SO_BINDTODEVICE): No such device
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(SO_BINDTODEVICE): No such device
Jan  5 00:54:34 turris odhcpd[14760]: setsockopt(SO_BINDTODEVICE): No such device
Jan  5 00:54:35 turris odhcpd[14760]: Failed to send to ff02::1%lan@br-lan (Bad file descriptor)
Jan  5 00:54:38 turris odhcpd[14760]: Failed to send to ff02::1%lan@br-lan (Address not available)
Jan  5 00:54:47 turris odhcpd[14760]: A default route is present but there is no public prefix on lan thus we don't announce a default route!

root@turris:~# logread -e dnsmasq
Jan  5 01:32:00 turris dnsmasq[4206]: started, version 2.80 DNS disabled
Jan  5 01:35:40 turris dnsmasq[4206]: overflow: 2 log entries lost
Jan  5 01:35:40 turris dnsmasq[10943]: started, version 2.80 DNS disabled
Jan  5 01:35:40 turris dnsmasq[10943]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth nettlehash DNSSEC no-ID loop-detect inotify dumpfile

root@turris:~# logread -e dnsmasqgrep -e ^dhcp-range= /var/etc/dnsmasq.conf.*
root@turris:~#

13 posts were split to a new topic: No SFP connectivity after upgrade from 3.x

Hello,
can you provide output of ss -naptul command?

Mine as well:

root@turris:~# ss -naptul
Cannot open netlink socket: Protocol not supported
Cannot open netlink socket: Protocol not supported
Netid    State     Recv-Q    Send-Q                     Local Address:Port          Peer Address:Port
udp      UNCONN    0         0                                0.0.0.0:53                 0.0.0.0:*        users:(("kresd",pid=20660,fd=9))
udp      UNCONN    0         0                            224.0.0.251:5353               0.0.0.0:*        users:(("umdns",pid=6673,fd=8))
udp      UNCONN    0         0                            192.168.1.1:5353               0.0.0.0:*        users:(("umdns",pid=6673,fd=7))
udp      UNCONN    0         0                           78.70.22.226:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=15))
udp      UNCONN    0         0                            192.168.1.1:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=14))
udp      UNCONN    0         0                              127.0.0.1:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=13))
udp      UNCONN    0         0                                0.0.0.0:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=10))
udp      UNCONN    0         0                                  [::1]:514                      *:*        users:(("syslog-ng",pid=4758,fd=12))
udp      UNCONN    0         0                                      *:546                      *:*        users:(("odhcp6c",pid=17015,fd=4))
udp      UNCONN    0         0                                      *:547                      *:*        users:(("odhcpd",pid=22795,fd=15))
udp      UNCONN    0         0            [fe80::da58:d7ff:fe00:4b51]:5353                     *:*        users:(("umdns",pid=6673,fd=10))
udp      UNCONN    0         0                             [ff02::fb]:5353                     *:*        users:(("umdns",pid=6673,fd=9))
tcp      LISTEN    0         0                                0.0.0.0:443                0.0.0.0:*        users:(("lighttpd",pid=6124,fd=5))
tcp      LISTEN    0         0                              127.0.0.1:11883              0.0.0.0:*        users:(("mosquitto",pid=5857,fd=4))
tcp      LISTEN    0         0                                0.0.0.0:80                 0.0.0.0:*        users:(("lighttpd",pid=6124,fd=7))
tcp      LISTEN    0         0                                0.0.0.0:853                0.0.0.0:*        users:(("kresd",pid=20660,fd=12))
tcp      LISTEN    0         0                                0.0.0.0:53                 0.0.0.0:*        users:(("kresd",pid=20660,fd=10))
tcp      LISTEN    0         0                                0.0.0.0:22                 0.0.0.0:*        users:(("sshd",pid=4741,fd=3))
tcp      LISTEN    0         0                              127.0.0.1:9080               0.0.0.0:*        users:(("foris-ws",pid=5891,fd=9))
tcp      LISTEN    0         0                                      *:443                      *:*        users:(("lighttpd",pid=6124,fd=6))
tcp      LISTEN    0         0                                      *:80                       *:*        users:(("lighttpd",pid=6124,fd=4))
tcp      LISTEN    0         0                                      *:22                       *:*        users:(("sshd",pid=4741,fd=4))

It looks the dnsmasq is not running at all.
You can try to run it manually to see what is wrong.
First, you need to locate the dnsmasq config file. It should be in /var/etc/dnsmasq.conf.cfg<random>

Then you can try to check it for syntax errors by running something like this

root@gw-prg:~# dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c --test
dnsmasq: syntax check OK.

You can also verify that the dnsmasq service is enabled by running
service dnsmasq enable && service dnsmasq restart

Then again run the ss -naptul and check it for dnsmasq listening on UDP/67

Feels like this thread got hijacked, continuing on my original post/problem:

root@turris:~# dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c --test
dnsmasq: syntax check OK.
root@turris:~# service dnsmasq enable
root@turris:~# service dnsmasq restart
root@turris:~# ss -naptul
Cannot open netlink socket: Protocol not supported
Cannot open netlink socket: Protocol not supported
Netid    State     Recv-Q    Send-Q                     Local Address:Port          Peer Address:Port
udp      UNCONN    0         0                                0.0.0.0:53                 0.0.0.0:*        users:(("kresd",pid=20660,fd=9))
udp      UNCONN    0         0                            224.0.0.251:5353               0.0.0.0:*        users:(("umdns",pid=6673,fd=8))
udp      UNCONN    0         0                            192.168.1.1:5353               0.0.0.0:*        users:(("umdns",pid=6673,fd=7))
udp      UNCONN    0         0                           78.70.22.226:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=15))
udp      UNCONN    0         0                            192.168.1.1:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=14))
udp      UNCONN    0         0                              127.0.0.1:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=13))
udp      UNCONN    0         0                                0.0.0.0:5353               0.0.0.0:*        users:(("foris-controlle",pid=5981,fd=10))
udp      UNCONN    0         0                                  [::1]:514                      *:*        users:(("syslog-ng",pid=4758,fd=12))
udp      UNCONN    0         0                                      *:546                      *:*        users:(("odhcp6c",pid=17015,fd=4))
udp      UNCONN    0         0                                      *:547                      *:*        users:(("odhcpd",pid=22795,fd=15))
udp      UNCONN    0         0            [fe80::da58:d7ff:fe00:4b51]:5353                     *:*        users:(("umdns",pid=6673,fd=10))
udp      UNCONN    0         0                             [ff02::fb]:5353                     *:*        users:(("umdns",pid=6673,fd=9))
tcp      LISTEN    0         0                                0.0.0.0:443                0.0.0.0:*        users:(("lighttpd",pid=6124,fd=5))
tcp      LISTEN    0         0                              127.0.0.1:11883              0.0.0.0:*        users:(("mosquitto",pid=5857,fd=4))
tcp      LISTEN    0         0                                0.0.0.0:80                 0.0.0.0:*        users:(("lighttpd",pid=6124,fd=7))
tcp      LISTEN    0         0                                0.0.0.0:853                0.0.0.0:*        users:(("kresd",pid=20660,fd=12))
tcp      LISTEN    0         0                                0.0.0.0:53                 0.0.0.0:*        users:(("kresd",pid=20660,fd=10))
tcp      LISTEN    0         0                                0.0.0.0:22                 0.0.0.0:*        users:(("sshd",pid=4741,fd=3))
tcp      LISTEN    0         0                              127.0.0.1:9080               0.0.0.0:*        users:(("foris-ws",pid=5891,fd=9))
tcp      LISTEN    0         0                                      *:443                      *:*        users:(("lighttpd",pid=6124,fd=6))
tcp      LISTEN    0         0                                      *:80                       *:*        users:(("lighttpd",pid=6124,fd=4))
tcp      LISTEN    0         0                                      *:22                       *:*        users:(("sshd",pid=4741,fd=4))
root@turris:~#  ps aux | grep udhcpc
root     16803  0.0  0.0   1196   548 ?        S    01:54   0:00 udhcpc -p /var/run/udhcpc-eth2.pid -s /lib/netifd/dhcp.script -f -t 0 -i eth2 -x hostname:turris -C -O 212 -O 121
root     19600  0.0  0.0   1196   548 pts/0    R+   14:44   0:00 grep udhcpc

Is there anything related to dnsmasq in log? What is the output of ps aux | grep dnsmasq

dnsmasq  19382  0.0  0.0   2568   996 ?        S    14:42   0:00 /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg     01411c.pid
root     19384  0.0  0.0   2492   732 ?        S    14:42   0:00 /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg     01411c.pid
root     19821  0.0  0.0   1196   548 pts/0    R+   14:47   0:00 grep dnsmasq

Nothing in the logread or in messages. No idea if there are other logs or startup logs I can check?

Hmm… do you use some custom configuration in /etc/dnsmasq.conf?

There is something that prevents the dnsmasq to start and bind to network interfaces.
What is in the /var/etc/dnsmasq.conf.cfg01411c file?

root@turris:~# cat /var/etc/dnsmasq.conf.cfg01411c
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
enable-ubus
expand-hosts
local-service
port=0
domain=wberg.com
server=/lan/
dhcp-leasefile=/tmp/dhcp.leases
dhcp-script=/usr/lib/dnsmasq/dhcp-script.sh
script-arp
resolv-file=/tmp/resolv.conf.auto
stop-dns-rebind
rebind-localhost-ok
dhcp-broadcast=tag:needs-broadcast
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
user=dnsmasq
group=dnsmasq

dhcp-host=38:2c:4a:6e:bb:a7,192.168.1.2,nova,24h

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


bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf

You are missing the DHCP range definitions. Something like this.

dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,12h
dhcp-option=lan,6,192.168.1.1

You can try to delete the /var/etc/dnsmasq.conf.cfg01411c file and by issuing service dnsmasq restart it will get generated again. Check for the difference, if the dhcp-range is correctly propagated in that new file.

On the other hand, does anything change when you try to disable the DHCP server for LAN interface and enabling it again?

Yup, the range is missing, it does not appear if I remove the configuration and let dnsmasq generate it again.

I’ve tried disabling/enabling DHCP on LAN in both normal and advanced ui without any difference.

Tried enabling a guest wifi with DHCP from the GUI, that config is propagated to /etc/config/dhcp but without a range as well, should the range be defined in the dhcp-config? If so, what are the options for adding it?

root@turris:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'
        option port '0'
        option domain 'wberg.com'
        option nonwildcard '0'

config dhcp 'lan'
        option interface 'lan'
        option dhcpv6 'server'
        option ra 'server'
        option ra_management '1'
        option leasetime '86400'
        option limit '100'
        list dhcp_option '6,192.168.1.1'
        option force '1'
        option start '100'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '1'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

config host
        option name 'nova'
        option mac '38:2c:4a:6e:bb:a7'
        option leasetime '24h'
        option ip '192.168.1.2'

config dhcp 'guest_turris'
        option interface 'guest_turris'
        option ignore '0'
        option start '100'
        option limit '150'
        option leasetime '3600'
        option dhcpv6 'server'
        option ra 'server'
        list dhcp_option '6,10.111.222.1'

It gets generated by /etc/init.d/dnsmasq init script. Can you verify the checksum of it?
Should be

root@gw-zno:~# sha256sum /etc/init.d/dnsmasq
87eab5b0393fabef42902d5fa59e12d90d236f4e39b9ca48409103605799f52e  /etc/init.d/dnsmasq

Ah okay.

Same sum thou

root@turris:~# sha256sum /etc/init.d/dnsmasq
87eab5b0393fabef42902d5fa59e12d90d236f4e39b9ca48409103605799f52e  /etc/init.d/dnsmasq

Okay. I’m lost right now. I can give you a workaround how to fix the DNS service but still have no idea what can be wrong.

You can put these two lines in /etc/dnsmasq.conf and restart the dnsmasq.

dhcp-range=set:lan,192.168.1.100,192.168.1.249,255.255.255.0,24h
dhcp-option=lan,6,192.168.1.1
1 Like

That actually works as a work around indeed, the questions remains why it’s broken from the beginning.

I’m happy to help and provide more information if needed, otherwise maybe a factory reset could be something to try, might be related to the upgrade?

1 Like

@wberg Well, you can use schnapps to create a snapshot of your (broken) system and upload it to us. Then I can have a look at it and try to find, what is wrong.

If you are interested in this option, please drop me a private message.

But I suggest to use the rescue mode 4 to have the system in a clean state.

I think you can even make a backup of your current configuration in /etc/config and use it in the freshly installed system (after going through the initial wizard).

Sure, I cannot however send a private message to you, the forum refuses me.

I have been sold on the promise of a high-performance extensible home router running open-source firmware and OS all the way back in 2015/2016 when the team behind the Czech national domain registrar announced their Indiegogo campaign for [Turris Omnia]. The campaign was a big success, it has raised over $1.2M USD. Since then, the team kept working on further improvements of the operating system and in October 2019, they released a new major version. Unfortunately, the migration from 3.x is not automated, which I found a bit disappointing. An important reason for choosing somewhat-expensive Omnia was the promise of frequent and fully-automated updates:

One of my biggest pain points with Omnia have been unreliable wifi. While Android and Windows PC devices work fine, my Apple devices (iPhone and MacBook Pro) often end up in a weird state when the device shows a wifi connection but HTTP requests never get back.
I have checked and found that cloud erp adoption is working on Turris Omnia. Recently, another Omnia user posted a nice summary of the problem and possible solution [in the forum], so I decided to invest some time into tinkering with the router with the hope of getting reliable wifi again.

I decided to bite the bullet and start with upgrading Turris OS to the latest and greatest (?) version 4.x. It turns out the upgrade is super easy, as long as you don’t mind loosing your existing configuration. :see_no_evil: While it’s possible to save the 3.x config and then restore it in 4.x version, such operation breaks the router in subtle but important ways (automatic update no longer works, OpenWRT thinks there is a misconfigured virtual LAN switch, etc.).

Fortunately, my config is very simple. Besides the usual WLAN, LAN and wifi setup, I used OpenWRT’s LuCI web interface to tweak txpower setting of both wifi adapters to lower values — I don’t want to be “grilled” by microwaves more than necessary.

Here is a step-by-step guide, I hope you will find it helpful. I could not find anything similar in Turris Omnia documentation or the forum, which speaks for itself. :face_with_raised_eyebrow:

  1. Review your current configuration, both in Foris and LuCI interfaces. Write down important settings like wifi channels and any other settings you will want to restore after upgrade.
  2. Find a USB drive, prepare a LAN (Ethernet) cable and a USB-LAN dongle for your computer if needed.
  3. Follow the instructions for [re-flashing the router from USB]

Download the latest version of Turris Omnia’s system image from

Blockquote

Save the file omnia-medkit-latest.tar.gz to USB flash drive to the root directory. (…) Connect the USB flash to the Turris Omnia router and use reset button to select mode 4 (4 LEDs).

  1. Wait until the operation completes and the router starts.

  2. Connect to your router via LAN cable, open the administrative interface at http://192.168.1.1/ and follow the Guided Mode to manually restore your router config.

  3. If you are tweaking advanced settings, open also LuCI to make the necessary changes there.

As far as I can tell so far, the 4. x configuration UI looks pretty much the same as in 3.x and the Guided Mode makes the manual restore process very quick. The most notable difference is the introduction of “Network Interfaces” section, where you can assign different network devices (WAN, LAN, WLAN) to different zones: WAN, LAN, Guest Network. Here is how the default setup looks like:
Network interfaces in Foris UI
My next step is to tweak 2.4 GHz wifi to see if I can get a stable connection, but that’s a story for another day…
Hope this will help you properly.