Implementing Linux bridging
Let's create a bridge and then add a TAP device to it. Before we do that, we must make sure the bridge module is loaded into the kernel. Let's get started:
- If it is not loaded, use
modprobe bridge
to load the module:# lsmod | grep bridge
Run the following command to create a bridge called
tester
:# brctl addbr tester
Let's see if the bridge has been created:
# brctl show bridge name bridge id STP enabled interfaces tester 8000.460a80dd627d no
The
# brctl show
command will list all the available bridges on the server, along with some basic information, such as the ID of the bridge, Spanning Tree Protocol (STP) status, and the interfaces attached to it. Here, the tester bridge does not have any interfaces attached to its virtual ports. - A Linux bridge will also be shown as a network device. To see the network details of the bridge tester, use the
ip
command:# ip link show tester 6: tester: <BROADCAST,MULTICAST>mtu 1500 qdiscnoop...