Linux bonding
2014-02-08 11:26
363 查看
转载
1.新建/etc/sysconfig/network-scripts/ifcfg-bond0文件
DEVICE=bond0
BOOTPROTO=static
BROADCAST=191.3.60.255
IPADDR=191.3.60.1
NETMASK=255.255.255.0
NETWORK=191.3.60.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=191.3.60.254
USERCTL=no
2.更改/etc/sysconfig/network-scripts/ifcfg-eth0网卡属性
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
3.更改/etc/sysconfig/network-scripts/ifcfg-eth1网卡的属性
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
4.编辑/etc/modprobe.conf文件,加入以下内容
alias bond0 bonding
options bond0 miimon=100 mode=1
说明:
mode指定了bond0的工作模式,常用的是0和1,0表示负载均衡方式,1表示主从方式,可根据需要自行配置。常用的为0,1两种。mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。mode=1表示fault-tolerance(active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份。bonding只能提供链路监测,即从主机到交换机的链路是否接通。如果只是交换机对外的链路down掉了,而交换机本身并没有故障,那么bonding会认为链路没有问题而继续使用。miimon是用来进行链路监测的。比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路。
5.加入/etc/rc.d/rc.local启动项
ifenslave bond0 eth0 eth1
6.启动网卡
ifconfig bond0 up
service network restart
7.完成后重启系统,ping 191.3.60.1测试。
说明:cat /proc/net/bonding/bond0可查看bonding状态
Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:4b:ca:06
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:4b:ca:10
1.新建/etc/sysconfig/network-scripts/ifcfg-bond0文件
DEVICE=bond0
BOOTPROTO=static
BROADCAST=191.3.60.255
IPADDR=191.3.60.1
NETMASK=255.255.255.0
NETWORK=191.3.60.0
ONBOOT=yes
TYPE=Ethernet
GATEWAY=191.3.60.254
USERCTL=no
2.更改/etc/sysconfig/network-scripts/ifcfg-eth0网卡属性
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
3.更改/etc/sysconfig/network-scripts/ifcfg-eth1网卡的属性
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
4.编辑/etc/modprobe.conf文件,加入以下内容
alias bond0 bonding
options bond0 miimon=100 mode=1
说明:
mode指定了bond0的工作模式,常用的是0和1,0表示负载均衡方式,1表示主从方式,可根据需要自行配置。常用的为0,1两种。mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。mode=1表示fault-tolerance(active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份。bonding只能提供链路监测,即从主机到交换机的链路是否接通。如果只是交换机对外的链路down掉了,而交换机本身并没有故障,那么bonding会认为链路没有问题而继续使用。miimon是用来进行链路监测的。比如:miimon=100,那么系统每100ms监测一次链路连接状态,如果有一条线路不通就转入另一条线路。
5.加入/etc/rc.d/rc.local启动项
ifenslave bond0 eth0 eth1
6.启动网卡
ifconfig bond0 up
service network restart
7.完成后重启系统,ping 191.3.60.1测试。
说明:cat /proc/net/bonding/bond0可查看bonding状态
Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:4b:ca:06
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:4b:ca:10
相关文章推荐
- linux bonding
- linux 多网卡bonding
- Linux IPBonding网卡冗余安装启动说明书
- linux bonding 详解
- Linux bonding绑定多块网卡
- Linux双网卡绑定实现负载均衡(Bonding双网卡绑定)
- 实战 Linux 双网卡 Bonding 技术
- 系统运维篇之HP-DL580-Linux配置Bonding网卡组实例
- Linux多网卡负载均衡主备bonding技术实践教程
- linux多网卡绑定bonding
- linux bonding配置(一)
- Linux bonding服务器单网卡绑定多IP在Redhat系列
- linux 之 bonding详解
- Ethernet Channel Bonding NIC Teaming on Linux Systems
- linux 双网卡绑定(bonding)实现负载均衡或故障转移
- linux双网卡绑定(bonding)实现
- linux 多网卡bonding 绑定 端口聚合