https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/modules/services/networking/nat.nix Line 181 through 191
the commands all and default should be swapped
Explanation:
Minor nitpick. When you set the following sysctls:
net.ipv6.conf.all.forwarding=2
net.ipv6.conf.default.forwarding=2
There is a slight race condition in between the two. "all" includes all existing interfaces, but not future interfaces. "default" includes all future interfaces, but no existing interfaces.
So if an interface (i.e. ppp0) is created in between the two statements, it will not have that applied. To do it race-free, just reverse the order:
net.ipv6.conf.default.forwarding=2
net.ipv6.conf.all.forwarding=2
Reference: search "race" on https://vk5tu.livejournal.com/37206.html
Should be pretty rare tho, interfaces normally just don't come up and go away.
Tonight I was setting up NixOS for rpi5. Thanks to https://github.com/NixOS/nixpkgs/issues/260754#issuecomment-1908664693 it was a pretty smooth experience. Compiling aarch64 on rpi5 with sdcard was quite slow - took about 3-4 hours or so.
The final goal was to replace rpi3 in my home which was running a hotspot with ipv6 capability.
I spent some time trying hostapd - but it just wouldn't stay connected for more than a second. I got some error 13 = INVALID_AE. Can share detailed logs in another thread.
create_ap worked as is, but it didn't have ipv6. Started a radvd server to assign ipv6 and then struggled with forwarding. Finally got it all working! And in all the struggle found this random blog + bug. There may be similar issues in networking
Last updated: Nov 15 2024 at 12:33 UTC