如何熟悉双网卡的聚合技术?

Linux基础

1 前言

一个问题,一篇文章,一出故事。
笔者生产中的服务器经常用到双网卡绑定技术,由于内网交换机的影响,经常会使用备份模式的绑定技术。

2 最佳实践

2.1 比较早期的配置方法

nmcli connection add type bond con-name bond0 ifname bond0 mode 1
nmcli connection add type bond-slave ifname enp5s0f0 master bond0
nmcli connection add type bond-slave ifname enp5s0f1 master bond0
nmcli connection modify bond0 ipv4.addresses '10.168.0.25/24'
nmcli connection modify bond0 ipv4.gateway '10.168.0.1'
nmcli connection modify bond0 ipv4.dns "8.8.8.8 8.8.4.4"
nmcli connection modify bond0 ipv4.method manual
nmcli connection up bond0

2.2 比较新的配置方法

nmcli connection add ifname team0 con-name team0 type team
nmcli connection modify team0 team.config '{"runner":{"name":"activebackup"}}'
nmcli device
nmcli connection add ifname eth1 con-name team0-eth1 type team-slave master team0
nmcli connection add ifname eth2 con-name team0-eth2 type team-slave master team0
nmcli connection modify team0 ipv4.addresses "10.168.0.25/24"
nmcli connection modify team0 ipv4.gateway "10.168.0.1"
nmcli connection modify team0 ipv4.dns "8.8.8.8 8.8.4.4"
nmcli connection modify team0 ipv4.method manual
nmcli connection up team0
nmcli connection up team0-eth1
nmcli connection up team0-eth2
teamdctl team0 state

如果需要了解详细的参数,请使用如下命令,

man teamd.conf
没有评论

发表回复

Cisco
如何Linux USB连接Cisco设备的vty端口?

1 前言 一个问题,一篇文章,一出故事。 笔者家里的机柜扩充设备,端口已经不够用了,因此在淘宝掏了一 …

Linux基础
如何将PV分区转换为QCOW2文件?

1 前言 一个问题,一篇文章,一出故事。 笔者今天想将一个系统分区转换成虚拟机的QCOW2文件,于是 …

Linux基础
如何停止并禁用dnf makecache?

1 前言 一个问题,一篇文章,一出故事。 今天发现阿里云服务器服务停止响应事件,一查发现内存比较低的 …