View Single Post

  #4 (permalink)  
Old 11-04-2004
ziupiu
 
Posts: n/a
Default Re: Newbie NAT question

Fernando Vaz <fernandovaz@matrix.com.br> wrote in message news:<2ushjoF2falr0U1@uni-berlin.de>...
> Hello folks,
>
> I'm trying to set up a home network, using an older PC as a
> gateway/apache server. The connection between both boxes works fine,
> and the gateway connects to the internet fine (ADSL ppp0 connection, it
> pings out of my net ok). All the NAT modules are loaded, I have cleared
> all firewall rules, but still the machine behind the gateway can't
> ping anywhere past the gateway. ipv4_forward is set to 1. I'll try to
> draw a diagram:
>
>
> | |
> | internet |
> |_____________|
> |
> |
> \/
> -------------------
> |ppp0(valid ip) |
> | /\ |
> | | |
> | \/ |
> |eth0 (ip 0.0.0.0)|
> | /\ |
> | | |
> | \/ |
> |eth1(192.168.0.2)|
> |_________________|
> /\
> |
> \/
> -------------------
> |eth0(192.168.0.5)|
> |gw 192.168.0.2) |
> |_________________|
>
> Is it something to do with my routes? Please help, I've been struggling
> over this for quite a few days, and I'm pretty sure "im missing out on
> something really dumb...
>
> Thnx.


Try this on your gw:

ifconfig eth0 down
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
Reply With Quote