Affected versions: Ubuntu 24.04 LTS Ubuntu 24.04 Ubuntu 24.04.1

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

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
Illustrative mockup for ubuntu-24-04-lts β€” terminal_or_console
Diagnosis commands for post 165 β€” Illustrative mockup β€” Progressive Robot

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
Illustrative mockup for ubuntu-24-04-lts β€” log_or_dashboard
Fix validation evidence for post 165 β€” Illustrative mockup β€” Progressive Robot

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 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.