5 Changes to the VM network configuration

After adding the second NIC to the VM, you need to inform the operating system about the new NIC and how it should be used.

Unless you choose one of the VMs in the virtual network to be a DHCP server, it is best to use static IPs for the VMs in the virtual network. Add the following lines to /etc/network/interfaces:

allow-hotplug eth1 # our new interface  
iface eth1 inet static  
        address 192.168.1.1 # use a different addr for each VM  
        netmask 255.255.255.0 # subnet mask for the virtual network  
  

This makes the operating system aware that the new interface eth1 should use the static IP address of 192.168.1.1. Remember to use a different static IP address for each VM in a virtual network.

After saving this change, you can activate the new interface without reboot using the following command:

ifup eth1