As a workaround, you can do the following (using the original report's
config as an example):

# systemctl edit ifup@bond0.3000

Add the following and save the file:

[Unit]
After=ifup@bond0.service

Then, let's add Type=oneshot to the ifup@ template so that the above
After= actually has some effect:

# systemctl edit ifup@

Add the following and save the file:

[Service]
Type=oneshot

Then reboot.

The problem seems to be a race condition introduced with systemd
integration. For me, the missing default route triggered around 80% of
the time, but not always.

On Ubuntu 16, systemd executes the ifup@ template units in parallel in a
way that is not adequately controlled. For instance, ifup@bond0.3000 and
ifup@bond0 will execute in parallel. The ifup for bond0 will involve "ip
link ... down", then "up" from ifenslave hooks. I believe that if the
link down comes after default route from bond0.3000, the default route
will be deleted. My journalctl observations support this.

Debugging tip: use systemctl edit ifup@, and add --verbose to the ifup
invocations (note, there are 2 of them!). Adding the verbose option to
/etc/default/networking does not work, except for lo interface.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1573272

Title:
  default gateway route not installed for bond interfaces through reboot

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1573272/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to