Redhat7配置静态IP地址

1、cd /etc/sysconfig/network-scripts/  进入网卡配置目录

2、ls -l  查看当前目录下的文件。

3、vi ifcfg-eth0 修改网卡配置文件

修改BOOTPROTO=static   默认是BOOTPROTO=dhcp 
修改ONBOOT=yes         默认是ONBOOT=no
最后一行添加
IPADDR=x.x.x.x
NETMASK=x.x.x.x
GATEWAY=x.x.x.x
DNS1=x.x.x.x
4、systemctl restart network    重启网卡

猜你喜欢

转载自blog.csdn.net/anmic123/article/details/84922407