Configuring a static IP
- lo is the loopback IP, ens33 static IP, there is no need to configure the IP address where we
2. Check the configuration of the virtual machine network card
- Click the top left corner of the virtual machine Edit -> Virtual Machine Network Editor
- Then OK to save
- Enter centos ip addr view your IP information such as First Photo
- sudo vi / etc / sysconfig / network-scripts / ifcfg-ens33 modify this file, which is a read-only file write permission to modify the use of root privileges
- Here add settings at the bottom
IPADDR=192.168.17.120
NETMASK=255.255.255.0
GATEWAY=192.168.17.2
#这里的网关一定要和虚拟机的网关相同才能上网,不然会一直连不了网
DNS1=8.8.8.8
#这里我选的是谷歌的
- Network Service Restart
service network restart
- Test ping www.baidu.com