华为交换机:三层交换机实现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. 怎么通过华为三层交换机实现VLAN间通信?

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

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

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

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

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

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

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

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

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

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

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

  7. cisco三层交换机vlan间通信

    cisco三层交换机vlan间通信 实验拓扑如上 首先,将二层交换机的基本配置配好,添加vlan2,3,并且将端口划分到vlan下面.不要忘记这一步 然后配置三层交换机的基本配置,添加vlan2,3 ...

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

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

  9. 利用三层交换机实现VLAN的通信实验报告

    利用三层交换机实现VLAN的通信实验报告<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office ...

最新文章

  1. Linker Scripts3--简单的链接脚本命令2-Assigning Values to Symbols
  2. .NET 6 预览版 7 Released
  3. 惊!Kubernetes 将弃用 Docker,开发者们怎么办?
  4. c3p0-config.xml文件简单说明与备忘
  5. n级阶梯,人一步只能上1~2级,求一共有几种走法?
  6. gitlab releases
  7. x64位windows上程序开发的注意事项
  8. java http请求头_http的请求头含义及如何用java发送
  9. 安装python多少内存_Python进程使用的全部内存?
  10. 【接口测试】axios测试接口
  11. 最常用的10种CSS BUG解决方法与技巧-浏览器兼容教程
  12. 33.Jump Game(跳步游戏)
  13. markdown转html格式
  14. chkdsk f: /f windows磁盘检查
  15. 35岁的网络工程师入行需要注意什么?
  16. 腾讯短网址在线生成(url.cn短网址) 2020最新腾讯短网址生成api接口推荐
  17. 1173 Problem V 《C语言程序设计》江宝钏主编-习题6-2-排列数
  18. 【Linux】Linux安装nginx操作详细步骤
  19. SQL基本语句(1)
  20. 功放IC音频芯片双声道D类3W ESOP-8封装

热门文章

  1. Windows系统文件类型大全
  2. 2017年,大数据就业前景怎么样?
  3. 视频+公众号是未来微信生态的一种新的运营方式!
  4. 今日推荐:2068个开源的网站模板【免费下载】
  5. 03 循环、字符串、列表、元祖、字典
  6. input checkbox 获取选中值和设置选中状态
  7. 编写一个静态方法lg(),接收一个整型参数N,返回不大于log2N(以2为底)的最大整数。不要使用Math库。
  8. java微信小程序内容安全 - 检测文本是否含有违法违规内容
  9. 第5次作业+061+陈小兰
  10. 《简化iOS APP上架流程,App Uploader助你搞定!》