假定将eth0,eth1,eth2,eth3绑定成bond0, 步骤如下:(1) #vi /etc/modprobe.conf, 添加如下2行: alias bond0 bonding options bonding miimon=100 mode=4当mode=0时,交换机相应端口不需要做trunk,但是从节点上ping网关(192.*.*.*)有较大的延时。解决此问题的办法是把mode改成4,同时配置交换机相应端口开启链路聚合并捆绑为trunk。在modprobe.conf文件中,miimon参数用来监测网卡物理连接,建议至少设为100mode参数用来设置绑定模式0 负载均衡(round robin策略)1 active/backup模式,同一时间只有一块网卡使用。2 负载均衡(xor算法)3 广播模式4 802.3ad模式,lagp协议,带宽翻倍。模式不能写错 这里很容易出现不稳定的情况,多半是这里模式选择错了,所以在实施的时候需要小心,把模式确定了,然后在动手。(2)修改/etc/sysconfig/network-scripts/目录下的ifcfg-bond0, ifcfg-eth0, ifcfg-eth1,ifcfg-eth2,ifcfg-eth3. 具体内容如下:
[root@io102 network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@io102 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTE=static
ONBOOT=yes
IPADDR=192.*.*.*
NETMASK=255.255.255.0
USERTCL=no
GATEWAY=192.*.*.*
[root@io102 network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERTCL=no
MASTER=bond0
SLAVE=yes
[root@io102 network-scripts]# cat ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERTCL=no
MASTER=bond0
SLAVE=yes
[root@io102 network-scripts]# cat ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERTCL=no
MASTER=bond0
SLAVE=yes
[root@io102 network-scripts]# cat ifcfg-eth3
DEVICE=eth3
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERTCL=no
MASTER=bond0
SLAVE=yes
Ubuntu 10.4 Server 命令行连接无线网络U盘安装Ubuntu 10.4 Server相关资讯 Linux系统教程 Linux网卡绑定
- Linux系统教程:修复“ImportError (08/17/2015 07:50:43)
- 在 Linux 中用 nmcli 命令绑定多块 (05/05/2015 09:30:10)
- 新电脑+旧系统:教你在不同机器间 (07/04/2013 06:51:32)
| - Linux系统教程:Ubuntu桌面上禁用 (06/07/2015 14:01:48)
- 正在经历变革的 Linux 系统管理员 (08/14/2014 09:49:42)
- Linux系统教程:定制5M的RedHat 5. (05/18/2013 14:49:49)
|
本文评论 查看全部评论 (0)