virtualBox centos7 static ip configuration

centos7 network configuration

$ vim /etc/sysconfig/network-scripts/ifcfg-enp0s3

BOOTPROTO=static #static ip

ONBOOT=yes #boot start

 

IPADDR=192.168.2.186 #ip address

NETMASK=255.255.0.0 #Subnet mask

GATEWAY=192.168.1.10 #Gateway

 

dns settings

$ vim /etc/resolv.conf

nameserver 192.168.1.10

nameserver 8.8.8.8

nameserver 8.8.4.4

 

restart the network

$ service network restart

Guess you like

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