Centos7配置静态IP

1、 cd /etc/sysconfig/network-scripts切换到网络配置目录下。
Centos7配置静态IP
2、ls 找到网卡。
Centos7配置静态IP

3、vi ifcfg-ens33 修改对应网卡配置文件。
Centos7配置静态IP
将文件红色方框内信息修改如下。GATEWAY可以用过route -n 命令查看。
Centos7配置静态IP

4、vi /etc/resolv.conf 修改DNS。
Centos7配置静态IP
在文件内添加nameserver 114.114.114.114 。
5、service network restart 重启网络服务。
Centos7配置静态IP
6、ping 测试网络联通状态
Centos7配置静态IP