Contents

Setting Up a Second Bridged Network Interface on a Linux Host

If you have two physical Ethernet adapters installed on your host computer, connected to two different networks, you may want your virtual machines on that host computer to bridge to both Ethernet adapters so the virtual machines can access either or both physical networks.

To set up a virtual machine to bridge to a second physical Ethernet adapter, you need to add a second call to vmnet-bridge for the second adapter. This is done in the /etc/rc.d/init.d/vmware script.

In the following example, a bridge to the first Ethernet adapter is set up on eth0 for a virtual machine. In the example, a bridge is added to the second Ethernet adapter on eth1.

To add a second bridged network interface on a Linux host:

  1. Stop the VMware ESX Server services using the following command in a shell window:
    /etc/rc.d/init.d/vmware stop

  2. Open the /etc/rc.d/init.d/vmware script in a text editor and look for the following line:
    cd "$vmware_bin_dir" && "$vmware_bin_dir"/"$bridge" -d /var/run/"$bridge"-"$vHubNr".pid /dev/vmnet"$vHubNr" "$pHostIf"

  3. After this, add the following, all on one line, to the /etc/rc.d/init.d/vmware script. This allows your virtual machines to connect to the second Ethernet adapter via bridged networking:
    cd "$vmware_bin_dir" && "$vmware_bin_dir"/"$bridge" -d /var/run/"$bridge"-2.pid /dev/vmnet2 eth1

    Note: VMnet2 is used in this configuration because VMnet1 is reserved for host-only network connections.

  4. Start the VMware ESX Server services using the following command in a shell window:
    /etc/rc.d/init.d/vmware start

  5. In a shell window, execute the following command:
    ps auwx

    You should see two lines similar to the following:
    root 711 0.0 0.1 1024 308 ? S Sep25 0:00 /usr/bin/vmnet-bridge -- d /var/run/vmnet-bridge-0.pid /dev/vmnet0 eth0
    root 712 0.0 0.1 1024 308 ? S Sep25 0:00 /usr/bin/vmnet-bridge -- d /var/run/vmnet-bridge-2.pid /dev/vmnet2 eth1

    Note: The first line refers to the first Ethernet adapter and the second line to the second Ethernet adapter.

  6. You can now connect each virtual machine to either or both Ethernet adapters.
  7. For each virtual machine, run the Configuration Editor (select Settings > Configuration Editor).
  8. Configure a virtual Ethernet adapter to use bridged networking to the physical adapter eth0.
  9. Configure a virtual Ethernet adapter to use custom networking to the vmnet2 adapter. This ensures that the second Ethernet adapter bridges to the physical adapter eth1.
  10. Save and close the configuration.

Related links:

Back to top

© 2001-2002 VMware, Inc. All rights reserved.