Network bridge

What is a network bridge?

A network bridge is a networking device in a network that is used to connect multiple LANs to a larger LAN.

Creating a virtual network bridge

In this setup, we discuss how we can connect 2 interfaces:

Verify the bridge configuration

Remove master configuration

Create virtual network bridge between 2 host-only VM interfaces

Suppose we want to create a network bridge (on a host OS) to bridge 2 host-only networks (from both VirtualBox and VMware). The method above of simply making the bridge interface the master of the 2 host-only interfaces will not work, since the host-only interfaces are fundamentally isolated, and the layer 2 packets (which the network bridge depends upon) will not leave the respective host-only interfaces.

Reading references

(1) Routing & forwarding configurations

In this setup, we will have the host OS act as a router, to perform routing based on the IP address of each guest VM. Suppose we have the following configurations:

  1. Guest VM 1

  • VirtualBox

  • Interface on the host OS (vboxnet0): 10.10.10.1

  • IP (eth0): 10.10.10.10

  1. Guest VM 2

  • VMware

  • Interface on the host OS (vmnet1): 12.12.12.1

  • IP (eth1): 12.12.12.12

  1. Host OS

  • Linux, eg. Ubuntu

  • Configured network interfaces: vboxnet0 (10.10.10.1) and vmnet1 (12.12.12.1)

Important note

The network interface names: eth1 and eth1 given to each of the guest VMs simply refers to the local interface. The guest VMs can have the same interface name, without affecting the overall configuration— as it does NOT refer to the same network.

Configuration steps

Guest VM

For the sake of simplicity, let's assume that DHCP is disabled on each of the guest VM. Thus, we have to configure the static IP on the interface manually, followed by adding the appropriate routes:

Perform the same series of steps for guest VM 2 with the commands above — replacing the network address appropriately.

Host OS

Further notes (PENDING TESTING AND REFINMENT)

  1. Ping to gateway (eg. 10.10.10.1) without adding static route

  2. Ping to the gateway interface address of the other VM

  • after adding local static route, but without enabling IP forwarding (routing) on host OS

  • should succeed

  1. Ping to address of the other VM

  • after adding local static route, but without enabling IP forwarding (routing) on host OS

  • should NOT succeed, unless IP forwarding is enabled

...

(2) TAP interface (with bridging from host OS)

...

Last updated