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

Post Reply
mister_v
Posts: 137
Joined: Sat Jun 20, 2009 5:42 pm

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

Post 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.
Last edited by mister_v on Sat May 22, 2010 9:18 pm, edited 1 time in total.
Chris
Site Admin
Posts: 127
Joined: Mon Jul 21, 2008 9:45 am
Location: Leuven, Belgium
Contact:

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

Post 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.
mister_v
Posts: 137
Joined: Sat Jun 20, 2009 5:42 pm

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

Post by mister_v »

Thanks

Code: Select all

iptables-save > iptables_file.txt
gives a much clearer view.
mister_v
Posts: 137
Joined: Sat Jun 20, 2009 5:42 pm

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

Post 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.
Post Reply