加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

linux bond配置步骤中的七种bond模式

发布时间:2016-08-07 08:34:30 所属栏目:Linux 来源:站长网
导读:一、网卡绑定: 第一步:创建一个ifcfg-bondX # vi /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BONDING_OPTS=mode=0 miimon=100 BOOTPROTO=none

一、网卡绑定:

第一步:创建一个ifcfg-bondX

# vi /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BONDING_OPTS="mode=0 miimon=100"

BOOTPROTO=none

ONBOOT=yes

BROADCAST=192.168.0.255

IPADDR=192.168.0.180

NETMASK=255.255.255.0

NETWORK=192.168.0.0

USERCTL=no

BONDING_OPTS="mode=0 miimon=100" ,mode有多种模式实现不同的功能,

第二步:修改/etc/sysconfig/network-scripts /ifcfg-ethX

# vi  /etc/sysconfig/network-scripts /ifcfg-eth0

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

USERCTL=no

# vi  /etc/sysconfig/network-scripts /ifcfg-eth1

DEVICE=eth1

BOOTPROTO=none

ONBOOT=yes

MASTER=bond0

SLAVE=yes

USERCTL=no

第三步:配置/etc/modprobe.conf,添加alias bond0 bonding

# vi /etc/modprobe.conf

alias eth0 e1000e

alias eth1 e1000e

alias scsi_hostadapter mptbase

alias scsi_hostadapter1 mptspi

alias bond0 bonding

第四步:重启网络服务

#service network restart

通过查看/proc/net/bonding/bond0,查看当前是用什么mode,如果是主备的话,当前是哪个网卡工作。

# cat/proc/net/bonding/bond0

Ethernet ChannelBonding Driver: v3.0.3 (March 23, 2006)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave:None

Currently Active Slave: eth0

MII Status: up

MII PollingInterval (ms): 100

Up Delay (ms): 0

Down Delay (ms):0

Slave Interface:eth0

MII Status: up

Link FailureCount: 0

Permanent HWaddr: 00:0c:29:01:4f:77

Slave Interface:eth1

MII Status: up

Link FailureCount: 0

Permanent HWaddr: 00:0c:29:01:4f:8b

本栏目更多精彩内容:http://www.bianceng.cn/OS/Linux/

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读