1,配置DNS
vi /etc/resolv.conf
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
2,配置网关:
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.0.1
3,配置ip地址: (找到自己的ifcfg)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=”eth0″
HWADDR=”00:0C:29:6C:BB:E6″
NM_CONTROLLED=”yes”
ONBOOT=”no”
NETMASK=255.255.255.0
IPADDR=192.168.0.8
GATEWAY=192.168.0.1
BOOTPROTO=static
ONBOOT=yes
PEERDNS=yes
4,重新启动服务:
/etc/init.d/network restart
或使用命令:
service network restart