Žilinská univerzita > Fakulta riadenia a informatiky > Katedra informačných sietí

Creating a network bridge in linux

The creation of network bridge among two PC's networking cards in linux consist from a few following steps:

Prepare your interfaces:

ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up

Create a bridge

brctl addbr br0

Connect network interface cards to the bridge

brctl addif br0 eth0
brctl addif br0 eth1

Turn on IPv4 routing

echo "1" > /proc/sys/net/ipv4/ip_forward

Turn off Spanning Tree protocol

brctl stp off

and finally start the bridge

ifconfig br0 up
Groups: