计算机网络—以太网接口和链路配置

目录

1.拓扑图

2.以太网交换机基础配置

3.配置手动模式的链路聚合

[4.配置静态 LACP 模式的链路聚合](#4.配置静态 LACP 模式的链路聚合)

5.配置文件


1.拓扑图

2.以太网交换机基础配置

华为交换机接口默认开启了自协商功能,需要手动配置S1与 S2上G0/0/9和G0/0/10接口的速率。

首先修改交换机的设备名称,然后查看S1上G0/0/9和G0/0/10接口的详细信息。

复制代码
<Quidway>system-view
[Quidway]sysname S1
[S1]display interface GigabitEthernet 0/0/9

[S1]display interface GigabitEthernet 0/0/1

在修改接口的速率之前应先关闭接口的自协商功能,然后将S1上的G0/0/9 和G0/0/10接口的速率配置为100 Mbit/s。

复制代码
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo negotiation auto
[S1-GigabitEthernet0/0/9]speed 100
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo negotiation auto
[S1-GigabitEthernet0/0/10]speed 100

同样的方法将S2上的G0/0/9和G0/0/10接口的速率配置为100 Mbit/s。

复制代码
<Quidway>system-view
[Quidway]sysname S2
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo negotiation auto
[S2-GigabitEthernet0/0/9]speed 100
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo negotiation auto
[S2-GigabitEthernet0/0/10]speed 100

验证S1上的G0/0/9和G0/0/10接口的速率已配置成功。

复制代码
[S1]display interface GigabitEthernet 0/0/9

显示:

GigabitEthernet0/0/9 current state : UP Line protocol current state : UP

···

Speed : 100, Loopback: NONE Duplex: FULL, Negotiation:DISABLE

复制代码
[S1]display interface GigabitEthernet 0/0/10

显示:

GigabitEthernet0/0/10 current state : UP

Line protocol current state : UP

···

Speed : 100, Loopback: NONE Duplex: FULL, Negotiation: DISABLE

3.配置手动模式的链路聚合

在S1和S2上创建Eth-Trunk 1,然后将G0/0/9和G0/0/10接口加入 Eth-Trunk 1(注意:将接口加入Eth-Trunk前需确认成员接口下没有任何配置)。

复制代码
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]quit
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]eth-trunk 1
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]eth-trunk 1
[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1

验证Eth-Trunk的配置结果。

复制代码
[S1]display eth-trunk 

显示:

Operate status: up

···

GigabitEthernet0/0/9 Up 1

GigabitEthernet0/0/10 Up 1

Operate status: up

···

PortName Status Weight

GigabitEthernet0/0/9 Up 1

GigabitEthernet0/0/10 Up

4.配置静态 LACP 模式的链路聚合

删除S1和S2上的G0/0/9和G0/0/10接口下的配置。

复制代码
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]undo eth-trunk
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]undo eth-trunk
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]undo eth-trunk
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]undo eth-trunk

创建Eth-Trunk 1并配置该Eth-Trunk为静态LACP模式。然后将G0/0/9和 G0/0/10接口加入Eth-Trunk 1。

复制代码
[S1]interface Eth-Trunk 1
[S1-Eth-Trunk1]mode lacp
[S1-Eth-Trunk1]quit
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]eth-trunk 1
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]eth-trunk 1

[S2]interface Eth-Trunk 1
[S2-Eth-Trunk1]mode lacp
[S2-Eth-Trunk1]quit
[S2]interface GigabitEthernet 0/0/9
[S2-GigabitEthernet0/0/9]eth-trunk 1
[S2-GigabitEthernet0/0/9]quit
[S2]interface GigabitEthernet 0/0/10
[S2-GigabitEthernet0/0/10]eth-trunk 1

查看交换机上Eth-Trunk的信息,查看链路是否协商成功。

复制代码
[S1]display eth-trunk

显示:

LAG ID: 1 WorkingMode: LACP

Preempt Delay: Disabled Hash arithmetic: According to SIP-XOR-DIP

System Priority: 32768 System ID: d0d0-4ba6-aab0

Least Active-linknumber: 1 Max Active-linknumber: 8

Operate status: up Number Of Up Port

在S1上配置LACP的系统优先级为100,使其成为LACP主动端。

复制代码
[S1]lacp priority 10

配置接口的优先级确定活动链路。

复制代码
[S1]interface GigabitEthernet 0/0/9
[S1-GigabitEthernet0/0/9]lacp priority 100
[S1-GigabitEthernet0/0/9]quit
[S1]interface GigabitEthernet 0/0/10
[S1-GigabitEthernet0/0/10]lacp priority 100

验证Eth-Trunk的配置结果。

复制代码
[S1]display eth-trunk 1

显示:

System Priority: 100 System ID: d0d0-4ba6-aab0

Least Active-linknumber: 1 Max Active-linknumber: 8

Operate status: up Number Of Up Port In Trunk: 2

···

Operate status: up

5.配置文件

复制代码
[S1]display current-configuration
#
!Software Version V200R008C00SPC500
sysname S1
#
lacp priority 100
#
interface Eth-Trunk1
mode lacp
#
interface GigabitEthernet0/0/9
eth-trunk 1
lacp priority 100
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/10
eth-trunk 1
lacp priority 100
undo negotiation auto
speed 100
#
return
[S2]display current-configuration
#
!Software Version V200R008C00SPC500
sysname S2
#
interface Eth-Trunk1
mode lacp
#
interface GigabitEthernet0/0/9
eth-trunk 1
undo negotiation auto
speed 100
#
interface GigabitEthernet0/0/10
eth-trunk 1
undo negotiation auto
speed 100
#
return
相关推荐
Sagittarius_A*几秒前
H3CSE 高性能园区网:SNMP 网络管理协议详解
网络·计算机网络·安全·h3cse
杨充2 分钟前
1.1 数据编码设计原理
linux·运维·网络·底层原理·数据编码
缪懿31 分钟前
网络层和数据链路层中的常见协议解析
网络·网络协议·java-ee
CoreTK_EMC1 小时前
牙科医疗器械 ESD 静电整改案例|芯通康医疗级方案,护航诊疗安全与合规
网络·学习·emc整改·芯通康
♛识尔如昼♛1 小时前
C 进阶(15) - 网络IPC:套接字
网络·套接字
jscxy52061 小时前
ospf综合实验
运维·服务器·网络
IP搭子来一个1 小时前
爬虫使用代理 IP 频繁失效,该如何定位问题?
网络·爬虫·tcp/ip
csdn_aspnet1 小时前
Modbus TCP C# 客户端程序
服务器·网络·tcp/ip·c#
辣椒思密达1 小时前
住宅IP与机房IP的区别及技术选型指南
网络·网络协议·tcp/ip
小灰灰搞电子1 小时前
Rust 实现异步ModbusTCP主机源码分享
服务器·网络·modbustcp·rust