You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have enabled autoUpgrade on my homelab, which is using the default NixOS firewall module. When an autoUpgrade occurs, or when nixos-rebuild switch --upgrade updates the firewall module, all networking on the server ceases to work when firewall.service is reloaded.
Running iptables -L on a local terminal hangs when it starts listing the nixos-fw chain.
Steps To Reproduce
Steps to reproduce the behavior:
TODO: isolate minimal NixOS config and test that causes the issue
Activate a NixOS system generation where firewall.service has changed slightly (no meaningful changes to actual behavior)
Expected behavior
The firewall reloads without interrupting the network.
Screenshots
Excerpt from my NixOS firewall config:
networking={firewall={enable=true;allowPing=true;logRefusedConnections=false;allowedTCPPorts=[2280443redacted];allowedUDPPorts=[6768redacted];# NOTE: 67/68 required for proxyDHCPextraCommands='' iptables -A nixos-fw -s 10.111.0.0/16 -j nixos-fw-accept iptables -A nixos-fw -s 10.88.0.0/16 -j nixos-fw-accept iptables -A nixos-fw -s 192.168.1.0/24 -j nixos-fw-accept ip6tables -A nixos-fw -s fe80::/64 -j nixos-fw-accept ip6tables -A nixos-fw -s fc00:111::/96 -j nixos-fw-accept ip6tables -A nixos-fw -s redacted:/64 -j nixos-fw-accept iptables -I FORWARD -j nixos-fw ip6tables -I FORWARD -j nixos-fw iptables -P FORWARD DROP ip6tables -P FORWARD DROP iptables -P INPUT DROP ip6tables -P INPUT DROP '';};nat={enable=true;internalInterfaces=["ve-+""vb-+""br0"];externalInterface="enp3s0";enableIPv6=true;externalIPv6="redacted";extraCommands='' iptables -t nat -A nixos-nat-post -d 10.111.0.12 -p tcp --dport 7522 -j SNAT --to-source 10.111.0.1 '';};};
Firewall config added to all NixOS containers:
networking.firewall.extraCommands='' iptables -A INPUT -s 10.111.0.0/16 -j ACCEPT${ifaddr6!=""then"ip6tables -A INPUT -s fc00:111::/96 -j ACCEPT"else""} '';
Message from firewall.service:
iptables: Chain already exists.
Failed to reload firewall... Stopping
Additional context
I am using both NixOS systemd-nspawn containers, and virtualisation.oci-containers with Podman as the backend. In the config excerpt above, 10.111.0.0/16 is the subnet used by NixOS containers.
Also, I am running dnsmasq on host as proxyDHCP exclusively.
The issue arising appears to correlate with NixOS 21.11, so it might be something exclusive to nftables.
Notify maintainers
Metadata
system: "x86_64-linux"
host os: Linux 5.15.78, NixOS, 22.05 (Quokka), 22.05.4250.6474d93e007
Wonder if this has something to do with it? Looks like a conflict between Podman's firewall settings and my own "funnel FORWARD into the NixOS-generated firewall".
Maybe Podman uses nft directly and iptables-nft then walks in and breaks the chain?
Describe the bug
I have enabled
autoUpgrade
on my homelab, which is using the default NixOS firewall module. When anautoUpgrade
occurs, or whennixos-rebuild switch --upgrade
updates the firewall module, all networking on the server ceases to work whenfirewall.service
is reloaded.Running
iptables -L
on a local terminal hangs when it starts listing thenixos-fw
chain.Steps To Reproduce
Steps to reproduce the behavior:
firewall.service
has changed slightly (no meaningful changes to actual behavior)Expected behavior
The firewall reloads without interrupting the network.
Screenshots
Excerpt from my NixOS firewall config:
Firewall config added to all NixOS containers:
Message from
firewall.service
:Additional context
I am using both NixOS
systemd-nspawn
containers, andvirtualisation.oci-containers
with Podman as the backend. In the config excerpt above,10.111.0.0/16
is the subnet used by NixOS containers.Also, I am running
dnsmasq
on host as proxyDHCP exclusively.The issue arising appears to correlate with NixOS 21.11, so it might be something exclusive to
nftables
.Notify maintainers
Metadata
"x86_64-linux"
Linux 5.15.78, NixOS, 22.05 (Quokka), 22.05.4250.6474d93e007
yes
yes
nix-env (Nix) 2.8.1
"nixos-22.05"
"git-goodies, nixpkgs-22.05pre363562.30d3d79b7d3"
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: