My computer is the WINDOWS10 operating system, installed on the above virtual machine version 12, using the centos6.8 version of the image file installation. Note that you must use the root user to have permission to modify the contents of the file.
1 CentOS installed in VMware, the default cannot connect to the network, click the red flag to access the browser:
2 Setting up the network
first click on the virtual machine edit-"then click on the Virtual network editor, select VMnet8, click on the" NAT "setting. View the gateway address.
Then modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file (remember the backup, and the IP configuration of Windows corresponds), when I test many times I found that the gateway must be one by one corresponding,
IP addresses may not necessarily have to be one by one for a network segment, but for accuracy or one by one to correspond. You can also test your own play. The contents of the configuration file are as follows:
nic name Device=eth0# restart effective Onboot=yes# is set to static Ipbootproto=static#ip地址IPADDR =10.23. 57.227 #子网掩码NETMASK=255.255. 255.0 #网关GATEWAY =10.23.57.2 #DNS1DNS1=8.8. 8.8 #DNS2DNS2=4.4. 4.4
Note that the gateway here must correspond to one by one at the net settings.
last use Use the command: Service network restart or/etc/init.d/network restart to perform a networking restart. Access the network again. can be successfully accessed.
I myself in the company test when connected to the wired network, the configuration is successfully accessible, back to the place where the wireless network can also be normal access, because the wireless network settings automatically get the IP address.
Linux Network configuration