4、在目录/etc/sysconfig/network-scripts下配置网卡文件ifcfg-eth1文件:
[root@localhost network-scripts]# touch ifcfg-eth1
在文件中输入:
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.31.101
NETMASK=255.255.255.0
ONBOOT=yes
保存文件后,重新启动网络服务:
[root@localhost network-scripts]# service network restart
5、验证网络IP配置的成功与否:
[root@localhost network-scripts]# ifconfig -a
显示结果:
eth0 Link encap:Ethernet HWaddr 00:0C:29:E6:68:51
inet addr:192.168.31.132 Bcast:192.168.31.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee6:6851/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98 errors:0 dropped:0 overruns:0 frame:0
TX packets:119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21284 (20.7 KiB) TX bytes:15269 (14.9 KiB)
Interrupt:19 Base address:0x2024
eth1 Link encap:Ethernet HWaddr 00:0C:29:E6:68:5B
inet addr:192.168.31.101 Bcast:192.168.31.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1761 (1.7 KiB) TX bytes:0 (0.0 b)
Interrupt:19 Base address:0x20a4
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:960 (960.0 b) TX bytes:960 (960.0 b)
如果出现eth1的网卡IP等信息,就说明配置成功,否则配置失败。
更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

