eth0 - connects to the lan

# Set up IP FORWARDing and MASQUERADING
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward4

That should do the job. Just make sure that all the neccessay things
are compiled into the kernel. I had trouble with mtu's but try this
first than we can try something else :P







On 6/21/05, Kurt Guenther <[EMAIL PROTECTED]> wrote:
> As root do:
> 
> echo 1 > /proc/sys/net/ipv4/ip_forward
> /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> 
> where eth0 is your outward facing port to your router.  I've used ppp0 with a 
> dial up connection, and that works too.
> 
> --Kurt
> 
> 
> 
> 
> askar ... wrote:
> 
> > Hello!
> >
> > I have to PCs.
> > 1st one used as a router.
> > On 2nd PC I have web server installed and would like to setup ip
> > forwarding to the 2nd PC.
> >
> > In my iptables rule script I added the line:
> > $IPTABLES -t nat -A PREROUTING -p tcp --dport 80 -i ppp0 -j DNAT --to
> > 192.168.0.2 <http://192.168.0.2>
> >
> > Where 192.168.0.2 <http://192.168.0.2> is the ip address of the 2nd PC.
> >
> > But is seems not correct.
> >
> > Please, give some advice.
> >
> > I'm using PPPoE Adsl connection.
> >
> >
> > askar
> >
> 
> --
> gentoo-user@gentoo.org mailing list
> 
> 


-- 
"When you play a Microsoft CD backwards you can hear demonic Voices...
that's nothing - when you play it forward it installs Windows"
Are you fearing my mouse? <:3___)~~~~

-- 
gentoo-user@gentoo.org mailing list

Reply via email to