Networking : how to bridge two NICs to share internet access ?

Luis Murillo lmurillo at gmx.net
Thu Aug 25 06:33:41 UTC 2005


On Thu, 2005-08-25 at 07:55 +0200, Vincent Trouilliez wrote:
> On Wed, 2005-08-24 at 23:19 -0600, Luis Murillo wrote:
> > ok, lets see, I've read the whole thread and think that it became a bit
> > confusing for the new user. 
> 
> Luis, thanks ! :o)
> 
> Your mail was very informative, useful and clear, you must be a
> teacher ;-)

heh heh, well not exactly a teacher, but I get around ;)

> It's all clear for me now I think :
> 
> 1) for my quick internet sharing experiment with my buddy's laptop this
> week, I will just use a cross-over cable and "firestarter" (I tried it,
> it's soooo easy to set-up, just click and run ! :o)
> 
> 2) later, when I actually come round to building a home network, I will
> buy a switch (sounds like it's sufficient from your description) and
> some cables...

That's exactly how I have my current home network, I'll show you a
"diagram" of what it would look like:

                         eth0      eth1
(Internet)-----[Modem]----{Linux Box}-----[Switch]---[AccessPoint]
                                              |-----{Machine1}
                                              |-----{Machine2}
                                              '-----{MachineN}

Note: the ASCII diagram is best seen with the Monospace font :)

Now, the eth0 and eth1 are the network cards or NICs that the Linux box
should have, the way they're connected are may vary and it's not
necessarily that eth0 will connect to the Modem.
Also you have to remember that the internal network (LAN) is _required_
to have a _different_ IP address from the external network (WAN or
Internet), for example if your modem assigns the IP 10.xxx.xxx.xxx, then
the internal network (LAN) would have an Ip of 192.168.1.xxx, this is
because the Linux box wouldn't know where to send the packets if both
sides have the same IP address range. At first I made this mistake, I
had the internal network with the IP 10.0.0.xxx and the external network
with 10.1.140.xxx, and it didn't work.
You can check which IP is assigned by the modem by running the command
ifconfig on a terminal as the normal user (i.e. with your username), it
will give you an output of all the active network cards, just check the
one that's connected to the modem, for example if you have the modem
connected to the eth0 then you should check the data regarding that
card, in my case I have:

eth0      Link encap:Ethernet  HWaddr 00:E0:7D:B9:45:75  
          inet addr:10.140.8.230  Bcast:255.255.255.255
Mask:255.255.255.248
          inet6 addr: fe80::2e0:7dff:feb9:4575/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:714273 errors:0 dropped:0 overruns:0 frame:0
          TX packets:650267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:572206986 (545.6 MiB)  TX bytes:60408886 (57.6 MiB)
          Interrupt:10 Base address:0xe800

Look at the line that says "inet addr" the number after that is the IP
address that the modem has assigned my Linux box, so then I have to set
the eth1 with an IP of 192.168.1.1 (this can be done with the network
configuration utility that Ubuntu has). Finally tell firestarter that
which is the internal and external network cards.

I'm glad I have helped. You can contact me personally and I'll help you
with anything I can :)

[...]
-- 
Luis Murillo M.
lmurillo at gmx.net
Heredia, Costa Rica

GPG KeyID: D66B35FD
gpg --keyserver pgp.mit.edu --recv-keys D66B35FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050825/4ac7f256/attachment.sig>


More information about the ubuntu-users mailing list