华为交换机:三层交换机实现vlan间通信

    • 实验环境介绍
  • 一、划分vlan并将相应的接口加入VLAN
    • swh1配置
    • swh2配置
    • swh3配置
  • 二、配置trunk并允许所有vlan通过
  • 三、核心交换机swh4的配置
  • 四、验证结果

实验环境介绍

一、划分vlan并将相应的接口加入VLAN

swh1配置

<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh1
[swh1]
[swh1]int g0/0/1
[swh1-GigabitEthernet0/0/1]port link-type access
[swh1-GigabitEthernet0/0/1]int g0/0/2
[swh1-GigabitEthernet0/0/2]port link-type access
[swh1-GigabitEthernet0/0/2]int g0/0/3
[swh1-GigabitEthernet0/0/3]port link-type access
[swh1-GigabitEthernet0/0/3]q[swh1]vlan 10
[swh1-vlan10]port g0/0/1
[swh1-vlan10]q
[swh1]
[swh1]vlan 20
[swh1-vlan20]
[swh1-vlan20]port g0/0/2
[swh1-vlan20]q
[swh1]vlan 30
[swh1-vlan30]port g0/0/3

查看vlan

[swh1]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(D)                                                     10   common  UT:GE0/0/1(D)                                                      20   common  UT:GE0/0/2(D)                                                      30   common  UT:GE0/0/3(D)                                                      VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
30   enable  default       enable  disable    VLAN 0030                         

swh2配置

The device is running!
##########
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh2
[swh2]
[swh2]int g0/0/1
[swh2-GigabitEthernet0/0/1]port link-type access
[swh2-GigabitEthernet0/0/1]int g0/0/2
[swh2-GigabitEthernet0/0/2]port link-type access
[swh2-GigabitEthernet0/0/2]int g0/0/3
[swh2-GigabitEthernet0/0/3]port link-type access
[swh2-GigabitEthernet0/0/3]q
[swh2]vlan 10
[swh2-vlan10]port g0/0/1
[swh2-vlan10]q
[swh2]
[swh2]vlan 20
[swh2-vlan20]port g0/0/2
[swh2-vlan20]q
[swh2]vlan 30
[swh2-vlan30]port g0/0/3
[swh2-vlan30]q
[swh2]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(D)                                                     10   common  UT:GE0/0/1(D)                                                      20   common  UT:GE0/0/2(D)                                                      30   common  UT:GE0/0/3(D)                                                      VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
30   enable  default       enable  disable    VLAN 0030
[swh2]

swh3配置

The device is running!<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh3
[swh3][swh3]int g0/0/1
[swh3-GigabitEthernet0/0/1]port link-type access
[swh3-GigabitEthernet0/0/1]int g0/0/2
[swh3-GigabitEthernet0/0/2]port link-type access
[swh3-GigabitEthernet0/0/2]int g0/0/3
[swh3-GigabitEthernet0/0/3]port link-type access
[swh3-GigabitEthernet0/0/3]q
[swh3]
[swh3]vlan 10
[swh3-vlan10]port g0/0/1
[swh3-vlan10]q
[swh3]vlan 20
[swh3-vlan20]port g0/0/2
[swh3-vlan20]q
[swh3]vlan 30
[swh3-vlan30]port g0/0/3
[swh3-vlan30]q[swh3]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(U)                                                     10   common  UT:GE0/0/1(U)                                                      20   common  UT:GE0/0/2(U)                                                      30   common  UT:GE0/0/3(U)                                                      VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
30   enable  default       enable  disable    VLAN 0030
[swh3][swh3]q
<swh3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Oct 21 2020 10:18:18-08:00 swh3 %%01CFM/4/SAVE(l)[0]:The user chose Y when decid
ing whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<swh3>
Oct 21 2020 10:20:00-08:00 swh3 %%01PHY/1/PHY(l)[4]:    GigabitEthernet0/0/24: c
hange status to up
Oct 21 2020 10:20:00-08:00 swh3 %%01IFNET/4/IF_STATE(l)[5]:Interface Vlanif1 hasturned into UP state.
<swh3>

二、配置trunk并允许所有vlan通过

swh1、swh2、swh3三台交换机的g0/0/24链接的是swh4,swh4可以看作是是核心交换机,所以我们必须将123三台交换机的g0/0/24配置成trunk,并且要配置允许所有vlan通过

