华为AR路由器 典型配置案例——以太网交换

目录

Eth-Trunk

例:配置三层链路聚合

组网需求

操作步骤

检查配置结果

配置脚本

VLAN

举例:配置基于接口划分VLAN,实现同一VLAN内的互通(同设备)

组网需求

操作步骤

检查配置结果

配置脚本

举例:配置三层子接口实现不同VLAN间的互通

组网需求

操作步骤

检查配置结果

配置脚本

举例:配置VLANIF接口实现不同VLAN间的互通(同设备)

组网需求

操作步骤

检查配置结果

配置脚本


Eth-Trunk

例:配置三层链路聚合

组网需求

如图所示,DeviceA和DeviceB之间创建Eth-Trunk,将两个三层以太网接口捆绑成一个Eth-Trunk接口,可以增加带宽和提高可靠性。

注意:本例中interface1、interface2分别代表10GE0/0/1、10GE0/0/2。

 图1-2 配置三层链路聚合组网图

操作步骤

  1. 在DeviceA和DeviceB上分别创建Eth-Trunk1并配置IP地址。

    # 配置DeviceA。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] undo portswitch
    [DeviceA-Eth-Trunk1] ip address 10.1.1.1 24
    

    # 配置DeviceB。

    <HUAWEI> system-view [HUAWEI] sysname DeviceB [DeviceB] interface eth-trunk 1 [DeviceB-Eth-Trunk1] undo portswitch [DeviceB-Eth-Trunk1] ip address 10.1.1.2 24

  2. 向DeviceA和DeviceB的Eth-Trunk接口中加入成员接口。

    # 配置DeviceA。

    [DeviceB] interface eth-trunk 1
    [DeviceA-Eth-Trunk1] port link-type trunk
    [DeviceA-Eth-Trunk1] trunkport 10ge 0/0/1 to 0/0/2 
    [DeviceA-Eth-Trunk1] quit
    

    # 配置DeviceB。

    [DeviceB] interface eth-trunk 1
    [DeviceB-Eth-Trunk1] port link-type trunk
    [DeviceB-Eth-Trunk1] trunkport 10ge 0/0/1 to 0/0/2 
    [DeviceB-Eth-Trunk1] quit
    

检查配置结果

# 在任意视图下执行display interface eth-trunk命令,检查Eth-Trunk是否创建成功,及成员接口是否正确加入。

[DeviceA] display interface eth-trunk 1
Eth-Trunk1 current state : UP Line protocol current state : UP 
Description:HUAWEI, AR Series, Eth-Trunk1 Interface 
Route Port,Hash arithmetic : According to SIP-XOR-DIP,The Maximum Transmit Unit 
is 1500 Internet Address is 10.1.1.1/24 
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-fc12-3456
Current system time: 0000-0-00 00:00:00     
Input bandwidth utilization  : 0.00%     
Output bandwidth utilization : 0.00% 
----------------------------------------------------- 
PortName                Status              Weight 
----------------------------------------------------- 
10GE0/0/1               UP                  1 
10GE0/0/2               UP                  1 
----------------------------------------------------- 
The Number of Ports in Trunk : 2 
The Number of UP Ports in Trunk : 2

# DeviceA和DeviceB的Eth-Trunk接口能够相互Ping通。

[RouterA] ping -a 10.1.1.1 10.1.1.2   PING 10.1.1.2: 56  data bytes, press CTRL_C to break     Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=31 ms     Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=31 ms     Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=62 ms     Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=62 ms     Reply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=62 ms   
--- 10.1.1.2 ping statistics ---     5 packet(s) transmitted     5 packet(s) received     0.00% packet loss    round-trip min/avg/max = 31/49/62 ms

