链路聚合详解

链路聚合详解

华为交换机链路聚合:

java 复制代码
方式一:配置手工负载分担方式的链路聚合
[CORE1] interface Eth-Trunk 1
[CORE1-Eth-Trunk1] trunkport GigabitEthernet 0/0/5 to 0/0/6
[CORE1-Eth-Trunk1] port link-type access
[CORE1-Eth-Trunk1] port default vlan 300
[CORE1-Eth-Trunk1] quit
方式二:配置LACP模式的链路聚合
[CORE1] interface Eth-Trunk 1
[CORE1-Eth-Trunk1] mode lacp
[CORE1-Eth-Trunk1] trunkport GigabitEthernet 0/0/5 to 0/0/6
[CORE1-Eth-Trunk1] port link-type access
[CORE1-Eth-Trunk1] port default vlan 300
[CORE1-Eth-Trunk1] quit
# 在CORE1上配置系统优先级为100,使其成为LACP主动端

[CORE1] lacp priority 100
# 在CORE1上配置活动接口上限阈值为2

[CORE1] interface Eth-Trunk 1
[CORE1-Eth-Trunk1] max active-linknumber 2
[CORE1-Eth-Trunk1] quit
# 在CORE1上配置接口优先级确定活动链路(配置GE0/0/5和GE0/0/6为活动链路)

[CORE1] interface GigabitEthernet 0/0/5
[CORE1-GigabitEthernet0/0/5] lacp priority 100
[CORE1-GigabitEthernet0/0/5] quit
[CORE1] interface GigabitEthernet 0/0/6
[CORE1-GigabitEthernet0/0/6] lacp priority 100
[CORE1-GigabitEthernet0/0/6] quit

Linux链路聚合bond

java 复制代码
1、mode=0(balance-rr)(平衡抡循环策略)

2、mode=1(active-backup)(主-备份策略)

3、mode=2(balance-xor)(平衡策略,根据hash策略平衡)

4、mode=3(broadcast)(广播策略,高可靠较浪费资源)

5、mode=4(802.3ad)(IEEE 802.3ad 动态链接聚合)

6、mode=5(balance-tlb)(适配器传输负载均衡)

7、mode=6(balance-alb)(适配器适应性负载均衡)

配置

java 复制代码
cat /etc/sysconfig/network-scripts/ifcfg-p2p1
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
NAME=p2p1
DEVICE=p2p1
ONBOOT=yes
MASTER=bond0
SLAVE=yes

[root@dev2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-p2p2
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
NAME=p2p2
DEVICE=p2p2
ONBOOT=yes
MASTER=bond0
SLAVE=yes

cat /etc/sysconfig/network-scripts/ifcfg-bond0 
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.1.2
PREFIX=24
GATEWAY=192.168.1.254
ONBOOT=yes
DNS1=8.8.8.8
BOOTPROTO=none
BONDING_OPTS="mode=4 miimon=100"

开机自动加载模块到内核
#echo 'alias bond0 bonding' >> /etc/modprobe.d/dist.conf
#echo 'options bonding mode=0 miimon=200' >> /etc/modprobe.d/dist.conf
#echo 'ifenslave bond0 eth0 eth1' >>/etc/rc.local
miimon=100

##查看bond0状态
cat /proc/net/bonding/bond0 
相关推荐
未*望10 小时前
【Linux入坑(二)—全志T133开发板适配USB-电容屏触摸屏驱动(多点触控) 】
linux·运维·服务器
懒鸟一枚10 小时前
为什么 useradd -rs /bin/false service 创建的用户无法用 su 切换?
linux·服务器·数据库
risc12345610 小时前
Lucene80DocValuesConsumer 五种类型源码阅读顺序
java·服务器·前端
爱喝热水的呀哈喽10 小时前
hypermesh两个网格参数解析
服务器·数据库·mysql
分布式存储与RustFS10 小时前
RustFS保姆级教程:Docker快速部署兼容S3的本地对象存储
运维·docker·容器·rustfs部署教程·本地搭建s3对象存储·rustfs网页控制台使用·awscli连接rustfs
江湖有缘10 小时前
Docker部署Papra极简文件归档平台
运维·docker·容器
gooxi_hui10 小时前
海量存力,智驭未来丨国鑫4U60盘位高密度存储服务器SL401-G4重磅上市
运维·服务器·人工智能
吴爃10 小时前
小微企业 SRE 稳定性建设
运维·稳定性·小微企业
开开心心_Every11 小时前
带OCR识别的电子发票打印工具
运维·自动化·ocr·电脑·powerpoint·音视频·lua
小张成长计划..11 小时前
【Linux】7:第一个系统程序-进度条
linux·运维·服务器