Test Iptables Script Remotely

by on June 26, 2007 · 0 comments· LAST UPDATED June 26, 2009

in , ,

How do I test iptables based script remotely over ssh session? How do I avoid lock outs?

iptables do not have pf like testing option. However, you can use a shell script and cron combo or just use the following syntax:
# /sbin/service iptables restart; sleep 20; /sbin/service iptables stop &
This way you can recover from bad syntax error. If you have your own script:
# /path/to/your.script.sh; sleep 20; /sbin/service iptables stop &
Above will allow you to test changes for a while and then turn off firewall completely. You will be able to login again using ssh after 20 seconds if locked out.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , , , ,

Previous Faq:

Next Faq: