I have a machine set up as IPv6 router, where I have two interfaces, one connected to a wireless AP and one to a wired switch. On those interfaces I send out IPv6 RA for two different IPv6 subnets using radvd. Both interfaces have the net.ipv6.conf.<device>.accept_ra sysctl set to 0 and forwarding set to 1. Both interfaces are set up with a fixed IPV6 address. A third interface (virtual) provides the gateway address of the IPv6 tunnel. Both interfaces I send RA's out do get a dynamically configured IPv6 address from radvd though. This results in having also additional default routes for each interface, which point to the fixed address of that interface... so a loop, and thus no IPv6 connectivity. It's not possible to delete the routes or the addresses, as radvd will reainstall them continuously. This is seriously broken stuff. Reproducible: Always Steps to Reproduce: 1. Set up radvd to advertise on two different interfaces 2. Set up a fixed address on each interface 3. Check interfaces for addresses (only fixed addresses are there) 4. Activate sysctl net.ipv6.conf.all.forwarding=1 5. Check sysctl net.ipv6.conf.all.accept_ra=0 6. Start radvd 7. Check interfaces for addresses, and the autoconf addresses will be there too which is wrong! 8. Check ip -6 r and additional default routes are installed, which cause loops. Actual Results: interfaces get addressses through SLAAC Expected Results: interfaces do not get addresses through SLAAC. No dynamic addressses should be there
Hi, I don't see any Gentoo specific part to this (we just change the forwarding if FORWARDING is set to something). Can you report this issue upstream and link it here, please? A general fix to this would be the best solution.
So, after quite some time getting annoyed by simply turning off radvd to be able to use IPv6 at least on the router, I have looked into the problem some more, and found the culprit. It seems, that the sysctls work just fine. The problem is dhcpcd which overrides everything. Dhcpcd is configured by default to accept RA's and to configure default routes for each prefix, which in my case is not what I want. Defaulting to this default behaviour is fine I would say, but it is strictly necessary, that dhcpcd regards the sysctls, especially net.ipv6.conf.<interface>.forwarding. Otherwise it will screw up the system, unless you deactivate ipv6, ipv6rs and dhcp6 in dhcpcd.conf as I just did. I cc the maintainer of dhcpcd (William Hubbs)and mark this bug as resolved/invalid. Cheers, Mat