CentOS 7 网络配置方法
[root@zookeeper network-scripts]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
输入以下文本:
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
DNS1=202.106.0.20
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=5512f9e4-2fb7-43b5-a24d-eabc126b274c
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.5.56
PREFIX=32
GATEWAY=192.168.5.1
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
:wq! 保存退出
[root@zookeeper network-scripts]# service network restart