网卡的链路聚合 bond模式和team模式/网桥

本文介绍了网卡的链路聚合技术,包括bond模式下的轮询聚合和主备聚合,以及team模式的使用,强调了它们在提升网络连接稳定性和冗余性上的作用。此外,还提及了网桥的概念,它工作在数据链路层,无需IP配置,用于简化网络连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

网卡的链路聚合

将多块网卡连接起来,有效的防止网卡损坏带来的损失

环境:需配置网卡
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • bond模式(最多支持2块网卡)

轮询聚合(两块网卡同时工作)
主备聚合(一块网卡工作,一块网卡预备)
在这里插入图片描述

 nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.229/24          添加bond聚合接口
    
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0  绑定真实物理网卡

nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0

在这里插入图片描述

nmcli connection show 查看聚合网卡

在这里插入图片描述
在这里插入图片描述

watch -n 1 "cat /proc/net/bonding/bond0"

ifconfig device down/up    开启/关闭网卡

在这里插入图片描述
在这里插入图片描述

nmcli connection delete device 删除设备

在这里插入图片描述

  • team模式(最多支持2块网卡)
nmcli connection add con-name team0 ifname team0 type team config ’{"runner":{"name":"activebackup"}}‘  ip4 172.25.254.229/24     添加team聚合接口

nmcli connection add con-name eth0 ifname eth0 type bond-slave master team0   绑定真实物理网卡

nmcli connection add con-name eth1 ifname eth1 type bond-slave master team0

在这里插入图片描述
在这里插入图片描述

watch -n 1 "teamdctl team0 stat "

在这里插入图片描述
在这里插入图片描述

  • 网桥

(不需要地址转化,也不需要路由器转发,不需要配置网关;不需要IP,工作在数据链路层)

命令添加网桥
添加

brctl addbr br0     添加网桥br0
ifconfig br0 ip/24  网桥添加ip
brctl show          
brctl addif br0 eth0给网桥添加一个真实网卡

在这里插入图片描述
删除

brctl delif br0 eth0 删除搭建上网桥br0的eth0
ifconfig br0 down    关闭网桥
brctl delbr br0      删除网桥

在这里插入图片描述
文本添加网桥

cd /etc/sysconfig/network-scripts
cp ifcfg-eth0 ifcfg-br0
vim ifcfg-eth0  修改物理网卡

在这里插入图片描述

vim ifcfg-br0 创建br0配置文件

在这里插入图片描述

systemctl restart network
ip a

在这里插入图片描述
在这里插入图片描述
删除桥接
rm -rf ifcfg-br0
编辑eth0 恢复物理网卡

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值