Linux iptables

Published on Author admin

Linux iptables

First off all we should set policy for our firewall:
iptables -P

Example:

To show current status of our firewall – iptables:
NOTE: this doesn’t mean rules are in /etc/iptables.rules file.

Same, but a little shorter:

keys:
-n – do not resolv service names
-L / –list – lists rules
–line-numbers – set line number to help handle (delete for example) rules

Output:

Adding Accept rule:

Example: allow nrpe access from nagios to check services status