Sharing Internet connection using bridge mode

Last update on September 29, 2009 10:18 AM by jad05
Published by netty5

Sharing Internet connection using bridge mode






Internet connection can be shared with another computer if you have a free Ethernet port

Sharing via bridge mode


When using a box, first activate the router functions of your box so that it can assign different IP to each PC.

E.g
Imagine that you have a PC with 2 Ethernet interface:

eth0 is connected to the Internet (and is automatically assigned IP 192.168.0.x by the dhcp.
eth1 is a free interface (configured with a fixed IP 10.0.0.1).



Your /etc/network/interfaces file must look like this:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0


We will connect a second PC to the eth1 port like this:



Making use of the bridge implies that any Ethernet frame received on an ethernet interface (eth0 or eth1) will be re-issued on the other. Just like hen connecting 2 PC via a hub.



PC2 will have its IP address automatically assigned by the box, and can connect directly to the Internet.
Installation

Installing bridge-utils


Type: sudo apt-get install bridge-utils

Change the configuration

Modify the /etc/network/interfaces file

auto lo
iface lo inet loopback

auto br0
iface br0 inet dhcp
bridge_ports eth0 eth1

auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0

Notes


To validate this configuration, type: sudo /etc/init.d/networking restart

The bridge br0 is configured to obtain IP address via DHCP and then is asked to connect "virtually" eth0 and eth1 with using the following command: bridge_ports eth0 eth1.

On PC2, you just have to configure it with DHCP (automatic IP address).
Best answers for « Sharing Internet connection using bridge mode » in :
Sharing an Internet connection in Windows XP Show Advantages If you have a local area network (two or more computers connected in a network) with one computer connected to the Internet (via a modem, using a cable, etc.), it may be useful to make the Internet accessible to the other computers on...
Sharing an Internet connection Show Advantages If you have a local area network (two or more computers connected in a network) with one computer connected to the Internet (via a modem, using a cable, etc.), it may be useful to make the connection accessible to the other computers on...
How to connect two computers with a USB Cable ShowHow to connect two computers with a USB Cable One of the best and fastest ways for connecting two computers is by using a USB-USB cable. This process allows you to transfer files from one computer to another and share internet connection. The...
LAN, Internet connection: choosing your router ShowLAN,Internet connection:Choosing your Router Intro Case 1 Case 2 Case 3 Options and features to consider Standards required for a WiFi router New Standards Intro A router comes in the shape of a box connected to your computer....
IPhone: Configuring the Internet connection ShowiPhone: Configuring the Internet connection Configuring the internet connection of an iPhone Open your iPhone menu and click on "Settings"> "General"> "Network" (or "Edge" for early versions) Click on "Cellular Network...
Sharing an Internet connection with Jana Server ShowAdvantagesIf you have a LAN (two or more computers connected in a network, i.e., each has a network card), of which one is connected to the Internet (via a modem, cable, etc.), it may be worthwhile to make the Internet accessible to the other...
Sharing an Internet connection ShowAdvantagesIf you have a LAN (two computers or more connected in a network), of which one is connected to the Internet (via a DSL modem, cable, etc.), it may be worthwhile to make the Internet accessible to the other computers on the LAN by installing...