π ~1 min read
Table of contents
Symptom & Impact
Expected packet filtering rules vanish after restart, reducing security controls.
Environment & Reproduction
Rules are loaded interactively but not saved to persistent config.
sudo nft list ruleset
Root Cause Analysis
nftables service starts without a valid /etc/nftables.conf ruleset.
Quick Triage
Check service enablement and presence of persistent rules file.
systemctl is-enabled nftables
ls -l /etc/nftables.conf
Step-by-Step Diagnosis
Compare live ruleset with persisted configuration file.
sudo nft list ruleset > /tmp/live.nft
sudo cat /etc/nftables.conf

Solution – Primary Fix
Save live rules to /etc/nftables.conf and enable nftables service.
Still having issues? Our IT Consulting team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo nft list ruleset | sudo tee /etc/nftables.conf
sudo systemctl enable --now nftables

Solution – Alternative Approaches
Manage rules centrally with automation and deploy file atomically.
sudo nft -f /etc/nftables.conf
Verification & Acceptance Criteria
Rules are present after service restart and host reboot.
sudo systemctl restart nftables
sudo nft list ruleset
Rollback Plan
Restore previous nftables.conf backup if traffic flow is impacted.
sudo cp /etc/nftables.conf.bak /etc/nftables.conf
sudo systemctl restart nftables
Prevention & Hardening
Track firewall config under version control and validate syntax before apply.
sudo nft -c -f /etc/nftables.conf
Related Errors & Cross-Refs
Related to nft syntax errors and unexpected default accept behavior after reboot.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu nftables service and persistence documentation.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.