[Courses] [Networking] Lesson 4: Success story

Akkana Peck akkana at shallowsky.com
Fri Jul 25 21:29:57 EST 2003

Hamster's multi-part Lesson 4 came at a perfect time: my husband and I
were just gathering up the information and energy to try a project we've
been wanting to do literally for years, and then what should come along
but Hamster's lesson with instructions for the final step we needed. :-)

The problem we were trying to solve was slightly different from the
basic problem Lesson 4 addresses, but it's surprising how little needed
to be changed in order to solve it.  It was this: when we go on a trip,
we take both our laptops, but a motel room only has one phone (and
sometimes the phone call costs money, so reducing the number of phone
calls is desirable).  We wanted to have one laptop dial in, establish
a PPP connection, then have the other laptop connect up using ethernet
or wireless, and route through the first laptop's PPP connection.

So it's really not that different, except that the gateway machine
is using PPP0 instead of eth0.  The iptables commands Hamster lists
work like a charm!  So thank you very much, Hamster!  We'll be
thinking of you fondly every time we go on a trip from now on. :-)

(Even better, we got it working using wireless cards in ad-hoc mode,
so we don't even need an ethernet cable. :-)

There was one problem we encountered that Hamster didn't mention.
I'm not sure whether it's specific to the fact that we were using PPP
on the gateway machine or not.

Hamster writes:
> # Start of ifcfg-ethX -----------------------------------------------------
[ ... ]
> GATEWAY=<gateway>
> # This is the IP address of the gateway machine from step 4. It too needs to
> # be the same for all your computers. This line does not need to be included
> # in the config file on the gateway machine itself, but it does no harm if
> # you leave it in.

In our case, we were taking a machine that normally talked over ethernet
via eth0, but in this unusual case the gateway machine would be using
ppp0 to talk to the internet and eth0 only for the local net.  GATEWAY
was initially specified to be the gateway for our normal local network
firewall, but that caused the eth0 interface to hide the ppp0 interface
as soon as eth0 became active (and even after eth0 went down, ppp0 still
didn't work).  Commenting out the GATEWAY line fixed the problem and
allowed both interfaces to be active at once.  I just realized, though,
that I didn't actually try the suggestion of setting GATEWAY to point to
the current machine, which might have had the same effect.  

Anyway, if anyone is having trouble getting two interfaces to work
simultaneously, check GATEWAY and make sure you aren't specifying
mutually exclusive gateway settings for both interfaces.


More information about the Courses mailing list