TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:4480] IP Masq question (another)



Lawrence Crisp wrote:
> 
> Hello all,
> 
> I'm tryig to help a friend set up a network similar to mine (outside
> network to gateway to hub to inside network) and we've gotten stuck.
> He's getting a DSL line, which uses dynamic adressing.  Is there any way to
> enable IP forwarding when he's getting a new IP each time?

Hi Larry,

As I understand it (and I'm no expert), the IP addresses are
always assigned to an interface, e.g. eth0, ppp0, ppp1.  A
gateway will have more than one IP, one for each subnet
connection.  As long as the kernel knows which interface to route
to, things should be fine.  In the case of the dynamic IP on a
ppp connection, you just need to make sure the new IP is added to
the routing table, typically as the defaultroute.  You can do
this by hand (e.g. 'route add default xxx.xxx.xxx.xxx'), but in
practice, it'll be a command line parameter to pppd.  If you're
running RH, you can set this as a checkbox in 'netcfg'.  I'm not
sure how other distributions do it.

Anyway, the effect of this is that when pppd runs, it'll grab the
new dynamic IP, and add it to the routing table as the default
route.  Any IP packet that doesn't belong to the local network
will be sent to that default route, i.e. the ppp interface/DSL
line.  When pppd shuts down, it will remove the default route.

IP Masquerading doesn't really care about the routing, per se. 
It lets the routing table figure out where to send the
masqueraded packets.  If you have the default route set properly,
you should be able to set up IP Masq just like always (unless you
want to get clever with the destination IP mask...).

John

P.S.--Someone please correct me if I'm wrong here.  I just
figured this out last weekend, so my understanding may be a
little crusty.  (c: