Run centos on vmware and set Nic Information
1. Set the NIC of the vmware Virtual Machine to host-only,
2. view the "Network Connection" currently used by the local machine, properties, select the "advanced" label, set to allow sharing, and set the allowed network interface to vmnet1.
3. let's take a look at your VMnet1 attributes and take a look at the TCP/IP Settings. You can see that it has been automatically set to 192.168.137.1 (this IP address may be different from your own, but remember that this IP address is used as the linux gateway in the Virtual Machine)/255.255.255.0
4. Then in the Virtual Machine linux settings, first is vi/etc/sysconfig/network-scripts/ifcfg-eth0
Note: This file can be displayed by vmware. When you execute the ll command, it cannot be displayed. I directly execute the command.
Settings reference
Modify or add ONBOOT \ BOOTPROTO \ IPADDR \ NETMASK \ GETEWAY.
For the meaning of each field, go to Baidu
5. Configure dns resolution
Echo "nameserver 211.98.1.28 (this IP address is the DNS server address)">/etc/resolv. conf
6. If you have not set the Host Name:
Cd/etc/sysconfig
Vi network
Edit HOSTNAME
Cd/etc
Vi hosts
Join:
192.168.0.2 yourhostname
7. Restart the service
Su
/Sbin/service network restart
8. Check if OK is set.
Ping www.baidu.com