CentOS8 网卡捆绑,采用team方式LACP模式

本文介绍了如何在Linux系统中使用Teamd和LACP(Link Aggregation Control Protocol)配置网络接口捆绑,以提高网络连接的冗余性和带宽。详细步骤包括安装teamd,查看和配置网卡,创建团队接口,添加 enslaved 网络接口,激活并配置IP地址,以及在交换机上的相应设置。

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

  1. 安装team

dnf -y install teamd

  1. 查看网卡:
    [root@WJ720 network-scripts]# nmcli device
    DEVICE TYPE STATE CONNECTION
    eno1 ethernet 已连接 eno1
    eno3 ethernet 已断开 –
    eno4 ethernet 已断开 –
    eno2 ethernet 不可用 –
    lo loopback 未托管 –

  2. 配置捆绑口,team0,模式采用lacp方式:
    [root@WJ720 network-scripts]# nmcli connection add con-name team0-config ifname team0 type team config ‘{“runner”:{“name”:“lacp”}}’

\注意,上面的config 后面有一个空格的。
// con-name team0-config:配置文件名
// ifname team0:NIC teaming逻辑接口名
//type team:NIC teaming
//’{“runner”:{“name”:“lacp”}}’ :JSON格式,配置模式为LACP

  1. 查看网卡信息
    [root@WJ720 network-scripts]# nmcli connection show
    NAME UUID TYPE DEVICE
    team0-config 19960873-8923-4320-ae6a-b91e683ec769 team team0
    eno1 f4e3228d-96f1-4d39-bd77-c68106a17153 ethernet eno1
    eno2 35752c9e-b485-4b07-bbe7-1aefa86da695 ethernet –
    eno3 4ccadc50-1ae1-4f56-9fc9-68c35cb99d44 ethernet –
    eno4 a2b2d144-9b2a-4f2f-ba7b-ed97dd9aec06 ethernet –

  2. 添加:
    [root@WJ720 network-scripts]# nmcli connection add type team-slave con-name team0-port1 ifname eno1 master team0

连接 “team0-port1” (ca88227f-db9a-40c8-924a-e77e75af9f5e) 已成功添加。

[root@WJ720 network-scripts]# nmcli connection add type team-slave con-name team0-port2 ifname eno2 master team0

连接 “team0-port2” (7d99c421-89ef-42b2-8d26-ff3b662fea13) 已成功添加。

[root@WJ720 network-scripts]# nmcli connection add type team-slave con-name team0-port3 ifname eno3 master team0

连接 “team0-port3” (dfbb5fe4-589d-48bc-98dc-9544f8e37fe4) 已成功添加。

[root@WJ720 network-scripts]# nmcli connection add type team-slave con-name team0-port4 ifname eno4 master team0

连接 “team0-port4” (5394ae3c-6124-4e0b-9690-fb7e17ad0b18) 已成功添加。

  1. 激活网卡:
    [root@WJ720 network-scripts]# nmcli connection up team0-port1
    [root@WJ720 network-scripts]# nmcli connection up team0-port2
    [root@WJ720 network-scripts]# nmcli connection up team0-port3
    [root@WJ720 network-scripts]# nmcli connection up team0-port4

  2. 配置捆绑口的IP地址:
    nmcli connection modify team0-config ipv4.addresses “10.10.8.10/24”
    nmcli connection modify team0-config ipv4.gateway “10.10.8.254”
    nmcli connection modify team0-config ipv4.dns “115.144.122.193”
    nmcli connection modify team0-config ipv4.method manual

  3. 查看:
    [root@WJ720 network-scripts]# teamdctl team0 state view

  4. 交换机配置,以cisco交换机为例:

interface Port-channel9
description To-WenJian-Server-R720
switchport access vlan 8
switchport mode access
load-interval 30
end
S3560G#show running-config interface gigabitEthernet 0/18
Building configuration…

Current configuration : 151 bytes
!
interface GigabitEthernet0/18
description To-WenJianServer-R720
switchport access vlan 8
switchport mode access
channel-group 9 mode active
end

S3560G#show running-config interface gigabitEthernet 0/46
Building configuration…

Current configuration : 151 bytes
!
interface GigabitEthernet0/46
description To-WenJianServer-R720
switchport access vlan 8
switchport mode access
channel-group 9 mode active
end

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值