Possible Duplicate:
IPTables: No chain/target/match by that name

I am trying to execute the following command in iptables (it's the first command I have issued to IPTables since I setup my new VPS, but when I execute the command below:

iptables -A INPUT POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source XX.XX.XX.XX

I get:

iptables: No chain/target/match by that name.

From the output I am assuming I would have to create a chain / target beforehand, but how would I do this?

I don't see where I am going wrong

link|improve this question
This will be more suitable in ServerFault, Unix&Linux, or SuperUser. Flagged for migration. – pepoluan Apr 23 '11 at 2:02
feedback

migrated from stackoverflow.com Apr 23 '11 at 22:46

This question came from our site for professional and enthusiast programmers.

closed as exact duplicate by Iain, Ward, mailq, Scott Pack, MDMarra Nov 17 '11 at 1:29

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

1 Answer

You cannot append to both INPUT and POSTROUTING; you will need to generate a rule per chain.

link|improve this answer
feedback