-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[24.11] Fix IPv6 autoconfiguration #1245
Conversation
We need to be able to check that network configuration works correctly in tests. PL-133360
The NixOS test driver assigns each test VM an ID number which is used for generating MAC addresses. As this number might diverge from the ID we provide in our test framework for e.g. assigning IP addresses, we should use the driver-provided ID for MAC addresses so that interfaces are detected correctly. PL-133360
Additionally, only reset the link-local address generation mode on hardware links which may have had dhcpcd using them during bootstrapping. PL-133360
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - I'm trusting the fix (I'm a bit hazy of what exactly was wrong here) as you mentioned that this has happened before, fixed up the learnings from the various incarnations and wrote tests.
tests/ipv6-autoconfig.nix
Outdated
|
||
with subtest("testing ipv6 autoconf configuration on ethsrv"): | ||
for sysctl in sysctls: | ||
machine.succeed(f"sysctl net.ipv6.conf.ethsrv.{sysctl} | grep 0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit frustrated by the switch from Python to Bash ... ;) Specifically the grep feels like a shotgun.
If we need to stay within bash then this would be a bit more exact: [ "$(sysctl net.ipv6.conf.ethsrv.accept_ra -n -b)" == "1" ]
... BUT ... it's terrible to read IMHO ...
I'll let you decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, the sysctls which handle temporary SLAAC-generated addresses take times in seconds, so this would match if there's a 0 digit in the number of seconds. I think a better solution might be to write a script which asserts that the sysctl is 0, and then invoke that in the test.
270cf82
to
a552dc7
Compare
In the implementation of the network code we have a distinction between interfaces which are backed by some hardware network device, and those which are backed by a synthetic VXLAN kernel network device. The existing code only generates the systemd units which disable IPv6 autoconfig for the VXLAN-backed "virtual" links. This means that the physical links are left with the default behaviour (which is to enable IPv6 autoconfig, accept router advertisements, etc). fc-nixos/nixos/platform/network.nix Lines 551 to 555 in 8e6c7d2
This is missing the creation of the systemd units also for |
Due to refactoring and merges, the network code in the platform did not correctly ensure that IPv6 autoconfiguration is disabled on all interfaces by default. This change fixes this regression, and introduces some tests to ensure that we catch unintentional changes to this behaviour again in the future.
Additionally, I've adjusted the network configuration code to allow the VM or hardware configuration profile to be selectable using a NixOS option. This allows the hardware profile to be used in Hydra test VMs so we can test EVPN-related network functions without having to rewrite all the config manually by hand, and I've also included a test fixture which will create a VM acting as a mock datacentre VXLAN switch.
PL-133360
@flyingcircusio/release-managers
Release process
./changelog.sh
PR release workflow (internal)
Design notes
on
oroff
. Example: rate limiting.Security implications