General tips for working with iptables
Need to make some changes to your iptables rules running on one of your servers? Don't worry. While iptables can be a bit risky in that it'll let you add rules without checking your logic there are a few steps that can make your life much easier. Also, as just a general tip: Whenever you are working with modifying network access to a machine or just managing a server in general it pays to have local and/or remote console access to the machine.iptables-save > {filename}and tada! You now have a safe restore point should your editing go awry.
iptables-restore < {filename}If things go belly up don't lose your cool. Just hit the remote console (I did tell you to make sure you have console access right?) and use iptables-restore to reload the saved copy of your known good rule set. You DID save a copy of the previous rule set like you were supposed to right?
Other things to remember:
iptables -Fto flush all the active rules leaving you without access to your machine and forced to use the console in shame.
-A INPUT -j LOG --log-level 6so that you can see when your rules are denying traffic by checking /var/log/messages or wherever your OS flavor prefers to dump iptables info.
If you have improvements, corrections or suggestions of what has worked well for you please share
No comments:
Post a Comment