sclaggett

Configuring an Ubuntu 10.04 VM with Two Network Interfaces in VMWare Workstation 9

Virtual machines generally have their networking configured one of two ways: either (1) with a bridged network adaptor that makes the VM accessible to other systems on the local network, or (2) with a NATed network adaptor that allows the VM to reach systems on a remote network through a VPN tunnel established by the host. Configuring a VM to be both accessible on the local network and able to use the host VPN requires setting up two network interfaces, a primary bridged adaptor that handles most network traffic and a secondary NATed adaptor that passes only traffic destined for the VPN. The process for setting up such a VM on Ubuntu 10.04 is described here. Note that in some cases establishing the VPN connection from within the VM itself may be a more straightforward solution. The network that is being configured is shown in Figure 1.

Figure 1
Figure 1. The Ubuntu 10.04 VM is both accessible on the local network and is able to use the host's VPN connection.

  1. Start by setting up the VM with a single network adaptor that is bridged. This network interface will enable any system on the local network to reach the VM:

Figure 2

  1. Ubuntu has automatically assigns the network interface a name when it boots, in this case Auto eth4:

Figure 3

  1. Disconnect the network interface:

Figure 4

  1. Go to Edit Connections:

Figure 5

  1. Select the network interface and click Edit...:

Figure 6

  1. Change the connection name to "Bridged":

Figure 7

  1. Configure a static IP address on the bridged network. Click on the IPv4 Settings tab, change the Method to "Manual" and add a static address (Address = 10.4.4.5, Netmask = 255.255.255.0, Gateway = 10.4.4.1):

Figure 8

  1. Apply and close the Network Connections dialog.
  2. Select the Bridged network to reconnect:

Figure 9

  1. The VM can now be reached from another computer on the local network (ping 10.4.4.5). Note that the VM can ping the outside world by IP (ping 74.125.239.18) but cannot resolve names (ping www.google.com).
  2. Shut down the VM and add a second network interface that is NATed:

Figure 10

  1. Ubuntu automatically assigns the new network interface a name on boot, in this case Auto eth5:

Figure 11

  1. View the connection information and make a note of the NATed connection’s primary DNS, in this case 192.168.50.2:

Figure 12

  1. Disconnect the new network interface, edit the connection and change the name to "NAT":

Figure 13

  1. Go to the IPv4 settings again but this time leave the connection method as it is. Click on Route and add a new route that funnels just the VPN traffic to the primary DNS of the NATed network adaptor (192.168.50.2). Make sure to select "Use this connection only for resources on its network":

Figure 14

  1. Apply and close the Network Connections dialog.
  2. Select the NAT network to reconnect:

Figure 15

  1. The following should now work:
    • Ping remote systems over the VPN by IP (ping 172.17.110.8).
    • Resolve names of remote systems over the VPN (ping mysrv).
    • Resolve names of servers on the internet and reach them (ping www.google.com).
    • Ping the VM from other computers on the local network (ping 10.4.4.5).