linux配置静态ip

 

编辑

vi /etc/sysconfig/network-scripts/ifcfg-xxx

DEVICE=eth0
HWADDR=00:0C:29:F5:1D:6A
TYPE=Ethernet
UUID=8f49ebc2-5b1b-4135-863b-6acb0c84453f
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static #设置为静态
IPADDR=192.168.179.13 #ip
NETMASK=255.255.255.0
GATEWAY=192.168.179.2#网关
DNS1=192.168.179.2 #配置网关连接外网

#source /etc/sysconfig/network-scripts/ifcfg-xxx

 service network restart  #重新启动

posted @ 2019-01-19 22:48  zhoufly  阅读(21398)  评论(0编辑  收藏  举报