Comment 8 for bug 1777094

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1777094] Re: dnsmasq started too early, not getting all interfaces

I see, interesting. The dnsmasq.service does not wait for
network-online.target;

This appears to be a duplicate of:

https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1531184

In addition to the netplan config to ensure it waits for your bridge
to come up, you need to delay dnsmasq.service until after the network
is online. You can do that with something like this:

% mkdir -p /etc/systemd/system/dnsmasq.service.d
% echo -e "[Unit]\nAfter=network-online.target\nWants=network-online.target"
| sudo tee /etc/systemd/system/dnsmasq.service.d/network-online.conf
% reboot

After rebooting, you should see that networkd runs, brings up the
interfaces, then network-online.target is reached, and lastly dnsmasq
is then started.

% journalctl -b -o short-monotonic | egrep "(Reboot|networkd|Network
is Online|Starting dnsmasq)"
[1835835.825873] b1 systemd-networkd[173]: vlan0: IPv6 successfully enabled
[1835835.827054] b1 systemd-networkd[173]: vlan0: netdev ready
[1835835.837274] b1 systemd-networkd[173]: Enumeration completed
[1835835.864747] b1 systemd-networkd[173]: eth1: Lost carrier
[1835835.871748] b1 systemd-networkd[173]: eth0: DHCPv4 address
10.8.107.77/24 via 10.8.107.1
[1835835.879184] b1 systemd-networkd[173]: eth1: IPv6 successfully disabled
[1835835.908530] b1 systemd-networkd[173]: eth1: Gained carrier
[1835835.908903] b1 systemd-networkd[173]: eth1: Configured
[1835835.909878] b1 systemd-networkd[173]: vlan0: Gained carrier
[1835835.913807] b1 systemd-networkd-wait-online[175]: managing: eth1
[1835836.288648] b1 systemd-networkd[173]: eth0: Gained IPv6LL
[1835836.289022] b1 systemd-networkd[173]: eth0: Configured
[1835836.290405] b1 systemd-networkd-wait-online[175]: managing: eth1
[1835836.290834] b1 systemd-networkd-wait-online[175]: managing: eth0
[1835836.291077] b1 systemd-networkd-wait-online[175]: ignoring: lo
[1835837.760738] b1 systemd-networkd[173]: vlan0: Gained IPv6LL
[1835837.761713] b1 systemd-networkd[173]: vlan0: Configured
[1835837.762522] b1 systemd-networkd-wait-online[175]: managing: eth1
[1835837.763413] b1 systemd-networkd-wait-online[175]: managing: eth0
[1835837.763705] b1 systemd-networkd-wait-online[175]: ignoring: lo
[1835837.764057] b1 systemd-networkd-wait-online[175]: managing: vlan0
[1835838.445945] b1 systemd[1]: Reached target Network is Online.
[1835838.496394] b1 dbus-daemon[195]: [system] Activating via systemd:
service name='org.freedesktop.hostname1'
unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0'
(uid=100 pid=173 comm="/lib/systemd/systemd-networkd "
label="unconfined")
[1835838.516683] b1 systemd[1]: Starting dnsmasq - A lightweight DHCP
and caching DNS server...
On Tue, Jun 19, 2018 at 3:51 AM Hadmut Danisch <email address hidden> wrote:
>
> setting optional: false does not solve the problem, a systemctl
> restart dnsmasq is still required.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1777094
>
> Title:
> dnsmasq started too early, not getting all interfaces
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1777094/+subscriptions