Too many containers may cause random IPv6 loss on Raspi

2022-08-16

Raspi's IPv6 randomly disappears, but other devices are fine? Maybe you have spun up too many Docker containers!

The background #

I was playing around with some Docker containers when I suddenly found that I couldn't connect to the Raspi via IPv4 or IPv6 randomly. Rebooting fixed the issue temporarily, but the issue happened again after a few hours. At first, I thought that it was caused by a sudden memory outage, making the Raspi stop responding. So I tried to set up the watchdog, but the watchdog never fires.

When I look into /var/log/syslog.1, I found that even though I failed to connect to the Raspi, the CRON job was still running, which means that it was a network issue. Maybe there were some problems with the router.

The router happened to have some issues, so I replaced it with a new one. But the Raspi is still losing the IPv6 address randomly, usually a few hours after rebooting.

The main reference #

After some searching, I found this issue:

The workaround #

To test if I have the same issue, I ran

systemctl restart dhcpcd
sh

And the IPv6 address comes back!

It turns out that DHCPCD can't handle that many of the virtual networks introduced by Docker.

To fix the issue permanently, just append the line

denyinterfaces veth*
text

to /etc/dhcpcd.conf.

👍
1
Leave your comments and reactions on GitHub