CentOS 7.6网卡绑定mode1

CentOS 7.6网卡绑定mode1

[[email protected] ~]# systemctl stop NetworkManager
[[email protected] ~]# systemctl disable NetworkManager
[[email protected] ~]# lsmod |grep bonding
[[email protected] ~]# modprobe --first-time bonding
[[email protected] ~]# setenforce 0
[[email protected] ~]# getenforce 0

使用bond实现mode1:
[[email protected] ~]# more /etc/modprobe.d/bond.conf
alias bond1 bonding
options bond1 miimon=100 mode=1
[[email protected] ~]#

[[email protected] network-scripts]# more ifcfg-bond1
TYPE=Bond
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond1
IPADDR=192.168.21.200
PREFIX=24
NM_CONTROLLE=no
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
[[email protected] network-scripts]#
[[email protected] network-scripts]# more ifcfg-ens33
TYPE="Ethernet"
BOOTPROTO="none"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
MASTER=bond1
SLAVE=yes
USERCTL=no
[[email protected] network-scripts]#
[[email protected] network-scripts]# more ifcfg-ens36
TYPE="Ethernet"
BOOTPROTO="none"
NAME="ens36"
DEVICE="ens36"
ONBOOT="yes"
MASTER=bond1
SLAVE=yes
USERCTL=no
[[email protected] network-scripts]#

验证:

1.查看bond1状态:
[[email protected] network-scripts]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0c:29:a6:22:fe
Slave queue ID: 0

Slave Interface: ens36
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:a6:22:08
Slave queue ID: 0
[[email protected] network-scripts]#

2.测试,宕掉其中一个接口,看是否切换
[[email protected] network-scripts]# ifdown ens36
[[email protected] network-scripts]# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens33
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens33
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0c:29:a6:22:fe
Slave queue ID: 0
[[email protected] network-scripts]#

3.查看网卡绑定后的速度:
[[email protected] network-scripts]# ethtool bond1
Settings for bond1:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes
[[email protected] network-scripts]#

原文地址:http://blog.51cto.com/huazhixu123/2342950

时间: 2024-08-03 04:17:23

CentOS 7.6网卡绑定mode1的相关文章

记录一次centos的双网卡绑定

准备做kvm的虚拟话,物理机采用双网卡配置,计划将双网卡绑定再配置桥接. 1.在/etc/sysconfig/network-scripts/下创建文件ifcfg-bond0,配置文件: DEVICE=bond0 BOOTPROTO=none ONBOOT=yes NETMASK=255.255.255.0 IPADDR=192.168.2.227 USERCTL=no 2.bond0绑定了两个网卡eth0和eth1,原来的配置需要做部分修改 eth0注释之前的IP和掩码 DEVICE=eth0

CentOS下双网卡绑定

像流媒体传输之类的服务器使用单网卡负载过高,可能造成画面卡顿情况,为缓解网络压力,特进行双网卡绑定. 这里我们将2块1GB的网卡进行绑定,使其带宽达到2GB,从而减少网络拥塞. 1.修改/etc/sysconfig/network-scripts/ifcfg-eth0/1配置文档,内容如下: BOOTPROTO=none  ONBOOT=yes  MASTER=bond0  SLAVE=yes 2.创建一个绑定网络口的配置文档/etc/sysconfig/network-scripts/ifcf

Lnux系统网卡绑定配置详解

一.CentOS 配置网卡绑定(bonding) 1.bonding概述 (1)作用:就是将多块网卡绑定同一IP地址对外提供服务,可以实现高可用或者负载均衡.当然,直接给两块网卡设置同一IP地址是不可能的.通过bonding,虚拟一块网卡对外提供连接,物理网卡的被修改为相同的MAC地址. (2)Bonding的工作模式 1)Mode 0 (balance-rr)轮转(Round-robin)策略:从头到尾顺序的在每一个slave接口上面发送数据包.本模式提供负载均衡和容错的能力 2)Mode 1

Linux下多网卡绑定(bond)

     网卡绑定mode共有七种(0~6) bond0.bond1.bond2.bond3.bond4.bond5.bond6 常用的有三种 mode=0:平衡负载模式,有自动备援,但需要"Switch"支援及设定. mode=1:自动备援模式,其中一条线若断线,其他线路将会自动备援. mode=6:平衡负载模式,有自动备援,不必"Switch"支援及设定. 需要说明的是如果想做成mode 0的负载均衡,仅仅设置这里options bond0 miimon=100

Centos 6.5 64位双网卡绑定

1.环境描述      我的Vmware workstation 10 安装Centos 6.5 64位加上双口的Intel千兆网卡,通过ifconfig -a|grep eth命令看到eth2和eth3两张网卡. 2.双网卡绑定步骤: 2.1 修改/etc/sysconfig/network-scripts/ifcfg-eth2配置文档,修改后的内容如下:    DEVICE=eth2       ONBOOT=yes              #系统启动时自动启用该设备    BOOTPRO

CentOS双网卡绑定bond0

a)拷?并配置vim /etc/sysconfig/network-scripts/ifcfg-bond0配置?件(会自动创建文件) DEVICE=bond0 TYPE=Ethernet ONBOOT=yes BOOTPROTO=static IPADDR=xxx.xxx.xxx.xxx NETMASK=xxx.xxx.xxx.xxx GATEWAY=xxx.xxx.xxx.xxx USERCTL=no b)编辑em1,em2/eth0.eth1?件 vim /etc/sysconfig/net

CentOS多网卡绑定

防伪码:没有相当程度的孤独是不可能有内心的平和. 1.概述 随着技术的发展,四张及以上的千兆以太网卡已经变成了服务器的标配.而在生产环境中,为了保证Linux服务器的网络稳定,会对服务器的多张网卡通过绑定一个IP来实现网卡的热备. 网卡绑定的模式(mode)共有七种(0~6) bond0.bond1.bond2.bond3.bond4.bond5.bond6 其中常用的有三种: mode=0:平衡负载模式,有自动备援,但需要交换机支持. mode=1:active-backup,主-备份策略,自

CentOS 5.x 6.x 网卡绑定(Bonding)脚本

工作中经常要为客户调整网卡绑定,为此制作了此脚本(比较粗糙,请见谅).使用时请查看脚本帮助 bond.sh #!/bin/bash usage() { cat << EOF create by [email protected] usage: $0 options OPTIONS:     -h  Show this message     -i Bonding IP,NETMASK,GATEWAY(optional)     -q Show Bonding Parameter Info   

centos 6.4系统双网卡绑定配置详解

Linux双网卡绑定实现就是使用两块网卡虚拟成为一块网卡(需要交换机支持),这个聚合起来的设备看起来是一个单独的以太网接口设备,通俗点讲就是两块网卡具有相同的IP地址而并行链接聚合成一个逻辑链路工作.本文详细描述下centos 6.4系统双网卡绑定操作步骤操作前需要确定NetworkManager 服务是否已经停止,否则容易报错.#service NetworkManager status显示NetworkManager 已停即可 具体绑定操作:1.在/etc/sysconfig/network