[Bug 1573272] Re: default gateway route not installed for bond interfaces through reboot
Jaakko Salo
jaakkos at gmail.com
Wed Jan 25 13:53:37 UTC 2017
As a workaround, you can do the following (using the original report's
config as an example):
# systemctl edit ifup at bond0.3000
Add the following and save the file:
[Unit]
After=ifup at 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 at bond0.3000 and
ifup at 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
Foundations Bugs, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1573272
Title:
default gateway route not installed for bond interfaces through reboot
Status in ifupdown package in Ubuntu:
Confirmed
Bug description:
Expectation: After reboot, route for default gateway specified on
bonded interface is installed according to "gateway x.x.x.x" (where
x.x.x.x is a valid IPv4 address) specified in /etc/network/interfaces
or files sourced per /etc/network/interfaces
Actual Result: After reboot, route is not installed. Interface does
work otherwise (I can ping the gateway on that subnet, for instance).
'ifdown -a' followed by 'ifup -a' (run with proper permission... so
sudo) brings the gateway back until next reboot.
Package: I'm not familiar enough to be certain what is causing this,
but I was seeing this in beta2 of 16.04 as well.
*username snipped*@*hostname snipped*:~$ lsb_release -rd
Description: Ubuntu 16.04 LTS
Release: 16.04
*username snipped*@*hostname snipped*:~$ apt-cache policy ifenslave
ifenslave:
Installed: 2.7ubuntu1
Candidate: 2.7ubuntu1
Version table:
*** 2.7ubuntu1 100
100 /var/lib/dpkg/status
*username snipped*@*hostname snipped*:~$ apt-cache policy ifupdown
ifupdown:
Installed: 0.8.10ubuntu1
Candidate: 0.8.10ubuntu1
Version table:
*** 0.8.10ubuntu1 100
100 /var/lib/dpkg/status
/etc/network/interfaces
----------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp2s0f1
iface enp2s0f1 inet manual
bond-master bond0
auto enp2s0f0
iface enp2s0f0 inet manual
bond-master bond0
auto bond0
iface bond0 inet static
address 10.96.96.2
netmask 255.255.255.0
network 10.96.96.0
broadcast 10.96.96.255
# dns-* options are implemented by the resolvconf package, if installed
dns-search *snip*
bond-mode balance-alb
bond-slaves none
bond-miimon 100
auto bond0.3000
iface bond0.3000 inet static
address 172.21.33.29
netmask 255.255.255.0
network 172.21.33.0
broadcast 172.21.33.255
gateway 172.21.33.1
dns-search *snip*
vlan-raw-device bond0
dns-nameservers 172.31.10.84 8.8.8.8 4.2.2.2
-----------------------------------------------------
interfaces.d is empty:
*username snipped*@*hostname snipped*:~$ ls -lisah /etc/network/interfaces.d
total 8.0K
10748247 4.0K drwxr-xr-x 2 root root 4.0K Jan 24 14:08 .
10748237 4.0K drwxr-xr-x 7 root root 4.0K Apr 21 17:32 ..
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1573272/+subscriptions
More information about the foundations-bugs
mailing list