centos7改静态ip

  sre

vim /etc/sysconfig/network-scripts/ifcfg-ens192


TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no #BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens192 DEVICE=ens192 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.2.81 NETMASK=255.255.255.0 GATEWAY=192.168.2.1

vim /etc/sysconfig/network

NETWORKING=yes
GATEWAY=192.168.2.1
DNS1=114.114.114.114
DNS2=8.8.8.8

LEAVE A COMMENT

Captcha Code