Linux Networking Bridge

It is often useful to place a Linux system on a specific network cable, to packet sniff or modify the network behaviour. The network setup:

[switch] - ethernet cable - [node]

becomes:

[switch] - ethernet cable - [[Linux Bridge]] - ethernet cable - [node]

The only requirement for the Linux Bridge is two physical network interfaces and root access.

Important: stop Network Manager
/etc/init.d/network-manager stop

As root, setup the bridge with the commands below:

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig eth0 up
ifconfig eth1 up
ifconfig br0 up

-

The Linux Bridge Interface (br0) does not require an IP address, and no configuration changes are required on the network.

Using tcpdump or wireshark on the Linux Bridge (br0), it is possible to monitor all network traffic going to or from the network node. Using tc and iptables network traffic may be manipulated to facilitate testing.