Page 1 of 1

Solved: how to get a list of forward rules in iptables

Posted: Thu May 20, 2010 10:30 pm
by mister_v
Hello

I would like a list of all the forward rules in iptables.
I tried

Code: Select all

iptables --list
But it doesn't give me a full and clear list.

Re: how to get a list of forward rules in iptables

Posted: Fri May 21, 2010 6:44 pm
by Chris
Well,

Code: Select all

iptables --list FORWARD
Should give you all the forward rules.

You can also try:

Code: Select all

iptables-save > iptables_file.txt
This puts all the rules and the commands one by one in iptables_file.txt.

I hope this helps.

Re: how to get a list of forward rules in iptables

Posted: Sat May 22, 2010 9:18 pm
by mister_v
Thanks

Code: Select all

iptables-save > iptables_file.txt
gives a much clearer view.

Re: Solved: how to get a list of forward rules in iptables

Posted: Sun May 23, 2010 10:31 pm
by mister_v
I got even a better way:

Code: Select all

iptables -t nat -L PREROUTING
This was what I was looking for, not the forward chain but the PREROUTING chain.