[swh1]int g0/0/24
[swh1-GigabitEthernet0/0/24]port link-type trunk
[swh1-GigabitEthernet0/0/24]port trunk allow-pass vlan all   ##允许所有vlan通过
[swh1-GigabitEthernet0/0/24]q
[swh1]q
<swh1>save[swh2]int g0/0/24
[swh2-GigabitEthernet0/0/24]port link-type trunk
[swh2-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[swh2-GigabitEthernet0/0/24]q
[swh2]q
<swh2>save[swh3]int g0/0/24
[swh3-GigabitEthernet0/0/24]port link-type trunk
[swh3-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[swh3-GigabitEthernet0/0/24]q
[swh3]q
<swh3>save

查看vlan

[swh1]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(U)                                                     10   common  UT:GE0/0/1(U)                                                      TG:GE0/0/24(U)      #允许所有vlan通过                                              20   common  UT:GE0/0/2(U)                                                      TG:GE0/0/24(U)      #允许所有vlan通过                                                30   common  UT:GE0/0/3(U)                                                      TG:GE0/0/24(U)      #允许所有vlan通过                                              VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
30   enable  default       enable  disable    VLAN 0030
[swh1]

三、核心交换机swh4的配置

我们从拓扑图上看出swh4是此网络的核心交换机,因此swh4上的配置尤为重要,步骤如下:

  • 首先必须将g0/0/1g0/0/2g0/0/3的端口类型更改为trunk
  • 其次必须将g0/0/1g0/0/2g0/0/3的端口配置为允许所有vlan通过;
  • 创建对应的vlan10、vlan20、vlan30,并且为这三个vlan配置IP地址。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh4
[swh4][swh4]int g0/0/1
[swh4-GigabitEthernet0/0/1]port link-type trunk              #端口类型更改为trunk
[swh4-GigabitEthernet0/0/1]port trunk allow-pass vlan all    #允许所有vlan通过[swh4-GigabitEthernet0/0/1]int g0/0/2
[swh4-GigabitEthernet0/0/2]port link-type trunk
[swh4-GigabitEthernet0/0/2]port trunk allow-pass vlan all[swh4-GigabitEthernet0/0/2]int g0/0/3
[swh4-GigabitEthernet0/0/3]port link-type trunk
[swh4-GigabitEthernet0/0/3]port trunk allow-pass vlan all[swh4]vlan 10      #创建vlan
[swh4-vlan10]q[swh4]vlan 20
[swh4-vlan20]q[swh4]vlan 30
[swh4-vlan30]q[swh4]int vlan 10
[swh4-Vlanif10]
[swh4-Vlanif10]ip address 192.168.10.254 24      #给vlan10配置IP地址
[swh4-Vlanif10]q[swh4]int vlan 20
[swh4-Vlanif20]ip add 192.168.20.254 24
[swh4-Vlanif20]
[swh4-Vlanif20]q[swh4]vlan 30
[swh4]int vlan 30
[swh4-Vlanif30]ip add 192.168.30.254 24
[swh4-Vlanif30]
[swh4-Vlanif30]q[swh4]dis vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(U)      GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(D)     10   common  TG:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(U)                      20   common  TG:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(U)                      30   common  TG:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(U)                      VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
30   enable  default       enable  disable    VLAN 0030
[swh4]

四、验证结果

在PC1上ping PC 789

Welcome to use PC Simulator!PC>ping 192.168.10.3Ping 192.168.10.3: 32 data bytes, Press Ctrl_C to break
From 192.168.10.1: Destination host unreachable
From 192.168.10.1: Destination host unreachable
From 192.168.10.1: Destination host unreachable
From 192.168.10.1: Destination host unreachable
From 192.168.10.1: Destination host unreachable--- 192.168.10.3 ping statistics ---5 packet(s) transmitted0 packet(s) received100.00% packet lossPC>ping 192.168.20.1Ping 192.168.20.1: 32 data bytes, Press Ctrl_C to break
From 192.168.10.1: Destination host unreachablePC>ping 192.168.10.3Ping 192.168.10.3: 32 data bytes, Press Ctrl_C to break
From 192.168.10.3: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.10.3: bytes=32 seq=2 ttl=128 time=78 ms
From 192.168.10.3: bytes=32 seq=3 ttl=128 time=78 ms--- 192.168.10.3 ping statistics ---3 packet(s) transmitted3 packet(s) received0.00% packet lossround-trip min/avg/max = 78/78/78 msPC>ping 192.168.30.3Ping 192.168.30.3: 32 data bytes, Press Ctrl_C to break
From 192.168.30.3: bytes=32 seq=1 ttl=127 time=141 ms
From 192.168.30.3: bytes=32 seq=2 ttl=127 time=63 ms--- 192.168.30.3 ping statistics ---2 packet(s) transmitted2 packet(s) received0.00% packet lossround-trip min/avg/max = 63/102/141 msPC>ping 192.168.20.3Ping 192.168.20.3: 32 data bytes, Press Ctrl_C to break
From 192.168.20.3: bytes=32 seq=1 ttl=127 time=110 ms
From 192.168.20.3: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.20.3: bytes=32 seq=3 ttl=127 time=62 ms
From 192.168.20.3: bytes=32 seq=4 ttl=127 time=62 ms--- 192.168.20.3 ping statistics ---4 packet(s) transmitted4 packet(s) received0.00% packet lossround-trip min/avg/max = 62/78/110 msPC>

华为交换机:三层交换机实现vlan间通信相关推荐

  1. 华为S5700交换机配置 不同vlan 间通信---eNSP

    华为S5700交换机配置 不同vlan 间通信-eNSP 实验目的 实现不同交换机上不同vlan间的通信 要求 1.根据实验要求配置实验拓扑如下图所示(注意同一个vlanif 下的 不同交换机的网关地 ...

  2. 怎么通过华为三层交换机实现VLAN间通信?

    学习目标 · 掌握通过三层交换机实现VLAN间通信的配置方法 · 掌握通过以太网Trunk链路实现VLAN间通信的配置方法 拓扑图 图1.4 三层交换实验拓扑图 场景 在企业网络中,通过使用三层交换机 ...

  3. 三层交换机实现vlan间通信

    华为交换机:三层交换机实现vlan间通信 实验环境介绍 一.划分vlan并将相应的接口加入VLAN swh1配置 swh2配置 swh3配置 二.配置trunk并允许所有vlan通过 三.核心交换机s ...

  4. 三层交换机实现 VLAN 间通信

    一. 实验目的 1. 验证三层交换机的路由功能 2. 验证三层交换机的交换功能 3. 验证三层交换机实现 VLAN 间通信的过程 4. 区分 VLAN 关联的 IP 接口与路由器接口的差别 二.实验步 ...

  5. 华为交换机-不同Vlan如何通信

    华为交换机-不同Vlan如何通信 全文脉络 一.vlan的基本介绍 二.两个不同vlan的通信方式 1.三层交换机 2.单臂路由器 三.易错点 全文脉络 一.vlan的基本介绍 vlan,全称为&qu ...

  6. 计算机网络实验之三层交换机实现VLAN间通信

    一.知识背景 三层交换机是指具备三层路由功能的交换机,其端口(接口)可以实现基于三层寻址的分组转发,每个三层接口都定义了一个单独的广播域,在为接口配置好IP协议后,该接口就成为连接该接口的同一个广播域 ...

  7. 1030利用三层交换机实现VLAN间通信

    实验相关文件在附件中 转载于:https://blog.51cto.com/network0546/219543

  8. 计算机网络期末 【3层交换机实现VLAN间通信】假设某企业有3个主要部门,即技术部、销售部和经理部,分别处于不同的办公室

    系列文章目录 第一章  实现2台PC机的连通和Telnet的远程登录 第二章 交换机扩展以太网 第三章 单交换机VLAN划分 第四章 双交换机VLAN划分 第五章 三层交换机实现VLAN间通信 第六章 ...

  9. 华为三层交换机实现不同vlan间通信

    实验名称:华为三层交换机实现不同vlan间通信 实验目的:pc1/pc2/pc3实现通信 实验拓扑: 实验步骤: 1.配置PC机 2.配置三层交换机 <huawei>syste-mview ...

最新文章

  1. Tomcat在Linux上的安装与配置
  2. 年薪25万只是白菜价,这几个专业的毕业生正被疯抢
  3. 最新全球权威AI基准测试榜单:浪潮和NVIDIA霸榜了
  4. NodeJs连接Mysql数据库
  5. 基于Xml 的IOC 容器-载入<bean>元素
  6. spark 中的RDD编程:基于Java api
  7. extjs入门(06) 按钮占两行
  8. Angular 项目里 angular.json 文件内容的学习笔记
  9. 【二分】数列分段(ybtoj 二分-1-1)
  10. 如何快速构建嵌入式全栈知识体系?
  11. java底层 文件操作,java底层是怎的对文件操作的
  12. 图解MySQL的各种 JOIN,看完不懂来找我!
  13. 08.electron-(渲染进程间的通信)
  14. Matlab转C++代码入门————附带详细代码和示例
  15. 同步和提交AOKP源码
  16. 清除IBM小型机橙色告警灯方法
  17. TextView自动调节字体大小
  18. 食物相生相克图表 为了家人的健康 请大家进来熟悉下 特别是家庭主妇....
  19. 用PHP如何实现解析抖音无水印视频
  20. java px pt转化_字体的大小(pt)和像素(px)如何转换?

热门文章

  1. 推荐国外经典计算机教材9本
  2. 国内物联网平台(8):中移物联网开放平台OneNet
  3. 基于梯度优化的混沌PSO算法matlab仿真以及在磁悬浮球系统方面的应用
  4. 常见CAD/CAM控件大全
  5. 支付宝常用接口统一封装,可直接支付参数使用(适用于H5、PC、APP)
  6. 1603: 海岛争霸
  7. java毕业设计客观题考试mybatis+源码+调试部署+系统+数据库+lw
  8. 快速提高计算能力——matlab多项式计算
  9. 智慧城市的发展过程中,最需要的15个工作岗位
  10. Microservices Ecosystem Transit Map