Somewhat as a follow-up to my prior post, I’m having issues keeping an Alpine container from acquiring a secondary local address like:
eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 00:16:3e:00:ac:0e brd ff:ff:ff:ff:ff:ff
inet 10.200.0.101/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fd42:abbe:1234:5678::101/64 scope global
valid_lft forever preferred_lft forever
inet6 fd42:abbe:1234:5678:216:3eff:fe00:ac0e/64 scope global dynamic # ← THIS
valid_lft 2652sec preferred_lft 2652sec
inet6 fe80::216:3eff:fe00:ac0e/64 scope link
My LXD bridge config:
config:
ipv4.address: 10.100.0.1/24
ipv4.firewall: "false"
ipv4.nat: "false"
ipv6.address: fd42:abbe:1234:5678::1/64
ipv6.firewall: "false"
ipv6.nat: "false"
With Ubuntu containers, the following netplan config works:
network:
version: 2
ethernets:
eth0:
dhcp4: false
dhcp6: false # These seem
accept-ra: false # to suffice
addresses:
- 10.100.0.81/24
- "fd42:abbe:1234:5678::81/64"
gateway4: 10.100.0.1
gateway6: "fd42:abbe:1234:5678::1"
With Alpine, I haven’t had any luck:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.100.0.101
netmask 255.255.255.0
gateway 10.100.0.1
iface eth0 inet6 static
address fd42:abbe:1234:5678::101
netmask 64
gateway fd42:abbe:1234:5678::1
pre-up /sbin/sysctl -w net.ipv6.conf.all.autoconf=0
pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
privext 0
autoconf 0
Note: I also tried accept_ra 0
and pre-up /sbin/sysctl -w net.ipv6.conf.(all/eth0).accept_ra=0
, and setting all these via /etc/sysctl.conf
but to no avail.
If I run $alpine: rc-service networking restart
, the container will get rid of the superfluous IP, and I think that survives a container restart
as well, but rebooting the host machine will cause the IP to come back.
Suggestions welcome.