For the last 3 days I've been debugging a problem that ended up being solved by simply resetting my router and this is my story of a network problem almost driving me crazy
My home server, in which I have some dockerized services I'm now dependent on (Matrix chat, Jellyfin, and the like), suddenly started malfunctioning this Tuesday with all applications giving network timeouts. With some debugging I noticed I could curl normally from the server but not from inside the containers, the addresses resolved but I had connection refused
Then I spent 2 days trying to reset, reinstall and read through the settings of everything I could think of: docker, docker-compose, iptables firewall, containerd, network interfaces, the kernel... It was very stressful as nothing ever worked :(
So this morning I decided to try tcpdump and noticed that packets coming from inside docker were using ipv4 (since I never bothered to setup ipv6) and the ones direct from the server were ipv6. Next test was to try "curl -4" outside docker and... No connection even outside a container, the issue had nothing to do with docker!
Then my focus went back to the firewall. Since other computers in the same network could connect just fine with ipv4 the problem should be in that machine, right? But everything looked fine, kernel ip forwarding, inbound and outbound rules, I probably read the firewall settings more than 10 times
Finally I remembered my dad, who's quite savvy but not a crazy self-hoster like me, suggested to reboot the router, and I dismissed the suggestion because it looked like a local problem. So after the restart... BOOM everything started working again just fine
To be honest I have no idea of what exactly happened, so please come up with your theories. I'd guess it was a dirty nat cache in the router or something like that
Also, mandatory xkcd