网卡bonding绑定

目录

一、概念

1、概述:

二、实验

1、绑定案例:


一、概念

1、概述:

将多个物理网卡进行排列组合,形成逻辑网卡,网卡的高可用

绑定模式
mode0(平衡负载模式):平时两块网卡均工作,且自动备援,但需要在与服务器本地 网卡相连的交换机设备上进行端口聚合来支持绑定技术。
mode1(自动备援模式):平时只有一块网卡工作,在它故障后自动替换为另外的网卡。
mode1(自动备援模式):平时只有一块网卡工作,在它故障后自动替换为另外的网卡。

二、实验

1、绑定案例:


首先服务器准备两块网卡

配置我们的网卡

##编辑ens160
 
vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=none
NAME=ens160
DEVICE=ens160
ONBOOT=yes
MASTER=bond0
SLAVE=yes
 
###编辑ens224
 
vim /etc/sysconfig/network-scripts/ifcfg-ens224
TYPE=Ethernet
BOOTPROTO=none
NAME=ens224
DEVICE=ens224
ONBOOT=yes
MASTER=bond0
SLAVE=yes
 
###编辑bond0,根据自己的情况配置相应的IP、网关、DNS
TYPE=Ethernet
BOOTPROTO=none
NAME=bond0
DEVICE=bond0
ONBOOT=yes
IPADDR=192.168.115.100
PREFIX=24
GATEWAY=192.168.115.150
DNS1=8.8.8.8

#添加bond配置文件
 
vim /etc/modprobe.d/bond.conf
 
#插入
alias bond0 bonding
options bonding mode=6 miimon=200
 
 
 
##关闭网络图形化服务
systemctl stop NetworkManager
 
 
 
###加载模块
insmod /usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/net/bonding/bonding.ko.xz
 
或者 modprobe bonding


重启网卡
systemctl restart network

#添加bond配置文件
 
vim /etc/modprobe.d/bond.conf
 
#插入
alias bond0 bonding
options bonding mode=6 miimon=200
 
 
 
##关闭网络图形化服务
systemctl stop NetworkManager
 
 
 
###加载模块
insmod /usr/lib/modules/3.10.0-1160.el7.x86_64/kernel/drivers/net/bonding/bonding.ko.xz
 
或者 modprobe bonding


重启网卡
systemctl restart network


查看绑定结果

cat /proc/net/bonding/bond0
 
 
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
 
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
 
Slave Interface: ens160
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:3f:e8:9e
Slave queue ID: 0
 
Slave Interface: ens224
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:3f:e8:a8
Slave queue ID: 0
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值