• 实验: GVRP 配置,三层交换机通讯 ,VLAN 间路由,单臂路由与路由器子接口的配置,vlan-单臂路由技术


    目录

    一,实验1-3: GVRP 配置

    【实验目的】

    【实验环境】

    【实验过程】

    拓扑图

    步骤一. 开启 GVRP 功能 

    步骤二. 在交换机之间配置 Trunk 链路

    【实验总结】

    二,实验1-4:  VLAN 间路由

    【实验目的】

    【实验环境】

    【实验过程】

    拓扑图

    步骤一. 实验环境准备 

      步骤二. 为 R3 配置 IP 地址 

    步骤三. 创建 VLAN 

    步骤四. 配置 R2 上的子接口实现 VLAN 间路由 

    配置文件 

    【实验总结】

    三,实验:单臂路由与路由器子接口的配置

    【实验目的】

    【实验环境】

    【实验过程】

    步骤一. 配置AR1

    步骤二. 配置SW1

    【实验总结】

    四,实验:vlan-单臂路由技术

    【实验目的】

    【实验环境】

    【实验过程】

    步骤一. 配置AR1

    步骤二. 配置SW1

    步骤三. 配置SW1

    【实验总结】

    五,实验:VLAN-三层交换机通讯 

    【实验目的】

    【实验环境】

    【实验过程】

    拓扑图

    步骤一. 为客户端配置 IP 地址

    步骤二. 创建 VLAN

    【实验总结】


    一,实验1-3 GVRP 配置

    【实验目的】

    · 掌握GVRP的配置方法

    · 掌握GVRP丌同注册模式的配置方法

    【实验环境】

    企业网络中往往会使用大量的交换机丏需要在网络中划分丌同的VLAN,若

    网络管理员采用手工配置VLAN的创建和删除,工作量极大而丏容易出错。这种

    情况下,可以通过GVRP的VLAN动态注册功能来自劢完成VLAN的配置。

    【实验过程】

    拓扑图

     

    步骤. 开启 GVRP 功能 

    首先在全局模式下开启GVRP功能,然后在相应接口下开启GVRP功能。

    [S1]gvrp

    [S1]interface GigabitEthernet 0/0/13

    [S1-GigabitEthernet0/0/13]gvrp

    步骤二. 在交换机之间配置 Trunk 链路

    [S1]interface GigabitEthernet 0/0/1

    [S1-Gigabitethernet0/0/13]port link-type trunk

    [S1-Gigabitethernet0/0/13]port trunk allow-pass vlan all

    首先在全局模式下开启GVRP功能,然后在相应接口下开启GVRP功能

     

      在S1上创建VLAN 并在sw2,sw3,sw4上查看vlan信息

     在sw2,sw3,sw4上查看vlan信息

    如下图

     

     

     

     

     

       

        

    【实验总结】

     

     在sw5上创建vlan5在sw2,sw3,sw4上查看vlan信息

     

     

     

     

     

    二,实验1-4:  VLAN 间路由

    【实验目的】

    掌握用亍VLAN间路由的Trunk接口的配置方法

    掌握在单个物理接口上配置多个子接口的方法

    掌握在VLAN间实现ARP通信的配置方法

    【实验环境】

    企业内部网络通常会通过划分丌同的VLAN来隔离丌同部门之间的二层通

    信,并保证各部门间的信息安全。但是由亍业务需要,部分部门之间需要实现跨

    VLAN通信,网络管理员决定借劣路由器通过配置单臂路由实现R1和R3之间

    跨VLAN通信需求。

    【实验过程】

    拓扑图

     

    操作步骤

    步骤一. 实验环境准备 

    如果本任务中您使用的是空配置设备,需要从步骤1开始配置,然后跳过步

    骤2。如果使用的设备包含上一个实验的配置,请直接从步骤2开始配置。

    配置R1、R3和S1的设备名称,并按照拓扑图配置R1的G0/0/1接口的IP地

    址。

    1. <Huawei>system-view
    2. Enter system view, return user view with Ctrl+Z.
    3. [Huawei]sysname R1 hyj
    4. [R1]interface GigabitEthernet 0/0/1
    5. [R1-GigabitEthernet0/0/1]ip address 10.0.4.1 24
    6. <Huawei>system-view
    7. Enter system view, return user view with Ctrl+Z.
    8. [Huawei]sysname R3
    9. <Quidway>system-view
    10. [Quidway]sysname S1

      步骤二. 为 R3 配置 IP 地址 

    按照拓扑图配置R3上的G0/0/1接口的IP地址。

    1. [R3]interface GigabitEthernet 0/0/1
    2. [R3-GigabitEthernet0/0/1]ip address 10.33.8.1 24

     

    步骤三. 创建 VLAN 

    在S1上创建VLAN 4和VLAN 8,将端口G0/0/1加入到VLAN 4中,将端口

    G0/0/3加入到VLAN 8中。

    1. [S1]vlan batch 4 8
    2. Info: This operation may take a few seconds. Please wait for a moment...done.
    3. [S1]interface GigabitEthernet 0/0/1
    4. [S1-GigabitEthernet0/0/1]port link-type access
    5. [S1-GigabitEthernet0/0/1]port default vlan 4
    6. [S1-GigabitEthernet0/0/1]quit
    7. [S1]interface GigabitEthernet0/0/3
    8. [S1-GigabitEthernet0/0/3]port link-type access
    9. [S1-GigabitEthernet0/0/3]port default vlan 8
    10. [S1-GigabitEthernet0/0/3]quit

     

    将S1连接路由器的G0/0/2端口配置为Trunk接口,并允许VLAN 4和VLAN8的报文通过。

    1. [S1]interface GigabitEthernet0/0/2
    2. [S1-GigabitEthernet0/0/2]port link-type trunk
    3. [S1-GigabitEthernet0/0/2]port trunk allow-pass vlan 4 8

     

    步骤四. 配置 R2 上的子接口实现 VLAN 间路由 

    由亍路由器只有一个实际的物理接口不交换机S1相连,而实际上丌同部门

    属亍丌同VLAN和丌同网段,所以在路由器上配置丌同的逡辑子接口来扮演丌同的网关角色,在R2上配置子接口G0/0/1.1和G0/0/1.3,并作为VLAN 4和VLAN 8的网关。

    1. <Huawei>system-view
    2.  Enter system view, return user view with Ctrl+Z.
    3. [Huawei]sysname R2
    4. [R2]interface GigabitEthernet0/0/1.1
    5. [R2-GigabitEthernet0/0/1.1]ip address 10.33.4.254 24
    6. [R2-GigabitEthernet0/0/1.1]dot1q termination vid 4
    7. [R2-GigabitEthernet0/0/1.1]arp broadcast enable
    8. [R2-GigabitEthernet0/0/1.1]quit
    9. [R2]interface GigabitEthernet0/0/1.3
    10. [R2-GigabitEthernet0/0/1.3]ip address 10.33.8.254 24
    11. [R2-GigabitEthernet0/0/1.3]dot1q termination vid 8
    12. [R2-GigabitEthernet0/0/1.3]arp broadcast enable

     

    在R1和R3上各配置一条默认路由指向各自的网关

    1. [R1]ip route-static 0.0.0.0 0.0.0.0 10.33.4.254
    2. [R3]ip route-static 0.0.0.0 0.0.0.0 10.33.8.254

    配置完成后,检测R1不R3间的连通性。

    ping 10.33.8.1

    PING 10.0.8.1: 56 data bytes, press CTRL_C to break

    Reply from 10.0.8.1: bytes=56 Sequence=1 ttl=254 time=10 ms

    Reply from 10.0.8.1: bytes=56 Sequence=2 ttl=254 time=1 ms

    Reply from 10.0.8.1: bytes=56 Sequence=3 ttl=254 time=1 ms

    Reply from 10.0.8.1: bytes=56 Sequence=4 ttl=254 time=10 ms

    Reply from 10.0.8.1: bytes=56 Sequence=5 ttl=254 time=1 ms

    --- 10.0.8.1 ping statistics ---

    5 packet(s) transmitted 

    5 i

     

    [R2]display ip routing-table

     

    配置文件 

    1. [R1]display current-configuration
    2. [V200R003C00SPC200]
    3. #
    4. sysname R1
    5. #
    6. interface GigabitEthernet0/0/1
    7. ip address 10.0.4.1 255.255.255.0
    8. #
    9. ip route-static 0.0.0.0 0.0.0.0 10.0.4.254
    10. #
    11. user-interface con 0
    12. authentication-mode password
    13. set authentication password
    14. cipher %$%$dD#}P<HzJ;Xs%X>hOkm!,.+Iq61QK`K6tI}cc-;k_o`C.+L,%$%$
    15. user-interface vty 0 4
    16. #
    17. return
    18. [R2]display current-configuration
    19. [V200R003C00SPC200]
    20. #
    21. sysname R2
    22. #
    23. interface GigabitEthernet0/0/1
    24. #
    25. interface GigabitEthernet0/0/1.1
    26. dot1q termination vid 4
    27. ip address 10.0.4.254 255.255.255.0
    28. arp broadcast enable
    29. #
    30. interface GigabitEthernet0/0/1.3
    31. dot1q termination vid 8
    32. ip address 10.0.8.254 255.255.255.0
    33. arp broadcast enable
    34. #
    35. user-interface con 0
    36. authentication-mode password
    37. set authentication password
    38. cipher %$%$|nRPL^hr2IXi7LHDID!/,.*%.8%h;3:,hXO2dk#ikaWI.*(,%$%$
    39. user-interface vty 0 4
    40. #
    41. return
    42. [R3]display current-configuration
    43. [V200R003C00SPC200]
    44. #
    45. sysname R3
    46. #
    47. interface GigabitEthernet0/0/1
    48. ip address 10.0.8.1 255.255.255.0
    49. #
    50. ip route-static 0.0.0.0 0.0.0.0 10.0.8.254
    51. #
    52. user-interface con 0
    53. authentication-mode password
    54. set authentication password
    55. cipher %$%$W|$)M5D}v@bY^gK\;>QR,.*d;8Mp>|+EU,:~D~8b59~..*g,%$%$
    56. user-interface vty 0 4
    57. #
    58. Return
    59. [S1]display current-configuration
    60. #

    【实验总结】

    检测R1和R3间的连通性

     

    从上面截图可以看R1与R2已经可以通讯!

    三,实验:单臂路由与路由器子接口的配置

    【实验目的】

    学会配置路由器与交换器,从而实现单臂路由环境中的流量跨vlan转发。

    【实验环境】

    企业内部网络通常会通过划分丌同的VLAN来隔离丌同部门乊间的二层通

    信,并保证各部门间的信息安全。但是由于业务需要,部分部门之间需要实现跨

    VLAN通信,一个路由器,三个交换机,四个终端。

    【实验过程】

    拓扑图

     

    步骤一. 配置AR1

    创建子接口并进入子接口配置视图

    interface GigabitEthernet0/0/2.1

    配置802.1Q封装并指定端口的PVID

    dot1q termination vid 20

    ip address 10.33.10.254 24

    开启

    arp broadcast enable

    Quit

    interface GigabitEthernet0/0/2.2

    dot1q termination vid 20

    ip address 10.33.20.254 24

    arp broadcast enable

    Quit

     

     

    步骤. 配置SW1

    Vlan batch 10 20

    interface GigabitEthernet0/0/1

    port link-type trunk

    Port link allow-pass vlan10 20

    quit

    interface Ethernet0/0/10

     port link-type access

     port default vlan10

    interface Ethernet0/0/20

     port link-type access

     port default vlan20

     

    【实验总结】

    一,查看AR1的IP路由表

     

    二测试pc1与pc2之间的联通性

     由上图可知两个vlan互通。

     

    四,实验:vlan-单臂路由技术

    【实验目的】

    学会并理解单臂路由技术

    【实验环境】

    五个终端,一个路由器,两个交换机。

    【实验过程】

    拓扑图

     

    步骤一. 配置AR1

    1. <Huawei>SYS
    2. [Huawei]sys huj R1
    3. [huj R1]interface GigabitEthernet0/0/0.10
    4. [huj R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
    5. [huj R1-GigabitEthernet0/0/0.10]ip address 10.10.10.254 8
    6. [huj R1-GigabitEthernet0/0/0.10]arp broadcast enable
    7. [huj R1-GigabitEthernet0/0/0.10]Quit
    8. [huj R1]interface GigabitEthernet0/0/0.20
    9. [huj R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
    10. [huj R1-GigabitEthernet0/0/0.20]ip address 20.20.20.254 8
    11. [huj R1-GigabitEthernet0/0/0.20]arp broadcast enable
    12. [huj R1-GigabitEthernet0/0/0.20]Quit
    13. [huj R1]interface GigabitEthernet0/0/0.30
    14. [huj R1-GigabitEthernet0/0/0.30]dot1q termination vid 30
    15. [huj R1-GigabitEthernet0/0/0.30]ip address 30.30.30.254 8
    16. [huj R1-GigabitEthernet0/0/0.30]arp broadcast enable
    17. [huj R1-GigabitEthernet0/0/0.30]Quit
    18. [huj R1]dis ip routing-table

     

     

     

    步骤二. 配置SW1

    1. <Huawei>sys
    2. [Huawei]sys hyj s2
    3. [hyj s2]vlan batch 10 20 30                     
    4. [hyj s2]int g0/0/1
    5. [hyj s2-GigabitEthernet0/0/1]port link-type trunk
    6. [hyj s2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30
    7. [hyj s2-GigabitEthernet0/0/1]Quit
    8. [hyj s2]Int e0/0/3
    9. [hyj s2-Ethernet0/0/3]port link-type access
    10. [hyj s2-Ethernet0/0/3]port default vlan 30
    11. [hyj s2-Ethernet0/0/3]Qu
    12. [hyj s2]Int e0/0/2
    13. [hyj s2-Ethernet0/0/2]port link-type access
    14. [hyj s2-Ethernet0/0/2]port default vlan 10
    15. [hyj s2-Ethernet0/0/2]int e0/0/1
    16. [hyj s2-Ethernet0/0/1]port link-type trunk
    17. [hyj s2-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30

     

    查看SW2上的vlan

     

    步骤三. 配置SW1

    1. <Huawei>sys
    2. Enter system view, return user view with Ctrl+Z.
    3. [Huawei]sys s1
    4. [s1]vlan batch 10 20 30                    
    5. Info: This operation may take a few seconds. Please wait for a moment...done.
    6. [s1]int e0/0/3
    7. [s1-Ethernet0/0/3]port link-type trunk
    8. [s1-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30
    9. [s1-Ethernet0/0/3]Quit
    10. [s1]Int e0/0/1
    11. [s1-Ethernet0/0/1]port link-type access
    12. [s1-Ethernet0/0/1]port default vlan 10
    13. [s1-Ethernet0/0/1]Qu
    14. [s1]Int e0/0/2
    15. [s1-Ethernet0/0/2]port link-type access
    16. [s1-Ethernet0/0/2]port default vlan 20
    17. [s1-Ethernet0/0/2]Int e0/0/4
    18. [s1-Ethernet0/0/4]port link-type access
    19. [s1-Ethernet0/0/4]port default vlan 10

     

    [s1-Ethernet0/0/4]dis vl

     

     

    【实验总结】

     

    五,实验:VLAN-三层交换机通讯 

    【实验目的】

    实现三层交换机通讯。

    【实验环境】

    三个交换机,两个终端,一个服务器,一个CLIENT.

    【实验过程】

    拓扑图

     

    步骤一. 为客户端配置 IP 地址

     

     

     

     

    要设置网关10.33.30.254,10.33.10.254,10.33.20.254

    步骤. 创建 VLAN

    1. <Huawei>sys
    2. [Huawei]sys hyj
    3. [HYJ]vlan batch 200 100 300
    4. [HYJ]interface Vlanif 100
    5. [HYJ-Vlanif2]ip address 10.33.10.254 24
    6. [HYJ-Vlanif2]qu
    7. [HYJ]interface vlanif 200
    8. [HYJ-Vlanif3]ip address 10.33.20.254 24
    9. [HYJ-Vlanif3]qu
    10. [HYJ]interface vlanif 300
    11. [HYJ-Vlanif3]ip address 10.33.30.254 24
    12. [HYJ-Vlanif3]qu
    1. [hyj]interface Ethernet0/0/2
    2. [hyj-GigabitEthernet0/0/2]port link-type access//配置access接口
    3. [hyj-GigabitEthernet0/0/2]port default vlan 100//修改接口的pvid,使其加入指定的vlan
    4. [hyj-GigabitEthernet0/0/2]quit
    5. [hyj-GigabitEthernet0/0/2]quit
    6. [hyj]interface GigabitEthernet0/0/3
    7. [hyj-GigabitEthernet0/0/1]port link-type access
    8. [hyj-GigabitEthernet0/0/1]port default vlan 200
    9. [hyj-GigabitEthernet0/0/1]quit
    10. [hyj-GigabitEthernet0/0/1]quit
    11. [hyj]interface GigabitEthernet0/0/2
    12. [hyj-GigabitEthernet0/0/2]port link-type access//配置access接口
    13. [hyj-GigabitEthernet0/0/2]port default vlan 100//修改接口的pvid,使其加入指定的vlan
    14. [hyj-GigabitEthernet0/0/2]quit
    15. [hyj-GigabitEthernet0/0/2]quit
    16. [hyj]interface GigabitEthernet0/0/3
    17. [hyj-GigabitEthernet0/0/1]port link-type access
    18. [hyj-GigabitEthernet0/0/1]port default vlan 300
    19. [hyj-GigabitEthernet0/0/1]quit
    20. [hyj-GigabitEthernet0/0/1]quit
    21. dis ip routing-table

    创建vlan 2 3 100

    1. 在S3
    2. <Huawei>sys
    3. [Huawei]sys hyj
    4. [hyj]vlan batch 200 100 300
    5. [hyj]interface Vlanif 100
    6. [hyj-Vlanif100]ip address 10.33.10.254 24
    7. [hyj-Vlanif100]qu
    8. [hyj]interface vlanif 200
    9. [hyj-Vlanif200]ip address 10.33.20.254 24
    10. [hyj-Vlanif200]qu
    11. [hyj]interface vlanif 300
    12. [hyj-Vlanif300]ip address 10.33.30.254 24
    13. [hyj-Vlanif300]qu
    14. [hyj]interface vlanif 200
    15. [hyj-Vlanif200]ip address 10.33.20.254 24
    16. [hyj]int g0/0/2
    17. [hyj-GigabitEthernet0/0/2]port link-type trunk
    18. [hyj-GigabitEthernet0/0/2]port trunk allow-pass vlan 100 200 300
    19. [hyj-GigabitEthernet0/0/2]Quit

    dis ip routing-table

     

     

    1. 在S1上Huawei>sys
    2. Enter system view, return user view with Ctrl+Z.
    3. [Huawei]sys hyj
    4. [hyj]vlan batch 100 200                      
    5. Info: This operation may take a few seconds. Please wait for a moment...done.
    6. [hyj]interface Vlanif 100
    7. [hyj-Vlanif100]ip address 10.33.10.254 24
    8. [hyj-Vlanif100]qu
    9. [hyj]interface vlanif 200
    10. [hyj-Vlanif200]ip address 10.33.20.254 24
    11. [hyj-Vlanif200]qu
    12. [hyj]Interface Ethernet0/0/2
    13. [hyj-Ethernet0/0/2]port link-type access
    14. [hyj-Ethernet0/0/2]port default vlan 100
    15. [hyj-Ethernet0/0/2]quit
    16. [hyj]interface Ethernet0/0/3
    17. [hyj-Ethernet0/0/3]port link-type access
    18. [hyj-Ethernet0/0/3]port default vlan 200
    19. [hyj-Ethernet0/0/3]quit

     

     

     

    在S2上

     

     

    【实验总结】

     

     

     

     

  • 相关阅读:
    ES6 入门教程 18 Iterator 和 for...of 循环 18.1 Iterator(遍历器)的概念
    IMU+摄像头实现无标记运动捕捉
    随机过程理论知识(三)
    使用Minio构建文件服务
    学习笔记之Vue基础学习——持更
    PHP代码审计14—变量覆盖
    docker模拟mysql 主从
    java培训之SpringMVC提示消息的国际化
    【愚公系列】2022年11月 .NET CORE工具案例-.NET Core执行JavaScript
    Git上传项目到Github
  • 原文地址:https://blog.csdn.net/qq_45080888/article/details/126498451