How to list iptables rules

To view all rules in iptables, run

iptables -L

Or

iptables --list

To list iptables rules with out resolving IP to hostname

iptables -L -n

To show line number

iptables -L -n --line-number

To list NAT rules

iptables -t nat -L -n --line-number

If you run iptables-save command, it will list all iptables rules

iptables-save

You can redirect result of iptables-save command to a file, later restore with iptables-restore command.

Back to iptables

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *