Bug #8815
openIP addresses are removed from interfaces when link is lost and either IPv4 or IPv6 is dynamic
0%
Description
When an interface loses link the IPv4 addresses, including VIPs, can disappear from the interface. If the link is down when the interface settings are applied, the address is present, but plugging in the interface and then removing the link again can make the addresses disappear.
The behavior is not consistent across all configurations and hardware. For example, it appears to happen predictably on igb(4)
interfaces but not vmx(4)
interfaces, and in some cases re(4)
is OK and fails for others.
The main consequence is that anything bound to or relying on those addresses will fail when they disappear. The highest impact is from HA/CARP. The VIPs disappear from the interface, so the OS does not trigger demotion as expected with link loss.
IPv6 addresses, if any exist, are still present on the interfaces after link is lost.
For example, on an SG-5100. LAN is unplugged before the test:
igb1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=6400bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6> ether 00:90:0b:7a:8a:66 hwaddr 00:90:0b:7a:8a:66 inet 10.23.0.1 netmask 0xffffff00 broadcast 10.23.0.255 inet6 2001:db8:1:ee10:290:bff:fe7a:8a66 prefixlen 60 inet6 fe80::1:1%igb1 prefixlen 64 scopeid 0x2 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> media: Ethernet autoselect status: no carrier
Plug in LAN, then unplug LAN:
igb1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=6400bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6> ether 00:90:0b:7a:8a:66 hwaddr 00:90:0b:7a:8a:66 inet6 2001:db8:1:ee10:290:bff:fe7a:8a66 prefixlen 60 inet6 fe80::1:1%igb1 prefixlen 64 scopeid 0x2 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> media: Ethernet autoselect status: no carrier
Logs for igb1 during the transition:
Aug 20 11:54:29 missy kernel: igb1: link state changed to UP Aug 20 11:54:29 missy check_reload_status: Linkup starting igb1 Aug 20 11:54:29 missy check_reload_status: Reloading filter Aug 20 11:54:30 missy php-fpm[585]: /rc.linkup: DEVD Ethernet attached event for lan Aug 20 11:54:30 missy php-fpm[585]: /rc.linkup: HOTPLUG: Configuring interface lan Aug 20 11:54:30 missy check_reload_status: Restarting ipsec tunnels Aug 20 11:54:33 missy check_reload_status: Linkup starting igb1 Aug 20 11:54:33 missy kernel: igb1: link state changed to DOWN Aug 20 11:54:34 missy php-fpm[584]: /rc.newwanip: The command '/usr/local/sbin/unbound -c /var/unbound/unbound.conf' returned exit code '1', the output was '[1534780474] unbound[62993:0] error: bind: address already in use [1534780474] unbound[62993:0] fatal error: could not open ports' Aug 20 11:54:34 missy check_reload_status: updating dyndns lan Aug 20 11:54:34 missy php-fpm[39495]: /rc.linkup: DEVD Ethernet detached event for lan Aug 20 11:54:35 missy check_reload_status: Reloading filter