Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with iptables config

Status
Not open for further replies.

rninja

Technical User
Apr 11, 2001
381
US
Hello,
I am trying to get my 2nd NIC card to masquerade using iptables. Here is my setup:

eth0 = Internet Link
eth1 = wireless AP

I would like to have all the traffic moving from eth1 to eth0 and back. I have tried to set the following in my iptables and it worked the first time I set it up. Upon reboot however, I didn't have the settings defined and I tried to do them again, to no avail. This time it didn't work, and it still doesn't.

1) echo "1" > /proc/sys/net/ipv4/ip_forward
2) iptables -F
3) iptables -A FORWARD -o eth0 -s 192.168.2.0/24 -j ACCEPT
4) iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -j MASQUERADE
5) iptables -A FORWARD -j LOG

I try over and over and for some reason I get no traffic. I even tried to set a log setup for iptables, only to see that it is not invoked what-so-ever.

I appreciate any help with this, this is driving me nuts. Rninja

smlogo.gif

 
How do you put your iptables script ?
It's possible. Your iptables scripts didn't start yet.
 
I would suggest to use
echo 1
instead of
echo "1"

The value of the variable named "1" is set by default to zero, indicating you want this service disabled, rather than enabled.
By using no quotes you are inserting an integer directly, rather than a variable named 1 which contains a zero.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top