Centos configuration process from scratch

Configuring a static IP

  • lo is the loopback IP, ens33 static IP, there is no need to configure the IP address where we
  • Here Insert Picture Description

2. Check the configuration of the virtual machine network card

  • Click the top left corner of the virtual machine Edit -> Virtual Machine Network Editor
    Here Insert Picture DescriptionHere Insert Picture Description
  • 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 Insert Picture Description
  • 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
#这里我选的是谷歌的

Here Insert Picture Description

  • Network Service Restart
service network restart
  • Test ping www.baidu.com
Published 19 original articles · won praise 10 · views 2459

Guess you like

Origin blog.csdn.net/qq_40125653/article/details/103413793