CentOS6.9 网络设置

Posted on 2017-05-30 22:46  天道酬勤+勤能补拙  阅读(1927)  评论(0编辑  收藏  举报

一、临时设置IP地址

ifconfig eth0 192.168.42.119 broadcast 192.168.42.129 netmask 255.255.255.0

 

二、上述方法只能临时生效,需要永久生效需要配置文件,

配置/etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.42.119

GATEWAY=192.168.42.119

DNS1=114.114.114.114

NETMASK=255.255.255.0

Copyright © 2024 天道酬勤+勤能补拙
Powered by .NET 9.0 on Kubernetes