Update to 3.11.2 broke my DHCP

Maybe someone could provide me with some hint to how to debug - or get some output - of the daemon responsible for serving IP addresses. This may bring me further in gettin back into normal operation.

I’m afraid that doesn’t make it clear to me, as both protocols can be said to “serve IP addresses”, though each in quite a different way. My favorite simple tests on any affected device in the network (incl. the router):

  • ping 1.1.1.1.1 (testing connection without DNS)
  • nslookup turris.cz (testing DNS)

By serving I mean answer the DHCP request from clients and give back an IP-address (and other stuff) to the client.

1 Like

Which process is the DHCP server? Is it the udhcpc process?

I can see this in the process:
udhcpc -p /var/run/udhcpc-eth1.pid -s /lib/netifd/dhcp.script -f -t 0 -i eth1 -C -O 212
|<

DHCPv4 for LAN is by dnsmasq. EDIT: note that I know very little about DHCP or its debugging on Turris, so I rather hope someone else will chime in.

udhcpc is a DHCP client and used to get your IP address from upstream

odhcpd is for DHCPv6 only on the omnia. It might to v4, but I don’t think so in this case.

As mentioned, dnsmasq does DHCPv4 on the omnia and is likely your main DHCP server.

Check to see if odhcpd and/or dnsmasq are running as the first step.

1 Like

I get an IP address from upstream, so udhpc must be running.

IPv6 is also giving out addresses to the LAN.

So the culprit must be dnsmasq, since it is the IPv4 addresses I miss.

Right now I configured a Fedora on an old laptop to serve as a DHCP-server, so I can do some other necessary work. But I’ll look into dnsmasq this evening, probably.

Thanks for the advices.

|<

Did you change dnsmasq/kresd settings (especially: ports)? Maybe the update overwrote some settings so that kresd now blocks dnsmasq.

Just a guess…

1 Like

Hi protree,

Yeah I’ve changed some settings in order to have it work as I would like it to do.

I’ll look into the settings files later.

|<

edit: I might have the same issue:
I have just returned home only to discover Turris stopped working

  • I could not connect to any wifi network (even though they showed in the air - they had full reception)
  • LED of every connected port (WAN port connected to bridged modem and one LAN port) was rapidly flashing. With them was also flashing (in synchronised manner) LEDs on switch and DSL router that are connected to Omnia.

I restarted the Omnia but still could not connect to it afterwards over wifi and so I went to ethernet connected machine. It could not connect either! That is when I remember seeing this thread - I changed the IP configuration to manual (matching the IP address that should have been assigned by DHCP) and suddenly I can write you this.

Please fix this! and tell me if I can provide more information

edit:
Turris OS version: 3.11.2
some other packages that are installed: adblock, lxc, pakon, openvpn, tor, kmod-ipt-extra, kmod-ipt-hashlimit, kmod-ip6tables-extra
(the kernel modules were necessary to get Ubuntu firewall running, as suggested here: Turris Omnia OS 3.5.1 + UFW in lxc Ubuntu Xenial = ERROR )

I think both of you should get some output of dnsmasq:

/etc/init.d/dnsmasq restart
grep „dnsmasq“ /var/log/messages

You should take a general look at /var/log/messages , too. Maybe there is some useful output (grep for err or warn)

1 Like

I was just trying ‘/etc/init.d/dnsmasq status’ to no avail

2019-03-20 23:29:12 notice dnsmasq[]: DNS rebinding protection is active, will discard upstream RFC1918 responses!
2019-03-20 23:29:12 notice dnsmasq[]: Allowing 127.0.0.0/8 responses
2019-03-20 23:29:21 crit dnsmasq[22825]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:21 crit dnsmasq[22825]: FAILED to start up
2019-03-20 23:29:26 crit dnsmasq[22851]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:26 crit dnsmasq[22851]: FAILED to start up
2019-03-20 23:29:31 crit dnsmasq[22880]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:31 crit dnsmasq[22880]: FAILED to start up
2019-03-20 23:29:36 crit dnsmasq[22904]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:36 crit dnsmasq[22904]: FAILED to start up
2019-03-20 23:29:42 crit dnsmasq[22928]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:42 crit dnsmasq[22928]: FAILED to start up
2019-03-20 23:29:47 crit dnsmasq[22957]: duplicate dhcp-host IP address 10.0.0.75 at line 29 of /var/etc/dnsmasq.conf
2019-03-20 23:29:47 crit dnsmasq[22957]: FAILED to start up
2019-03-20 23:29:47 info procd[]: Instance dnsmasq::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

↑ that seems like a legit error :slight_smile:

So I removed the duplicate IP address from DHCP Static Leases (stupid me!) and the error got away, but there is still this:

root@turris:~# /etc/init.d/dnsmasq restart

udhcpc: started, v1.29.3
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.29.3
udhcpc: sending discover
udhcpc: no lease, failing
udhcpc: started, v1.29.3
udhcpc: sending discover
udhcpc: no lease, failing

Should that concern me - what is udhcpc? There is no mention of it in /var/log/messages

I have the same output, but it never had any impact so I ignored it.

So your network clients get DHCP leases again? :+1:t3:

yes, it works again, thank you for your help!

When executing /etc/init.d/dnsmasq restart I get these errors. I have another DCHP server running on my lan and DHCP switched off in the configuration of the networks.

2019-04-02 10:16:24 notice dnsmasq[]: DNS rebinding protection is active, will discard upstream RFC1918 responses!
2019-04-02 10:16:24 notice dnsmasq[]: Allowing 127.0.0.0/8 responses
2019-04-02 10:16:24 crit dnsmasq[11388]: failed to create listening socket for port 53: Address in use
2019-04-02 10:16:24 crit dnsmasq[11388]: FAILED to start up
2019-04-02 10:16:34 notice dnsmasq[]: DNS rebinding protection is active, will discard upstream RFC1918 responses!
2019-04-02 10:16:34 notice dnsmasq[]: Allowing 127.0.0.0/8 responses
2019-04-02 10:16:34 crit dnsmasq[11571]: failed to create listening socket for port 53: Address in use
2019-04-02 10:16:34 crit dnsmasq[11571]: FAILED to start up

Some other program is sitting on the port 53, but which one?

|<

53 is plain DNS port. Turris routers never used dnsmasq for DNS (by default). EDIT: the default sets dnsmasq’s DNS port to 0 (i.e. disables it), but it’s not clear to me what you actually want…

@vcunat

From answers above I got the impression that the dnsmasq is the program responsible for DCHP on IPv4.

What I’ve been trying to achieve is to get my DHCP server back into work since it broke by a previous update of the software.

I only have a few moments now and then to fiddle with the settings and do not have any deeper insights in how the router is working.

Yes, dnsmasq is responsible for DHCP v4. @vcunat has answered what you have to do to make it work again.

Edit the /etc/config/dhcp file via ssh and the important line is “option port ‘0’” - if it is not, you need to add or change it.
the default configuration looks like this:


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

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'

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

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

After the repair is done, restart the router and it should work.