配置脚本

  • DeviceA

    #
    sysname DeviceA
    # 
    interface Eth-Trunk1ip address 10.1.1.1 255.255.255.0
    # 
    interface 10GE0/0/1 eth-trunk 1
    # 
    interface 10GE0/0/2eth-trunk 1
    #
    return
  • DeviceB

    #
    sysname DeviceB
    # 
    interface Eth-Trunk1ip address 10.1.1.2 255.255.255.0
    # 
    interface 10GE0/0/1 eth-trunk 1
    # 
    interface 10GE0/0/2eth-trunk 1
    #
    return

VLAN

举例:配置基于接口划分VLAN,实现同一VLAN内的互通(同设备)

组网需求

如图1-2所示,把连接Host1和Host2的接口划分到VLAN2,把连接Host3和Host4的接口划分到VLAN3,实现同一VLAN内的主机可以通信,不同VLAN内的主机不能直接二层通信。

  • Host1和Host2可以互相通信,Host3和Host4可以互相通信。
  • Host1和VLAN3内的Host3、Host4不能互相通信,Host2和VLAN3内的Host3、Host4不能互相通信。

图1-2 基于接口划分VLAN组网图(同设备) 

 

注意:本例中interface1、interface2、interface3、interface4分别代表10GE0/0/1、10GE0/0/2、10GE0/0/3、10GE0/0/4。


操作步骤

  1. 创建VLAN,并配置设备与主机相连的接口为Access类型接口。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] vlan batch 2 3
    [DeviceA] interface 10ge 0/0/1
    [DeviceA-10GE0/0/1] portswitch
    [DeviceA-10GE0/0/1] port link-type access
    [DeviceA-10GE0/0/1] quit
    [DeviceA] interface 10ge 0/0/2
    [DeviceA-10GE0/0/2] portswitch
    [DeviceA-10GE0/0/2] port link-type access
    [DeviceA-10GE0/0/2] quit
    [DeviceA] interface 10ge 0/0/3
    [DeviceA-10GE0/0/3] portswitch
    [DeviceA-10GE0/0/3] port link-type access
    [DeviceA-10GE0/0/3] quit
    [DeviceA] interface 10ge 0/0/4
    [DeviceA-10GE0/0/4] portswitch
    [DeviceA-10GE0/0/4] port link-type access
    [DeviceA-10GE0/0/4] quit

  2. 配置接口加入VLAN。

    # 将10GE0/0/1和10GE0/0/2接口加入VLAN2。

    [DeviceA] vlan 2
    [DeviceA-vlan2] port 10ge 0/0/1 to 0/0/2
    [DeviceA-vlan2] quit

    # 将10GE0/0/3和10GE0/0/4接口加入VLAN3。

    [DeviceA] vlan 3
    [DeviceA-vlan3] port 10ge 0/0/3 to 0/0/4
    [DeviceA-vlan3] quit

检查配置结果

# 执行display vlan命令可以查看VLAN状态。

[DeviceA] display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
MAC-LRN: MAC-address learning;  STAT: Statistic;
BC: Broadcast; MC: Multicast;   UC: Unknown-unicast;
FWD: Forward;  DSD: Discard;
--------------------------------------------------------------------------------VID          Ports
--------------------------------------------------------------------------------2         UT:10GE0/0/1(U)   10GE0/0/2(U)3         UT:10GE0/0/3(U)   10GE0/0/4(U)VID  Type     Status  Property  MAC-LRN STAT    BC  MC  UC  Description
--------------------------------------------------------------------------------2 common   enable  default   enable  disable FWD FWD FWD VLAN 00023 common   enable  default   enable  disable FWD FWD FWD VLAN 0003

# VLAN2的主机无法Ping通VLAN3内的主机,但是同一VLAN内的主机可以互相Ping通。

配置脚本

#
sysname DeviceA
#
vlan batch 2 to 3
#
interface 10GE0/0/1portswitchport link-type accessport default vlan 2
#
interface 10GE0/0/2portswitchport link-type accessport default vlan 2
#
interface 10GE0/0/3portswitchport link-type accessport default vlan 3
#
interface 10GE0/0/4portswitchport link-type accessport default vlan 3
#
return

举例:配置三层子接口实现不同VLAN间的互通

组网需求

如图1-3所示,VLAN2内的主机和VLAN3内的主机位于不同的网段。希望在DeviceA上配置三层子接口,实现VLAN2与VLAN3之间的主机互通。

图1-3 通过三层子接口实现不同VLAN间的互通组网图 

 

注意:本例中interface1、interface2、interface3、interface4分别代表10GE0/0/1、10GE0/0/2、10GE0/0/3、10GE0/0/4。
 

操作步骤

  1. 在DeviceB上创建VLAN。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceB
    [DeviceB] vlan batch 2 3
    [DeviceB] interface 10ge 0/0/1
    [DeviceB-10GE0/0/1] portswitch
    [DeviceB-10GE0/0/1] port link-type access
    [DeviceB-10GE0/0/1] port default vlan 2
    [DeviceB-10GE0/0/1] quit
    [DeviceB] interface 10ge 0/0/2
    [DeviceB-10GE0/0/2] portswitch
    [DeviceB-10GE0/0/2] port link-type access
    [DeviceB-10GE0/0/2] port default vlan 3
    [DeviceB-10GE0/0/2] quit

  2. 在DeviceB的接口10GE0/0/3上配置允许用户所属的VLAN通过。

    [DeviceB] interface 10ge 0/0/3
    [DeviceB-10GE0/0/3] portswitch
    [DeviceB-10GE0/0/3] port link-type trunk
    [DeviceB-10GE0/0/3] port trunk allow-pass vlan 2 3
    [DeviceB-10GE0/0/3] quit

  3. 在DeviceA上创建子接口并关联VLAN。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] interface 10ge 0/0/4
    [DeviceA-10GE0/0/4] undo portswitch
    [DeviceA-10GE0/0/4] quit
    [DeviceA] interface 10ge 0/0/4.1
    [DeviceA-10GE0/0/4.1] dot1q termination vid 2 
    [DeviceA-10GE0/0/4.1] quit
    [DeviceA] interface 10ge 0/0/4.2
    [DeviceA-10GE0/0/4.2] dot1q termination vid 3
    [DeviceA-10GE0/0/4.2] quit

  4. 在DeviceA上配置IP地址。

    [DeviceA] interface 10ge 0/0/4.1
    [DeviceA-10GE0/0/4.1] ip address 10.10.10.2 24
    [DeviceA-10GE0/0/4.1] quit
    [DeviceA] interface 10ge 0/0/4.2
    [DeviceA-10GE0/0/4.2] ip address 10.10.20.2 24
    [DeviceA-10GE0/0/4.2] quit

检查配置结果

在VLAN2的主机上配置缺省网关为接口10GE0/0/4.1的IP地址10.10.10.2/24,在VLAN3的主机上配置缺省网关为接口10GE0/0/4.2的IP地址10.10.20.2/24。配置完成后,VLAN2和VLAN3之间的主机能够相互Ping通。

配置脚本

  • DeviceA
    #
    sysname DeviceA
    #
    interface 10GE0/0/4
    #
    interface 10GE0/0/4.1ip address 10.10.10.2 255.255.255.0encapsulation dot1q-terminationdot1q termination vid 2
    #
    interface 10GE0/0/4.2ip address 10.10.20.2 255.255.255.0encapsulation dot1q-terminationdot1q termination vid 3
    #
    return
  • DeviceB
    #
    sysname DeviceB
    #
    vlan batch 2 to 3
    #
    interface 10GE0/0/1portswitchport link-type accessport default vlan 2
    #
    interface 10GE0/0/2portswitchport link-type accessport default vlan 3
    #
    interface 10GE0/0/3portswitchport link-type trunkport trunk allow-pass vlan 2 to 3
    #
    return

举例:配置VLANIF接口实现不同VLAN间的互通(同设备)

组网需求

如图1-4所示,DeviceA下的主机被划分到不同的VLAN中,分别是VLAN2和VLAN3,且位于不同的网段。希望实现VLAN2和VLAN3之间相互通信。

图1-4 配置VLANIF接口实现不同VLAN间的互通组网图(同设备) 

 

注意:本例中interface1、interface2分别代表10GE0/0/1、10GE0/0/2。
 

操作步骤

  1. 创建VLAN,并配置接口加入VLAN。

    <HUAWEI> system-view
    [HUAWEI] sysname DeviceA
    [DeviceA] vlan batch 2 3
    [DeviceA] interface 10ge 0/0/1
    [DeviceA-10GE0/0/1] portswitch
    [DeviceA-10GE0/0/1] port link-type access
    [DeviceA-10GE0/0/1] port default vlan 2
    [DeviceA-10GE0/0/1] quit
    [DeviceA] interface 10ge 0/0/2
    [DeviceA-10GE0/0/2] portswitch
    [DeviceA-10GE0/0/2] port link-type access
    [DeviceA-10GE0/0/2] port default vlan 3
    [DeviceA-10GE0/0/2] quit

  2. 配置VLANIF接口的IP地址。

    [DeviceA] interface vlanif 2
    [DeviceA-Vlanif2] ip address 10.10.10.2 24
    [DeviceA-Vlanif2] quit
    [DeviceA] interface vlanif 3
    [DeviceA-Vlanif3] ip address 10.10.20.2 24
    [DeviceA-Vlanif3] quit

检查配置结果

在VLAN2中的主机上配置IP地址为10.10.10.1/24,缺省网关为接口VLANIF2的IP地址10.10.10.2/24,在VLAN3中的主机上配置IP地址为10.10.20.1/24,缺省网关为接口VLANIF3的IP地址10.10.20.2/24。配置完成后,VLAN2中的主机与VLAN3中的主机能够相互Ping通。

配置脚本

#
sysname DeviceA
#
vlan batch 2 to 3
# 
interface Vlanif2ip address 10.10.10.2 255.255.255.0 
# 
interface Vlanif3ip address 10.10.20.2 255.255.255.0 
# 
interface 10GE0/0/1portswitchport link-type accessport default vlan 2
#
interface 10GE0/0/2portswitchport link-type accessport default vlan 3
#
return

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/89731.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

〔019〕Stable Diffusion 之 单图中绘制多人分区域写提示词 篇

✨ 目录 &#x1f388; 下载区域绘制插件&#x1f388; 区域绘制使用&#x1f388; 参数讲解和基础使用&#x1f388; Lora 自组&#x1f388; Lora 自组的使用&#x1f388; 分区扩散&#x1f388; 分区域提示 &#x1f388; 下载区域绘制插件 在绘制图片时&#xff0c;经常绘…

stm32----SPI协议

一、概述 SPI&#xff08;Serial Peripheral Interface&#xff0c;串行外围设备接口&#xff09;&#xff0c;是Motorola公司提出的一种同步串行接口技术&#xff0c;是一种高速、全双工、同步通信总线&#xff0c;在芯片中只占用四根管脚用来控制及数据传输&#xff0c;节约…

基于非洲秃鹫算法优化的BP神经网络(预测应用) - 附代码

基于非洲秃鹫算法优化的BP神经网络&#xff08;预测应用&#xff09; - 附代码 文章目录 基于非洲秃鹫算法优化的BP神经网络&#xff08;预测应用&#xff09; - 附代码1.数据介绍2.非洲秃鹫优化BP神经网络2.1 BP神经网络参数设置2.2 非洲秃鹫算法应用 4.测试结果&#xff1a;5…

【【萌新的STM32学习-18 中断的基本概念3】】

萌新的STM32学习-18 中断的基本概念3 EXTI和IO映射的关系 AFIO简介&#xff08;F1&#xff09; Alternate Function IO 复用功能IO 主要用于重映射和外部中断映射配置 1.调试IO配置 来自AFIO_MAPR[26:24] , 配置JTAG/SWD的开关状态 &#xff08;这个我们并不用太过深刻的关注&…

Fedora Linux 的家族(一):官方版本

导读本文将对 Fedora Linux 官方版本进行更详细的介绍。共有五个 版本&#xff1a; Fedora Workstation、Fedora Server、Fedora IoT、Fedora CoreOS 和 Fedora Silverblue。Fedora Linux 下载页面目前显示其中三个为 官方 版本&#xff0c;另外两个为 新兴 版本。本文将涵盖所…

使用Python和systemctl管理Linux系统服务的简便工具

前言 本文介绍了一个实用工具&#xff0c;用于在Linux系统上管理systemctl服务。该工具提供了创建、安装、卸载、启动和停止服务的功能&#xff0c;帮助用户轻松地管理和控制正在运行的服务。 通过使用该代码&#xff0c;你可以轻松地执行以下操作&#xff1a; 创建服务文件&…

Matlab图像处理-加法运算

加法运算 图像加法运算的一个应用是将一幅图像的内容叠加到另一幅图像上&#xff0c;生成叠加图像效果&#xff0c;或给图像中每个像素叠加常数改变图像的亮度。 在MATLAB图像处理工具箱中提供的函数imadd()可实现两幅图像的相加或者一幅图像和常量的相加。 程序代码 I1 i…

2023高教社杯数学建模思路 - 复盘:光照强度计算的优化模型

文章目录 0 赛题思路1 问题要求2 假设约定3 符号约定4 建立模型5 模型求解6 实现代码 建模资料 0 赛题思路 &#xff08;赛题出来以后第一时间在CSDN分享&#xff09; https://blog.csdn.net/dc_sinor?typeblog 1 问题要求 现在已知一个教室长为15米&#xff0c;宽为12米&…

对 K8s Pod 安全有多少认识?

写在前面 简单整理&#xff0c;博文内容涉及&#xff1a; PSP 的由来PSA 的发展PSA 使用认知 不涉及使用&#xff0c;用于了解 Pod 安全 API 资源理解不足小伙伴帮忙指正 对每个人而言&#xff0c;真正的职责只有一个&#xff1a;找到自我。然后在心中坚守其一生&#xff0c;全…

如何基于CEETRON ENVISON快速打造桌面、Web端仿真后处理系统?

数十年来&#xff0c;计算机数字模拟技术在物理、化学、工程等领域取得巨大进展。但实现完整的数字孪生 以模拟现实&#xff0c;仍需应对高维度、高精度建模的挑战以及计算机算力需求指数的增长。那该如何解决 这些更复杂的问题&#xff1f;采用具有高性能算力的云端资源进行…

2023年最新版Windows环境下|Java8(jdk1.8)安装教程

个人主页&#xff1a;平行线也会相交 欢迎 点赞&#x1f44d; 收藏✨ 留言✉ 加关注&#x1f493;本文由 平行线也会相交 原创 收录于专栏【JavaSE_primary】 jdk1.8的下载和使用总共分为3个步骤&#xff1a; jdk1.8的下载、jdk1.8的安装、配置环境变量。 目录 一、jdk1.8下载…

忘记密码-小米机型 其他安卓机型账号锁 设备锁的分析与刷写某第三方解锁包输入“注册码”

重要提示&#xff1a; 博文的主要目的是分析安卓机型账号锁的安全性和解决方法。操作仅限于自己的机型忘记密码 手机号不用过了保修期导致无法通过官方解锁的操作&#xff0c;请勿用于非法途径 在开始前。对于锁的认知可以参考这篇博文 安卓搞机玩机-什么是“锁 ” BL锁 屏幕锁…