Where Are iptables Rules Stored?
iptables rules persist in distro files like /etc/iptables/rules.v4. Running rules live in kernel until saved.
Last updated
iptables rules live twice: in the kernel while running, in files for boot. Forgetting the save step is the classic firewall story. Everything works until reboot.
File locations vary by distro family while commands stay constant. Learn the save and restore pair for yours. nftables backends add a translation layer but keep the files familiar.
Where iptables stores this, by platform
/etc/iptables/rules.v4
Debian-family persistent rules. Saved by iptables-save, loaded at boot. Pair with ip6tables rules file for v6.
Frequently asked questions
Why did my firewall rules vanish after reboot?
Save with iptables-save to the rules file your distro loads, then enable the restore unit. Unsaved rules evaporate on reboot.
Which rules file does my distro use?
Debian family uses /etc/iptables/rules.v4, RHEL family uses /etc/sysconfig/iptables. Check which restore mechanism your distro ships.
Should I still learn iptables with nftables around?
Yes through nftables backend or direct nftables. iptables-nft translates classic syntax. Check which backend iptables points at first.
Notice an outdated path? Let us know.