First talk about two kinds of connection mode virtual machine
NAT mode and bridge mode.
Direct use of the vernacular, so as not to be puzzled
Bridge mode is that you can directly connect to the network current physical host, but you need the current set ip address and physical host in the same network segment
NAT mode is that you can set up the virtual machine and the gateway ip address so a series of content, then you can assign ip address of another segment to you directly through the DHCP function, although you are not the same network segment and the host, but the virtual machine has a routing function, when you access the Internet will automatically convert your ip so you can access the Internet
First try to connect to external networks NAT mode
1. First, the network adapter is set to NAT
2. Click -> Edit -> Virtual Network Editor -> lower right corner to change the settings -> VMnet8 to the following
3. Click the NAT settings would read as follows
4. Configure good above must go to take a look at the network connection ip address VMnet8 species is not and you set the same, if not the same modify this ip address.
5. You can then open the virtual machine, enter the command line static address configuration of the virtual machine and modify the host name
cd /etc/sysconfig/network-scripts/
sudo vim ifcfg-eth0
Modify the contents of the following
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
NAME="eth0"
IPADDR=192.168.1.99
PREFIX=24
GATEWAY=192.168.1.2
DNS1=192.168.1.2
Modify the host name
vim /etc/sysconfig/network
Modifications are as follows
NETWORKING=yes
HOSTNAME=yunwei100
Enter the following commands to restart the virtual machine 5. Command Line
reboot
Then win the command line
in a virtual models to test whether you can connect outside the network
if there is no ping through carefully check whether the above steps did the right thing.
Then try to connect to external networks bridge mode
It will be set before turning on the virtual machine as a bridge
and then the fifth step replaced by the following content types, and then something set ip address, subnet mask and gateway deleted directly, you can use dhcp ip automatically set for a virtual machine
BOOTPROTO=auto
Then in the virtual machine can test
ping www.baidu,com
Currently not tried bridging set a static ip, you can try.