Restarting the nftables.service will clear tables that are set up by other services such as systemd-networkd or e.g. tailscaled.
Steps To Reproduce
Steps to reproduce the behavior:
Add a systemd-networkd network with a networkConfig.IPMasquerade - "both" option;
Observe networkd creating a table ip io.systemd.nat, with sudo nft list tables
sudo systemctl restart nftables
sudo nft list tables and observe that table ip io.systemd.nat is now gone.
Expected behavior
Restarting the nftables service should not remove the tables from other services, or it should ensure the services know to set up their tables again.
The latter seems pretty hard to achieve however. For networkdnetworkctl reconfigure $interface will reset these rules (sudo systemctl reload systemd-networkd.service on the other hand will not) so NixOS will know to go through all the interfaces affected interfaces.
For tools like tailscaled the only way I know right now involves at least a full reconfiguration (so a service restart most likely.)
Notify maintainers
No meta.maintainers in nftables firewall module
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
system: "x86_64-linux"
host os: Linux 6.1.68, NixOS, 24.05 (Uakari), 24.05.20240131.b8b232a
Describe the bug
Restarting the
nftables.service
will clear tables that are set up by other services such assystemd-networkd
or e.g.tailscaled
.Steps To Reproduce
Steps to reproduce the behavior:
systemd-networkd
network with anetworkConfig.IPMasquerade - "both"
option;networkd
creating atable ip io.systemd.nat
, withsudo nft list tables
sudo systemctl restart nftables
sudo nft list tables
and observe thattable ip io.systemd.nat
is now gone.Expected behavior
Restarting the
nftables
service should not remove the tables from other services, or it should ensure the services know to set up their tables again.The latter seems pretty hard to achieve however. For
networkd
networkctl reconfigure $interface
will reset these rules (sudo systemctl reload systemd-networkd.service
on the other hand will not) so NixOS will know to go through all the interfaces affected interfaces.For tools like
tailscaled
the only way I know right now involves at least a full reconfiguration (so a service restart most likely.)Notify maintainers
No meta.maintainers in nftables firewall module
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result."x86_64-linux"
Linux 6.1.68, NixOS, 24.05 (Uakari), 24.05.20240131.b8b232a
yes
yes
nix-env (Nix) 2.18.1
/run/current-system/nixpkgs
Add a :+1: reaction to issues you find important.