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
changing .netdev files and restarting has no effect if interface already exists #9627
Comments
networkd uses .netdev files only to create network devices that are missing, and that's it. If you delete the vlan manually, then it should be set up again correctly |
Please use |
Please implement recreation of netdevs if their parameters mismatch. This is annoying, because it very easily goes unnoticed. |
This also affects the wireguard configuration using systemd-networkd Every time I want to add new peers or add new allowed ip ranges to existing peers I have to completely delete the wireguard interface and let systemd-networkd create it again. This disrupts existing connections on that interface, which makes it really annoying. |
While not a solution, you can use this workaround if you're using separate dropins for your peers: wg syncconf wg0 <(sed -e 's/WireGuardPeer/Peer/g' -e 's/WireGuard/Interface/g' /etc/systemd/network/*.netdev.d/*) |
Nice! |
If systemd-networkd had a switch to force interface reconfiguration for already created (i.e. running) interfaces. This would be immensely helpful! E.g. having separate commands for creating non-existing interfaces (the current default) and a switch argument in relation to Alternatively, being able to manually specify a command in the configuration files that systemd-networkd will execute when An example could be |
Linux defaults to creating a `bond0` interface when modprobing the `bonding` driver, because the `max_bonds` option defaults to `1`¹. This `bond0` interface is created with the default bond mode `balance-rr`, which is most often undesirable. Networkd in turn is unable to change this mode, since it does not implement netdev recreation on parameter mismatch². If we instead default `max_bonds=0` the driver will be loaded, but no default interface will be created, leaving networkd in a better position to set up the network configuration. [1] https://www.kernel.org/doc/Documentation/networking/bonding.txt [2] systemd/systemd#9627
This issue makes bonds a bit tricky. One of the default side-effects of loading the A somewhat typical solution to this is to set some modprobe options to make bond0 the type you want. For example: Another option is to set the misnamed "max_bonds" option to zero to disable the creation of bond0 altogether: I just wanted to call out that NixOS is considering applying a patch which sets the default "max_bonds" to 0 at compile time: NixOS/nixpkgs#161281. This fits with our philosophy (and I think systemd's philosophy) of declarative configuration more nicely, at the expense of diverging from upstream's behavior. |
We already provides Note, I am slowly working on this RFE, and WIP PR is #22557. |
Linux defaults to creating a `bond0` interface when modprobing the `bonding` driver, because the `max_bonds` option defaults to `1`¹. This `bond0` interface is created with the default bond mode `balance-rr`, which is most often undesirable. Networkd in turn is unable to change this mode, since it does not implement netdev recreation on parameter mismatch². If we instead default `max_bonds=0` the driver will be loaded, but no default interface will be created, leaving networkd in a better position to set up the network configuration. [1] https://www.kernel.org/doc/Documentation/networking/bonding.txt [2] systemd/systemd#9627 Co-Authored-By: Graham Christensen <graham@grahamc.com>
Thanks for the reference @yuwata, we've evidently missed this in our integration and are resolving that in NixOS/nixpkgs#161391. I appreciate it! |
Upd of this solution
|
A nice hack. It doesn't work when using PrivateKeyFile= though, - need to read that file and change the keyword to PrivateKey= . |
systemd version the issue has been seen with
Used distribution
Expected behaviour you didn't see
Steps to reproduce the problem
setup a vlan using systemd-networkd
restart systemd-networkd and confirm vlan is created (ip -d link show)
change vlan id in the .netdev file of the vlan
restart systemd-networkd
observe the vlan id on the interface is still the intial vlan id and not the new one (ip -d link show)
The text was updated successfully, but these errors were encountered: