[thelist] OT? IP masquerading with dynamic IP help?

dan donaldson dan at omnivore.ca
Mon Mar 4 09:35:00 CST 2002


On Monday, March 4, 2002, at 09:29  AM, Colin Mitchell wrote:

> Sorry for the long delay in replying to this one.  Unfortunately, I
> just got
> one of those nifty hub/firewalls and I've removed a couple lines of my
> configuration because of it.
>
> I like to use the 'netcfg' tool to setup my interfaces.  There's a panel
> there where you can choose the 'Interface configuration protocol' --
> choose
> DHCP.  Then, in my rc.local file, I have a line that looks like this:
>
> route add default gw eth0
>
> (eth0 is the NIC that is attached to the external network)
>
> That line should route all traffic on the internal network to the
> external
> network.  Then add in the appropriate masquerading lines (which for me
> look
> like this):
>
> #########################################
>
> # Load the NAT module (this pulls in all the others).
> modprobe iptable_nat
>
> # In the NAT table (-t nat), Append a rule (-A) after routing
> # (POSTROUTING) for all packets going out ppp0 (-o ppp0) which says to
> # MASQUERADE the connection (-j MASQUERADE).
> iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
>
> # Turn on IP forwarding
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> route add default gw eth0
>
> #########################################

Many thanks to those who helped me out on and off list. I am working
through what I've been given within my pathetic abilities and I'll post
to let others know the result.

dan




More information about the thelist mailing list