Home>Article>Operation and Maintenance> 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
##Enter the CentOS7 virtual machine in VMware, and the command to enter the directory is as follows: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 To edit the file, the command is as follows
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. The next command to restart the network service is as follows:
service network restartTry to ping the Baidu server again and it will be normal. The command is as follows
ping www.baidu.comRecommended video tutorial for learning Linux:
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!