Home >Operation and Maintenance >CentOS >How to connect virtual machine centos to the Internet
How to connect virtual machine centos to the Internet? How to access the Internet with a CentOS7 virtual machine
Edit the virtual machine settings, select the NAT address translation method for the network adapter mode
Open the VMware menu, edit -Virtual network editor, in the pop-up dialog box, click NAT settings, write down the subnet IP, subnet mask, gateway address information
cd /etc/sysconfig/network-scriptsThe command to display the files in the current folder is as follows
lsThe first ifcfg-ens33 is the CentOS7 network configuration to be edited File, the specific file name may be different, the prefix is ifcfg-ens
vi ifcfg-ens33as shown in the figure below. Note that you need to change it based on the information you see in the second step. IPADDR must be in the subnet. The gateway and subnet mask are the same as in the second step. In addition, you need to configure DNS, etc. Finally, save and exit.
service network restart
ping www.baidu.com
https://www .php.cn/course/list/33.html
The above is the detailed content of How to connect virtual machine centos to the Internet. For more information, please follow other related articles on the PHP Chinese website!