On Mon, 28 Aug 2006 23:26:11 -0700, wisptech wrote:
> Here is the masquerade section of rules that I have set up...
>
> iptables -t nat -A POSTROUTING -s 172.19.0.0/24 -j SNAT --to
> 66.119.9.186
Well since you are using FORWARD I will assume (bad idea I know) that you
have more then one interface on this box.
Since POSTROUTING is done on all FORWARD'ed packets every packet no matter
where is started, when it exits the box it is being SNAT'ed to
66.119.9.186
eth0 -> PREROUTE -> FORWARD -> POSTROUTE -> eth1
eth0 <- POSTROUTE <- FORWARD <- PREROUTE <- eth1
The steps are simple;
Enter an interface
Do some PREROUTE rules
Route Packet (FORWARD)
Do some POSTROUTE rules
Exit other interface
You can fix this by using the '-o <interface>' option which is the
outbound interface. For example I will assume (I know) that eth0 is the
interface to the world. Your rules should then look like this
iptables -t nat -A POSTROUTING -o eth0 -s 172.19.0.0/24 -j SNAT --to 66.119.9.186
Then only packets that are exiting to the world will be SNATed and not
every packet that cross the box.
> iptables -A FORWARD -t filter -m state --state NEW,ESTABLISHED,RELATED
> -j ACCEP
> iptables -A FORWARD -t filter -m state --state ESTABLISHED,RELATED -j
> ACCEPT
Here again the first ACCEPT rule takes charge so the second does nothing.
If you want to allow only the NEW packets from your 172.19 network through
this box then you would have to change the first rule to;
iptables -A FORWARD -t filter -i eth1 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
and you would change the second one to only allow related packets back
like this;
iptables -A FORWARD -t filter -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
> Can someone tell me what the heck I'm doing wrong?
That should get you started. If this BOX only has one interface then the
rules change again and you don't need FORWARD.
Take a look at this site. I think it might help you.
http://iptables-tutorial.frozentux.n...-tutorial.html
--
Regards
Robert
Smile... it increases your face value!
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----