VirtualBox used in CentOS6.5 arranged in a bridge network environment

1, Environment Description

  virtualBox + CentOS6.5, just installed, network configuration has not been

2, the network configuration and status check

Enter the command to view the virtual machine network configuration

ifconfig 

Below, the ON state not belonging to the network

 Use vi editor network configuration

vi /etc/sysconfig/network-scripts/ifcfg-xxxxxx

How xxx determined?

ls  /etc/sysconfig/network-scripts/

 

Red box on the map, usually the first file is your network configuration file

edit

vi /etc/sysconfig/network-scripts/ifcfg-eth0

 

Initial network configuration is as follows:

 

Check the host, in general, that is, your computer
cmd to open a command window, type ipconfig to see the network configuration of your host

I use wifi at this time is, so is the view wireless configuration, check the network being used according to their own circumstances

 

 

Return to the virtual machine, continue to edit the network configuration file

vi /etc/sysconfig/network-scripts/ifcfg-eth0

 

 Add the following configuration

 

 Parameter Description:

ONBOOT: whether to boot from Kai 

BOOTPROTO: understood as the way to select the address, and can be set to static, otherwise it will be very easy to operate constantly changing

IPADDR: Your custom virtual machine IP address, network segment, that is, the top three, 192.168.0 maintain your network card in the same network segment, and can be set 0-255, but in general has a special 0,1,255 meaning, do not set. Sometimes you no other configuration issues occur, but is unable to connect to change server, such as the use xshell, then you can try another ip, such as changing from 100-110

GATEWAY: Gateway to keep yourself and your machine has been on it

NETMASK: Generally it can be set to 255.255.255.0

DNS: If you have a dedicated DNS resolution addresses, please give priority to use that address, or using your favorite Google DNS resolution, 8.8.8.8 or domestic commonly used DNS resolution 114.114.114.114

3、virtualBox的网络配置(桥接方式)

在虚拟机的设置里,修改网络部分配置

 

 4、重启网络

service network restart

 

5、以ping的方式尝试访问外网

 

 

 

 

Guess you like

Origin www.cnblogs.com/karbon/p/11973526.html