How to list iptables rules
To view all rules in iptables, run
1 |
iptables -L |
Or
1 |
iptables --list |
To list iptables rules with out resolving IP to hostname
1 |
iptables -L -n |
To show line number
1 |
iptables -L -n --line-number |
To list NAT rules
1 |
iptables -t nat -L -n --line-number |
If you run iptables-save command, it will list all iptables rules
1 |
iptables-save |
You can redirect result of iptables-save command to a file, later restore with iptables-restore command.
Back to iptables