CentOS6.2 配置IP地址、网关和DNS

命令:vim /etc/sysconfig/network-scripts/ifcfg-eth0

编辑内容:

DEVICE="eth0"

NM_CONTROLLED="yes"#额外的网管软件,鸟哥建议取消该项目

ONBOOT=yes

HWADDR=08:00:27:BA:F4:0B

TYPE=Ethernet

BOOTPROTO=static#static静态IPdhcp动态获取

IPADDR=xxx.xxx.xxx.xxx

NETMASK=255.255.255.0

GATEWAY=xxx.xxx.xxx.xxx

DNS1=xxx.xxx.xxx.xxx

DNS2=xxx..xxx.xxx.xxx

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"

UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03


你可能感兴趣的:(linux,IP,dns)