mode=0 0模式
模式0:平衡轮询(两块网卡都使用)
模式1:主动备份(默认只使用其中一块网卡,另一块是备份,当其中一块坏了,可以切换到另一块)
模式3:广播(通常用的比较少,因为同一数据会发出两份)
绑定后的逻辑网卡命名为bondn,n为编号
rhel 5.x
bond网卡添加驱动支持:
vi /etc/modprobe.conf
最后一行加入如下信息
alias bond0 bonding
修改物理网卡的配置文件
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
创建绑定网卡的配置文件:
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=dhcp
ONBOOT=yes
BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"
重新启动网络:service network restart
测试:
1. 在windows端ping 逻辑网卡的ip
2. 在Linux端查看两个网卡的流量是否在变化:watch -n 1 ifconfig
rhel 6
vi /etc/modprobe.d/dist.conf
最后添加
alias bond0 bonding
options bond0 miimon=100 mode=0 ##具体以施工现场要求为准
修改物理网卡的配置文件
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=52:54:00:42:91:45
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
HWADDR=52:54:00:9a:b8:3b
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
创建绑定网卡的配置文件:
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.100.45 ----要求的ip
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
BONDING_OPTS="mode=0 miimon=100 primary=eth1" ##设置eth1为主通信网口,具体以现场情况为准
测试:
1. 在windows端ping 逻辑网卡的ip
2. 在Linux端查看两个网卡的流量是否在变化:watch -n 1 ifconfig
模式0:平衡轮询(两块网卡都使用)
模式1:主动备份(默认只使用其中一块网卡,另一块是备份,当其中一块坏了,可以切换到另一块)
模式3:广播(通常用的比较少,因为同一数据会发出两份)
绑定后的逻辑网卡命名为bondn,n为编号
rhel 5.x
bond网卡添加驱动支持:
vi /etc/modprobe.conf
最后一行加入如下信息
alias bond0 bonding
修改物理网卡的配置文件
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
创建绑定网卡的配置文件:
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=dhcp
ONBOOT=yes
BONDING_OPTS="mode=4 miimon=100 lacp_rate=1"
重新启动网络:service network restart
测试:
1. 在windows端ping 逻辑网卡的ip
2. 在Linux端查看两个网卡的流量是否在变化:watch -n 1 ifconfig
rhel 6
vi /etc/modprobe.d/dist.conf
最后添加
alias bond0 bonding
options bond0 miimon=100 mode=0 ##具体以施工现场要求为准
修改物理网卡的配置文件
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=52:54:00:42:91:45
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
HWADDR=52:54:00:9a:b8:3b
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no
创建绑定网卡的配置文件:
# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.100.45 ----要求的ip
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
BONDING_OPTS="mode=0 miimon=100 primary=eth1" ##设置eth1为主通信网口,具体以现场情况为准
测试:
1. 在windows端ping 逻辑网卡的ip
2. 在Linux端查看两个网卡的流量是否在变化:watch -n 1 ifconfig