Centos7 virtual machine can not solve the access problem

 

Check local connection under Windows Settings, open the "Command Prompt", enter the command ipconfig / all

Here, you have to write down the IP and DNS configuration, such as My IP is 192.168.43.xx, DNS configuration is 192.168.xx.1

 

Open VMWare, open the menu "Edit" -> "Virtual Network Editor."

 

 

 

In the "Virtual Network Editor", select "VMnet8", has generated a good default subnet IP subnets and hidden codes. As long as not a network segment with the host's IP address, subnet IP settings to anything.

Click "NAT setting (s) ...

 

 

In the open "NAT settings", note the gateway IP: 192.168.24.2, the gateway IP configuration in the CentOS will be used.

Below and then click "DNS Settings (D) ..."

 

 

In the "Domain Name Server" interface, to remove the "DNS server automatically detects available", then the DNS server in the DNS configuration locally attached input obtained in the first step.

 

 

 

Then set the specified virtual machine, right-click on the specific virtual machine, select "Settings ..."

PS: Ensure that the virtual machine has stopped, otherwise you will find that you can not modify its settings

 

 

In the "Virtual Machine Settings", modify "network adapter" network connection.

Check the "Custom (U): a particular virtual network" and select "VMnet8 (NAT Mode)"

When finished, start the virtual machine

 

 

After entering CentOS 7.x, open the terminal, enter vi / etc / sysconfig / network-scripts / ifcfg-ens33

 

Then edit ifcfg-ens33

 

PS: If your users do not have administrative privileges, the first switch to the root account under the edit ifcfg-ens33

BOOTPROTO in turn modify the value of static, expressed using a static IP

ONBOOT modify the value yes, indicate boot NIC

 

 

After saving the configuration, reboot the network card configuration to take effect

$ systemctl restart network

Then enter valid test network ping www.baidu.com

$ ping www.baidu.com

 

Guess you like

Origin www.cnblogs.com/zqm0306/p/12523187.html