CentOS 6.3初次安装网络配置
1,修改静态网络配置
Java代码
[root@davidserver ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
HWADDR="00:0C:29:99:5A:3C"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="1cb095a6-b832-4dc1-92e1-1a1a7a58abc8"
IPADDR="8.0.0.10"
BROADCAST="8.0.0.255"
NETMASK="255.255.255.0"
NETWORK="8.0.0.0"
GATEWAY="8.0.0.1"
IPV6INIT="no"
IPV6_AUTOCONF="no"
简化配置
Java代码
[root@davidserver ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="8.0.0.11"
BROADCAST="8.0.0.255"
NETMASK="255.255.255.0"
NETWORK="8.0.0.0"
GATEWAY="8.0.0.1"
IPV6INIT="no"
IPV6_AUTOCONF="no"
2,修改DNS服务
Java代码
[root@davidserver ~]# vim/etc/resolv.conf
nameserver 8.0.0.1
3,重启网卡
Java代码
[root@davidserver ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
输出以上信息,代表成功了
or
Java代码
[root@davidserver ~]# ifdown eth0; ifup eth0
www.2cto.com
同样OK
4,双网卡配置
Java代码
[root@davidserver ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
BOOTPROTO="static"
ONBOOT="yes"
TYPE="Ethernet"
IPADDR="192.168.0.10"
BROADCAST="192.168.0.255"
NETMASK="255.255.0.0"
NETWORK="192.168.0.0"
本文转自 lgpqdwjh 51CTO博客,原文链接:http://blog.51cto.com/itchenyi/1011106,如需转载请自行联系原作者