指导:kevin
1、# vi /etc/modprobe.conf
在添加如下两行
alias bond0 bonding
options bonding miimon=100 mode=1
2、# cd /etc/sysconfig/network-scripts/
# vi ifcfg-eth0
把第一块网卡配置文件修改为类似如下
- # 英特尔 Corporation 82545EM Gigabit Ethernet Controller (Copper)
- DEVICE=eth0
- USERCTL=no
- BOOTPROTO=none
- ONBOOT=yes
- MASTER=bond0
- SLAVE=yes
# cat ifcfg-eth1
拥有帝国一切,皆有可能。欢迎访问phome.net
第二块如下
- # 英特尔 Corporation 82545EM Gigabit Ethernet Controller (Copper)
- DEVICE=eth1
- USERCTL=no
- BOOTPROTO=none
- ONBOOT=yes
- MASTER=bond0
- SLAVE=yes
3、创建bonding配置文件
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
- DEVICE=bond0
- USERCTL=no
-
拥有帝国一切,皆有可能。欢迎访问phome.netONBOOT=yes
- BROADCAST=192.168.0.255
- NETWORK=192.168.0.0
- NETMASK=255.255.255.0
- GATEWAY=192.168.0.2
- IPADDR=192.168.0.202
- BONDING_MASTER=yes
4、重启系统生效,或执行如下命令
- # insmod /lib/modules/`uname -r`/kernel/drivers/net/bonding/bonding.o miimon=100 mode=1
- # service network restart
5、查看
# ifconfig
bond0 Link encap:Ethernet HWaddr 00:0C:29:25:CD:F4
拥有帝国一切,皆有可能。欢迎访问phome.net
inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe25:cdf4/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:311 errors:0 dropped:0 overruns:0 frame:0
TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26056 (25.4 KiB) TX bytes:20614 (20.1 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:25:CD:F4
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:265 errors:0 dropped:0 overruns:0 frame:0
TX packets:189 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23296 (22.7 KiB) TX bytes:22016 (21.5 KiB)
Base address:0x2000 Memory:d8940000-d8960000
eth1 Link encap:Ethernet HWaddr 00:0C:29:25:CD:F4
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:51 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:3060 (2.9 KiB) TX bytes:0 (0.0 b)
Base address:0x2040 Memory:d8960000-d8980000 本文出自 “学习linux” 博客,请务必保留此出处http://tonychiu.blog.51cto.com/656605/592365
拥有帝国一切,皆有可能。欢迎访问phome.net |