Iptables reset after reboot

gryzor

New member
Joined
Nov 28, 2013
Messages
3
Hello!

Hopefully this hasn't been asked before - looked around but no luck.

On my Debian box, every time the system is rebooted, DirectAdmin's iptables is empty... any way to have addresses persistently added to it?

Thanks!
 
Could you specify what you mean with "Directadmin's iptables"?
Because DA does not have any iptables. Iptables is the firewall which is part of the operating system.
After a reboot, it's restarted which clears all lists.

If you want a firewall which remembers blocked ip's after a reboot, best thing you can do is install a shell for it like Configserver Firewall, better known as CSF/LFD. You can find several items about it on the forums here. There is also a DA plugin for it.
 
Hello Richard,

Thanks for your reply!

You're right, what I meant was "iptables as populated by DirectAdmin's Brute-Force Attack Detection" :) I overlooked the fact that iptables are discarded on reboot, you're right...

I found the plugin, looks great, although maybe creating a script to save iptables and reinsert blocked IPs upon boot is simpler. But I think I'll try it.

Thanks again!
T
 
You shouldn't be rebooting all that often :D.

There are already commands to save and restore iptables contents; you can call them anytime you want. I'm not sure how to do any of this with Debian, as I use CentOS, but perhaps someone else can be more specific.

Jeff
 
Well, it's a VPS I use to toy around with and learn, so every now and then I'll reboot or restore it... :D

Actually it should be pretty easy with iptables-save and iptables-restore in if-pre-up.d...

Thanks for your reply!
 
Back
Top