您的位置:首页 > 运维架构 > Linux

SUSE Linux Enterprise Server 11 sp4 (x86_64)绑定双网卡

2018-08-02 16:56 232 查看

环境
SUSE Linux Enterprise Server 11 sp4
Linux x86_64 x86_64 x86_64 GNU/Linux

配置(/etc/sysconfig/network)
ifcfg-eth0:

DEVICE='eth0'
STARTMODE='auto'
BOOTPROTO='static'
MASTER='bond0'
SLAVE='yes'

ifcfg-eth1:

DEVICE='eth1'
STARTMODE='auto'
BOOTPROTO='static'
MASTER='bond0'
SLAVE='yes'

ifcfg-bond0:

BONDING_MASTER='yes'
BONDING_MODULE_OPTS='mode=1 miimon=100 fail_over_mac=1'
BOOTPROTO='static'
IPADDR='168.192.10.100/24'
STARTMODE='auto'
USERCONTROL='no'
BONDING_SLAVE0='eth0'
BONDING_SLAVE1='eth1'

#没有ifcfg-bond0该文件时创建该文件,mode=1 热备模式(active-backup),vmware workstation 11 我的不支持第一种获取mac地址的方式,那么你可以使用fail_mac_over=1参数。当然了,在真实服务器环境中就可以不用这么做。

修改bonding配置
vi /etc/modprobe.d/bonding.conf
alias bond0 bonding

加载模块到内核中

modprobe bonding
service network restart
#insmod 一般是需要在一定规范的路径,而且不会按依赖顺序模块加载,而modprobe,不同,它可以在任意路径下,自动把需要依赖模块以及bonding加载到内核中。

查看bonding 状态

`cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
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
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 00:0c:29:fb:3f:ab
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 00:0c:29:fb:3f:b5
Slave queue ID: 0``

bond0当前在使用的网卡是 eth0

**其它linux环境**

在Redhat6.5 类似操作,绑定双网卡做热备成功

ifcfg-bond0

DEVICE=bond0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=168.192.10.12
NETMASK=255.255.255.0
GATEWAY=168.192.10.1
USERCTL=no
BONDING_OPTS="mode=1 miimon=200 fail_over_mac=1"

ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
USRCTL=no
MASTER=bond0
SLAVE=yes

ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
USRCTL=no
MASTER=bond0
SLAVE=yes

**注意:Redhat 6 bond 配置修改路径**
vi /etc/modprobe.d/dist.conf
alias bond0 bonding

取消配置说明
删除/etc/sysconfig/network-scripts/ifcfg-bond0文件,
恢复/etc/sysconfig/network-scripts/ifcfg-eth0和ifcfg-eth1网卡配置文件,删 除/etc/modprobe.d/bonding.conf文件。
rmmod bonding (一定要做这一步)
重启网络服务,如果没有删除绑定网卡,就重启操作系统。
service network restart
reboot
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  bond0 绑定 双网卡