Skip to content

iptables rules gone after every reboot

VPS Hosting by jihoonred86 1 replies 155 views
#1

Running Debian 12 on a Contabo 1GB plan. I set up some basic iptables rules to block a few ports, works fine until reboot then everything is wide open again. Is this a Contabo thing or am I missing something obvious?

YABS for reference since people always ask: https://github.com/masonr/yet-another-bench-script

  • CPU: 15k
  • Disk: 450 MB/s
  • Network: 1.5 Gbps

For €3 this thing destroys my old Hetzner €10 box btw. Disk was 200 MB/s there. Anyway how do I make these stick?

#2

You need to save them! iptables is not persistent by default in Debian. Try this:

Sudo iptables-save > /etc/iptables/rules.v4

Then enable netfilter-persistent service. Or install iptables-persistent package, it will ask during install if you want to save current rules. Say yes!

I had same issue with Vultr VPS last year, sent ticket yesterday actually about something else but they were very fast. Cheers!

swimming upstream since 2019 🐟

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft