【学习笔记】网络设备(华为交换机)基础知识 18 —— 以太网接口基础知识

总结:学习华为交换机以太网接口基础知识:含以太网接口的简介、分类(包括速率分类、工作层级分类、以及电气属性分类)相关基础理论知识;含以太网接口速率(speed、display this interface命令)、接口工作层级(portswitch、undo portswitch、display this interface命令)相关配置命令;以及配置实例(接口非自协商模式下的速率为100Mbit/s配置案例、接口切换为三层模式配置案例、接口切换为二层模式配置案例)

一、基础理论

1、以太网接口的简介

以太网接口:通常指提供给用户操作或配置的真实存在、有器件支持的以太网物理接口,主要用于接收和发送数据

2、以太网接口的分类

2.1 速率分类

根据以太网接口支持的速率,可以分为:FE接口 、GE接口、XGE接口(通常是指10GE接口)、25GE接口、40GE接口、100GE接口

接口类型描述
FE(Fast Ethernet,快速以太网)接口支持的最大速率为100Mbit/s
GE(Gigabit Ethernet,高速以太网)接口支持的最大速率为1000Mbit/s
XGE(10GE)接口支持的最大速率为10000Mbit/s
25GE接口支持的最大速率为25000Mbit/s
40GE接口支持的最大速率为40000Mbit/s
100GE接口支持的最大速率为100000Mbit/s
2.2 工作层级分类

根据工作的层级(处理报文的转发方式),可以分为:二层以太网接口和三层以太网接口

接口类型描述
二层以太网接口工作在数据链路层;只能对接收到的报文进行二层交换转发,也可以加入VLAN,通过VLANIF接口对接收到的报文进行三层路由转发
三层以太网接口工作在网络层;可以配置IP地址,对接收到的报文进行三层路由转发,即可以收发源IP和目的IP处于不同网段的报文
2.3 电气属性分类

根据接口的电气属性,可以分为:电接口和光接口

接口类型描述
电接口使用网线传输数据
光接口使用光纤传输数据

二、配置命令

1、以太网接口速率相关配置命令

1.1 speed

命令:speed 1000 ##指定接口速率为1000Mbit/s

[ZFB-GigabitEthernet0/0/1]speed ?
  10                10M port speed mode
  100               100M port speed mode
  1000              1000M port speed mode
  auto-negotiation  Auto negotiation

[ZFB-GigabitEthernet0/0/1] speed 1000			##指定接口速率为1000Mbit/s

在这里插入图片描述

1.2 display this interface

命令:display this interface ##显示当前接口视图下的接口信息(说明:其中Speed字段代表速率)

[ZFB-GigabitEthernet0/0/1]display this interface 		##显示当前接口视图下的接口信息(说明:其中Speed字段代表速率)
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Description:
Switch Port, PVID :    1, TPID : 8100(Hex), The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccb6-2cf3
Last physical up time   : 2025-01-01 21:49:34 UTC-08:00
Last physical down time : 2025-01-01 21:49:30 UTC-08:00
Current system time: 2025-01-01 21:54:49-08:00

Speed : 1000,  Loopback: NONE 						  ##说明:其中Speed字段代表速率

Hardware address is 4c1f-ccb6-2cf3
    Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
    Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
    Input: 17136 bytes, 144 packets
    Output: 238 bytes, 2 packets
    Input:
      Unicast: 0 packets, Multicast: 144 packets
      Broadcast: 0 packets
    Output:
      Unicast: 0 packets, Multicast: 2 packets
      Broadcast: 0 packets
    Input bandwidth utilization  :    0%
    Output bandwidth utilization :    0%

在这里插入图片描述

2、接口工作层级相关配置命令

2.1 undo portswitch

命令:undo portswitch ##配置接口切换到三层模式

[ZFB-GigabitEthernet0/0/1] undo portswitch				##配置接口切换到三层模式

在这里插入图片描述

2.2 portswitch

命令:portswitch ##配置接口切换到二层模式

[ZFB-GigabitEthernet0/0/1] portswitch				##配置接口切换到二层模式

在这里插入图片描述

2.3 display this interface

命令:display this interface ##显示当前接口视图下的接口信息(说明:其中Route Port代表三层模式、Switch Port字段表示接口是二层接口)

##三层
[ZFB-GigabitEthernet0/0/1]dis this interface 
GigabitEthernet0/0/1 current state : UP
Line protocol current state : DOWN
Description:

Route Port,The Maximum Frame Length is 9216

Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccb6-81ff
Last physical up time   : 2025-01-01 22:03:11 UTC-08:00
Last physical down time : 2025-01-01 22:03:09 UTC-08:00
Current system time: 2025-01-01 22:03:15-08:00



##二层
[ZFB-GigabitEthernet0/0/1]display this interface 
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Description:

Switch Port, PVID :    1, TPID : 8100(Hex), The Maximum Frame Length is 9216

Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccb6-2cf3
Last physical up time   : 2025-01-01 22:08:17 UTC-08:00
Last physical down time : 2025-01-01 22:08:15 UTC-08:00
Current system time: 2025-01-01 22:08:45-08:00

在这里插入图片描述

在这里插入图片描述

三、配置实例

1、以太网接口速率配置案例

1.1 配置接口GE1/0/1在非自协商模式下的速率为100Mbit/s
<ZFB>system-view 
[ZFB]interface GigabitEthernet 0/0/1
[ZFB-GigabitEthernet0/0/1]undo negotiation auto
[ZFB-GigabitEthernet0/0/1]speed 1000

在这里插入图片描述

2、接口工作层级配置案例

2.1 将接口GE1/0/1切换为三层模式
<ZFB> system-view
[ZFB] interface gigabitethernet 1/0/1
[ZFB-GigabitEthernet1/0/1] undo portswitch

Jan  1 2025 22:03:08-08:00 ZFB %%01PHY/1/PHY(l)[1]:    GigabitEthernet0/0/1: change status to down

[ZFB-GigabitEthernet0/0/1]dis this interface 
GigabitEthernet0/0/1 current state : UP
Line protocol current state : DOWN
Description:
Route Port,The Maximum Frame Length is 9216
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccb6-81ff
Last physical up time   : 2025-01-01 22:03:11 UTC-08:00
Last physical down time : 2025-01-01 22:03:09 UTC-08:00
Current system time: 2025-01-01 22:03:15-08:00

在这里插入图片描述

2.2 将接口GE1/0/1切换为二层模式
<ZFB> system-view
[ZFB] interface gigabitethernet 1/0/1
[ZFB-GigabitEthernet0/0/1]portswitch 

Jan  1 2025 22:08:15-08:00 ZFB %%01IFNET/4/IF_STATE(l)[3]:Interface Vlanif1 has 
turned into UP state.
Jan  1 2025 22:08:15-08:00 ZFB %%01PHY/1/PHY(l)[4]:    GigabitEthernet0/0/1: cha
nge status to down
Jan  1 2025 22:08:15-08:00 ZFB %%01IFNET/4/IF_STATE(l)[5]:Interface Vlanif1 has 
turned into DOWN state.
[ZFB-GigabitEthernet0/0/1]
Jan  1 2025 22:08:17-08:00 ZFB %%01PHY/1/PHY(l)[6]:    GigabitEthernet0/0/1: cha
nge status to up
Jan  1 2025 22:08:17-08:00 ZFB %%01IFNET/4/IF_STATE(l)[7]:Interface Vlanif1 has 
turned into UP state.
Jan  1 2025 22:08:22-08:00 ZFB DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
	
[ZFB-GigabitEthernet0/0/1]display this interface 
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Description:
Switch Port, PVID :    1, TPID : 8100(Hex), The Maximum Frame Length is 9216
Internet protocol processing : disabled
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-ccb6-2cf3
Last physical up time   : 2025-01-01 22:08:17 UTC-08:00
Last physical down time : 2025-01-01 22:08:15 UTC-08:00
Current system time: 2025-01-01 22:08:45-08:00

在这里插入图片描述

四、说明

个人笔记,仅供参考

微信公众号 【通信小菜鸡】 同步更新中…

免责声明

本文档所提供的所有信息,不保证在所有情况下都适用!并仅供学习、交流和参考,严禁非法使用。
本文档所产生的一切风险和后果,均有使用者承担!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

通信小菜鸡-zfb

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值