Network Bridging in an Ubuntu desktop/server


Requirement is have two or more network cards on a server that do the same job as a network switch.

1000base switches are more expensive than a few NICs and spare PCI slots (although the bus may not be up to all that traffic). The Desktop is running LTSP so Gigabit Ethernet is a much better experience for the clients.

Summary of hardware

Tower PC with one onboard NIC (1000BaseT) and 2x additional 1000BaseT PCI NICs. The Onboard NIC is the connection to the main network (and internet), and the other two should share the same IP address, (acting like a transparent network switch) and are used for LTSP clients.

some links on bridging
bridge stuff – near end of page
section “4.4.3. Both Wired and Wireless”

Pretty simple really, just install bridge-utils

 aptitude install bridge-utils

added an auto br0 to /etc/network/interfaces

sudo nano /etc/network/interfaces 

Modify the interfaces configuration:


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# In my case eth0 is managed by Ubuntu's network manager so no need
# to give it any other parameters
auto eth0
#iface eth0 inet dhcp

# Don't need to do anything yet with eth1 as the bridge will bring this up
# This is the configuration before the bridge was set up (now commented)
#auto eth1
#iface eth1 inet static    * LTSPServerSetup

#    address
#    netmask
#    network
#    broadcast

# eth2 is the 3rd network card, and the second part of the bridge
# no need to bring this up either - the bridge will do that
#auto eth2

# Here is the bridge configuration.  br0 is the bridge interface (not a physical card)
# it ties together eth1 and eth2 and gives them a static IP address etc
auto br0
iface br0 inet static
	bridge_ports eth1 eth2

Other notes

Don’t forget to restart networking once set up – rebooting not necessary.

sudo /etc/init.d/networking restart

For LTSP, once the interface has changed, LTSP will likely not let a client connect until you recreate the ssh keys. from the LTSP server page:
“If you change the IP data after you have done the initial setup, please run the command:

sudo ltsp-update-sshkeys 

to make the ssh server aware of the change.” This worked for me (the client wouldn’t connect before this change).

If you need to restart the dhcp server for some reason:

sudo /etc/init.d/dhcp3-server restart 

Other if config items for a bridge
Some suggested config options – I haven’t investigated what any of them do…

auto br0
iface br0 inet static
		bridge_ports eth0
		bridge_fd 9
		bridge_hello 2
		bridge_maxage 12
		bridge_stp off

Links to the LTSP notes I used

(although LTSP with Ubuntu 10.10 alternate CD is simple, and solves all the issues I had with LTSP setup 5 years back)

LTSP Server Setup
Thin Client How-To NAT

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment