centos6 配置静态IP

首先接入网络

然后打开终端  vi /etc/sysconfig/network-scripts/ifcfg-eth0(网卡名字)

修改配置:

ONBOOT=yes

BOOTPROTO=static

IPDDR=10.0....

GATEWAY=10.0.1.1

NETMASK=255.255.255.0

退出保存

重启网络服务:service network restart

或者/etc/init.d/network restart

 

 

配置DNS: vi /etc/resolv.conf

nameserver 222.222.222.222

iptables -L

iptables -F

service iptables save

 

posted @ 2018-04-12 18:14  Mr-Lee-long  阅读(472)  评论(0编辑  收藏  举报