1

On Debian, what is the best way to start an iptables firewall script :

  1. /etc/init.d/firewall_script.sh
  2. in /etc/network/interfaces, add post-up /etc/network/if-up.d/firewall_script.sh

Do you check if the firewall is active and restart it if it's not the case ? if yes, how ?

Thanks for advices

1

Consider using the iptables-persistent package:

https://packages.debian.org/stable/admin/iptables-persistent

This manages iptables persistence by saving rules in the file /etc/iptables/rules.v4 for IPv4 and /etc/iptables/rules.v6 for IPv6

A good source if information for this is here => http://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently

|improve this answer|||||
0

I think of preferences let each service instance that launches separately from each other 'Networking and iptables , so after the network service start the script statements will also launch .

  1. /etc/init.d/firewall_script.sh
|improve this answer|||||
0

I use the post-up line in the interfaces file (like your option 2) except not in the if-up.d directory. I think putting it there that would make it be invoked twice. To check on the firewall I use iptables -vnL | less

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.