Building a bridge
If you have two separate networks, you may need a way to pass data from one network to the other. This is commonly done by connecting the two subnets with a router, hub, or switch.
A Linux system can be used for a network bridge.
A bridge is a low-level connection that passes packets based on their MAC address instead of being identified by the IP address. As such it requires fewer machine resources and is more efficient.
You can use a bridge to link virtual machines on private, non-routed networks, or to link separate subnets in a company, for instance, to link a manufacturing subnet to the shipping sub-net so production information can be shared.
Getting ready
The Linux kernel has supported network bridges since the 2.2 kernel. The current tool to define a bridge, is the iproute2 (ip
) command. This is standard in most distributions.
How to do it...
The ip command performs several actions using the command/subcommand model. To create a bridge, we use the ip link
commands.