Viewing all iptables rules
Is there a way to view
iptablesrules in a bit more detail?
I recently added masquerade to a range of IPs:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE service iptables save service iptables restart
Which has done what I want it to, but when I use:
I get the same output as I normally get:
Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
How can I see the rules including the ones I add? (system is CentOS 6)
When using the
--listoption to list the current firewall rules, you also need to specify the appropriate Netfilter table (one of
security). So, if you’ve added a rule for the
nattable, you should explicitly specify this table using the
iptables --table nat --list
Or using the options short form:
iptables -t nat -L
If you don’t specify a specific table, the
filtertable is used as the default.
For faster results, it can be useful to also include the
--numericoption to print numeric IP addresses instead of hostnames, thus avoiding the need to wait for reverse DNS lookups.
You can get even more information by including the