Home > Open Source > This is quite easy to be set up. However I keep fo…

This is quite easy to be set up. However I keep fo…

This is quite easy to be set up. However I keep forget it again and again so I decide to put it here

All we need is to be familiar with brctl command and /etc/network/interfaces file
Edit /etc/network/interfaces

1) Add bridge IP address (if you want static IP)
auto br0
iface br0 inet static
address 10.20.20.1
netmask 255.255.255.02) Add pre configuration to create bridge device from network interfaces
pre-up ifconfig eth0 0.0.0.0 up
pre-up ifconfig eth1 0.0.0.0 up
pre-up ifconfig eth2 0.0.0.0 up
pre-up brctl addbr br0
pre-up brctl addif br0 eth0 eth1 eth2

3) Add post configuration to delete brigde after we want to bring down NICs (not necessarily)
post-down brctl delif br0 eth0 eth1 eth2
post-down brctl delbr br0

As a result your Interfaces configuration file will be something like this (the read part)

— snipped —
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0auto eth3
iface eth3 inet static
address 10.30.30.3
netmask 255.255.255.0

auto ath0
iface ath0 inet dhcp
wireless-essid PutraFlex

auto br0
iface br0 inet static
address 10.20.20.1
netmask 255.255.255.0
pre-up ifconfig eth0 0.0.0.0 promisc up
pre-up ifconfig eth1 0.0.0.0 promisc up
pre-up ifconfig eth2 0.0.0.0 promisc up
pre-up brctl addbr br0
pre-up brctl addif br0 eth0 eth1 eth2
pre-down brctl delif br0 eth0 eth1 eth2
pre-down brctl delbr br0
— snipped —

We need to restart the network service to make the configuration take effect.
# /etc/init.d/networking restart

Categories: Open Source
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: