centos save Internet (bridge mode)

Newly installed centos;

Getting root: su root (enter password);

Network Configuration folder: cd / etc / sysconfig / network-scripts

Open the network configuration file: vi ifcfg-XXX (XXX is the name of your network interface) (lo is the local loopback: 127.0.0.1) ( you can see in advance the name of your network interface using the command ip addr: the figure below )

 

 

ifcfg-XXX below file modification ( button i to enter edit mode key esc + u perform revocation key ):

 

Upon completion of ifcfg-XXX file editor (esc button to exit edit mode to enter the browse mode buttons: + button w + q Enter button to complete the save and exit): service network restart (restart the card, you can ping 8.8.8.8 debugging that, if still can not ping, the display can not access the target host, the host can ping the server (the machine) IP, if also unable to ping please read below)

Execution halt command shut down the system with root privileges;

For VMwareWorkstation configuration, as shown below:

 

 

 

 

 

Tips to view the host name of the NIC:

 

 

 

After completing all the configuration restart centos system;

Console ping www.baidu.com:

 

Configuration summary: centos network configuration file is correct, whether the host and virtual machines can ping the virtual machine network settings are correct; if the host network is included in Internet behavior management, virtual machine IP / MAC binding is not blocked Internet access, you can test using a wireless network connection .

(This manual is only partially applicable, other specific issues should check)

Guess you like

Origin www.cnblogs.com/samclax/p/11595620.html