VirtualBOX Ubuntu14.04 network settings

The best way is to use two network cards, NAT (the virtual machine accesses the Internet, using the 10.0.2.X segment) and host-only (the virtual machine and the host communicate with each other, using the 192.168.56.X segment).



 

Note: You need to shut down the virtual machine before adding the network card of the virtual machine

 


 


 
 


 
 

 


 

 

eth0 does not need to set gateway, setting it will lead to inability to access the external network

 

 

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.56.106
netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp
~                      

 

 

Note that GATEWAY cannot be set, the reason: Linux dual network card default routing problem: After installing the second network card, there is a problem of not being able to access the Internet, using route to find that there is a problem with the default routing

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326913415&siteId=291194637