[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

can't get it in iptables



Hello all,
I am trying to use iptables for nat.
Here is my firewall.sh
----------------
#!/bin/sh
IPTABLES='/sbin/iptables'

# Set interface values
EXTIF='ppp0'
INTIF='eth1'

# enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward

# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X

#Enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

#Forward LAN traffic from LAN $INTIF to Internet $EXTIF
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT

----------------
eth1 is 192.168 subnet so I give out internet to my local machines.
but there is also subnet 10.20 connected to server and I want to allow all the pcs from my subnet 192.168 to acess 10.20 through server.
for now everything coming to server goes to ppp0.
How do I challenge that?

Reply to: