Centos7 virtual machine set static ip

cd /etc/sysconfig/network-scripts/

vi ifcfg-enp0s3

 

1. Modify the configuration

BOOTPROTO=static

2. New configuration (query information corresponding to the host)

IPADDR=192.168.0.17
GATEWAY=192.168.1.1
NETMASK=255.255.240.0
DNS1=219.141.136.10
DNS2=219.141.140.10
NM_CONTROLLED=no

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325037230&siteId=291194637