bond-team

本文详细介绍如何使用命令行配置Bond负载均衡,包括设置bond0模式为balance-rr,添加enp2s0f0和enp2s0f1作为slave接口,并修改相关配置文件。

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

nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name": "roundrobin"}}'
nmcli con modify team0 ipv4.address '192.168.8.10/24' ipv4.gateway '192.168.8.254' ipv4.dns '221.11.1.67'
nmcli con modify team0 ipv4.method manual
nmcli con add type team-slave ifname enp28s0f0 master team0
nmcli con add type team-slave ifname enp28s0f0 master team0
service network restart
teamdctl team0 state


nmcli connection up team-slave-em1
nmcli connection up team-slave-em2

teamnl team0 ports

teamnl team0 options


下面正式开始使用命令来配置bond

nmcli con add type bond ifname bond0 mode balance-rr #(balance-rr负载均衡)

nmcli con add type bond-slave ifname enp2s0f0 master bond0 (enp20f0网卡名字)

nmcli con add type bond-slave ifname enp2s0f1 master bond0(enp2sof1网卡名字)

到此为止bond0已经配置完成
[root@localhost network-scripts]# vim ifcfg-bond-bond0
[root@localhost network-scripts]# /etc/init.d/network restart

 

DEVICE=em1
USERCTL=no
ONBOOT=yes
MASTER=bond0 # 需要和上面的ifcfg-bond0配置文件中的DEVICE的值对应 SLAVE=yes
BOOTPROTO=none

DEVICE=em2
USERCTL=no
ONBOOT=yes
MASTER=bond0 # 与 ifcfg-bond0 配置文件中的DEVICE的值对应 SLAVE=yes
BOOTPROTO=none

 


[root@localhost ~]# cd /etc/sysconfig/network-scripts/

mkdir /tmp/wangka #在/tmp下面创建wangka的目录用户备份网卡配置文件

mv enp2s0f0 enp2s0f1 /tmp/wangka

将enp2s0f0 和 enp2s0f1 移除到 /tmp/wangka目录中,因为使用命令做Bond的时候会重新生成配置文件

下面正式开始使用命令来配置bond

nmcli con add type bond ifname bond0 mode balance-rr #(balance-rr负载均衡)

nmcli con add type bond-slave ifname enp2s0f0 master bond0 (enp20f0网卡名字)

nmcli con add type bond-slave ifname enp2s0f1 master bond0(enp2sof1网卡名字)

到此为止bond0已经配置完成

现在需要配置进入配置文件修改配置文件

[root@localhost network-scripts]# vim ifcfg-bond-bond0

转载于:https://www.cnblogs.com/createyuan/p/10714976.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值