Making bridge between network interfaces in linux |
To make bridge between network interfaces there is bridge-utils package. Just emerge apt-get or download form http://bridge.sourceforge.net and you will have brctl utility. If you need to have two or more interfaces with one ip (similiar to hardware switch) you will need to use brctl. For example you have eth0 and eth1 interfaces:
Make sure they have no ip's:
# ifconfig eth0 0.0.0.0
# ifconfig eth1 0.0.0.0
Then create bridge:
# brctl addbr mybridge
mybridge is your preferred bridge name.
Add interfaces to created bridge:
# brctl addif mybridge eth0
# brctl addif mybridge eth1
Now set ip and netmask to bridge:
# ifconfig mybridge 192.168.0.1 netmask 255.255.255.0
192.168.0.1 is your preferred ip and 255.255.255.0 is netmask.
Thats it. Now mybridge acts as ethernet device (ifconfig -a).




