首页 > 代码库 > VWMare CentOS 6.5 静态IP设置

VWMare CentOS 6.5 静态IP设置


vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.29.1

vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
#BOOTPROTO="dhcp"

BOOTPROTO="static"
IPADDR=192.168.29.100
NETMASK=255.255.255.0
GATEWAY=192.168.29.1
BROADCAST=192.168.29.255
HWADDR="00:0C:29:38:CB:90"
IPV6INIT="no"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="3237f851-d158-44ca-a811-ce0afa451e52"

DNS1=192.168.29.1


vim /etc/resolv.conf

# Generated by NetworkManager
nameserver 192.168.29.1

[root@localhost network-scripts]# ping www.baidu.com
ping: unknown host www.baidu.com
(我按照网上的步骤一步步的设置,结果还是失败,更可悲的是我还原成DHCP的可是不能上网了,default7#zbphp.com)