• Vlan-mapping、QINQ和802.1q隧道堆叠Vlan


    Vlan-mapping:二层隧道,城域网技术。

    在ISP连接客户端的交换机上配置:

    ①定义truank链路

    ②启用qinq的vlan转换能力

    ③定义vlan映射列表

    ④定义vlan允许列表

    实验拓扑:

    实验配置:

    1. [sw1]vlan batch 10 20 1000 2000
    2. [sw1]int g 0/0/2
    3. [sw1-GigabitEthernet0/0/2]port link-type trunk
    4. [sw1-GigabitEthernet0/0/2]qinq vlan-translation enable
    5. [sw1-GigabitEthernet0/0/2]port vlan-mapping vlan 10 map-vlan 1000
    6. [sw1-GigabitEthernet0/0/2]port vlan-mapping vlan 20 map-vlan 2000
    7. [sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 1000 2000
    8. [sw1-GigabitEthernet0/0/2]int g 0/0/1
    9. [sw1-GigabitEthernet0/0/1]port link-type trunk
    10. [sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000
    1. [sw 2]vlan batch 10 20 1000 2000
    2. [sw 2]int g 0/0/2
    3. [sw 2-GigabitEthernet0/0/2]port link-type trunk
    4. [sw 2-GigabitEthernet0/0/2]qinq vlan-translation enable
    5. [sw 2-GigabitEthernet0/0/2]port vlan-mapping vlan 10 map-vlan 1000
    6. [sw 2-GigabitEthernet0/0/2]port vlan-mapping vlan 20 map-vlan 2000
    7. [sw 2-GigabitEthernet0/0/2]port trunk allow-pass vlan 1000 2000
    8. [sw 2-GigabitEthernet0/0/2]int g 0/0/1
    9. [sw 2-GigabitEthernet0/0/1]port link-type trunk
    10. [sw 2-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000
    1. [sw3]vlan batch 10 20
    2. [sw3]int g 0/0/3
    3. [sw3-GigabitEthernet0/0/3]port link-type access
    4. [sw3-GigabitEthernet0/0/3]port default vlan 10
    5. [sw3-GigabitEthernet0/0/3]int g 0/0/4
    6. [sw3-GigabitEthernet0/0/4]port link-type access
    7. [sw3-GigabitEthernet0/0/4]port default vlan 20
    8. [sw3-GigabitEthernet0/0/4]int g 0/0/2
    9. [sw3-GigabitEthernet0/0/2]port link-type trunk
    10. [sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20
    11. [sw4]vlan batch 10 20
    12. [sw4]int g 0/0/3
    13. [sw4-GigabitEthernet0/0/3]port link-type access
    14. [sw4-GigabitEthernet0/0/3]port default vlan 10
    15. [sw4-GigabitEthernet0/0/3]int g 0/0/4
    16. [sw4-GigabitEthernet0/0/4]port link-type access
    17. [sw4-GigabitEthernet0/0/4]port default vlan 20
    18. [sw4-GigabitEthernet0/0/4]int g 0/0/2
    19. [sw4-GigabitEthernet0/0/2]port link-type trunk
    20. [sw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20

    测试:

    QINQ技术:

    双层或多层vlan标记来穿越二层的ISP技术

    接口配置802.1q隧道技术:

    1. 接口封装802.1q隧道协议

    2. 给端口赋予PVID

    配置:

    sw3和sw4不用动,sw1和sw2配置相同

    1. [sw1]vlan 500
    2. [sw1]int g 0/0/1
    3. [sw1-GigabitEthernet0/0/1]port link-type trunk
    4. [sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 500
    5. [sw1-GigabitEthernet0/0/1]int g 0/0/2
    6. [sw1-GigabitEthernet0/0/2]port link-type dot1q-tunnel
    7. [sw1-GigabitEthernet0/0/2]port default vlan 500

    抓包:两层标签

    不同厂商802.1q隧道协议号可能不一致

    华为和思科设备都是0x8100,有的设备可能是0x9100

    这时候就会出现数据不通的情况,需人为修改协议号

    1. intface g 0/0/2
    2. qinq protocol 0x9100

    802.1q隧道堆叠Vlan:

    1. 接口须为hybrid

    2. 启用qinqvlan映射功能

    3. 针对不同vlan定义不同的堆叠vlan

    4. 在接口的移除标签列表中增加对应的vlan id

    配置:

    sw3和sw4不变,sw1和sw2相同

    1. vlan batch 10 20 1000 2000
    2. [sw1]int g 0/0/2
    3. [sw1-GigabitEthernet0/0/2]qinq vlan-translation enable
    4. [sw1-GigabitEthernet0/0/2]port vlan-stacking vlan 10 stack-vlan 1000
    5. [sw1-GigabitEthernet0/0/2]port vlan-stacking vlan 20 stack-vlan 2000
    6. [sw1-GigabitEthernet0/0/2]port hybrid untagged vlan 1000 2000
    7. [sw1]int g 0/0/1
    8. [sw1-GigabitEthernet0/0/1]port link-type trunk
    9. [sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 1000 2000

    抓包两层标签

  • 相关阅读:
    2022年全球市场中空玻璃密封胶总体规模、主要生产商、主要地区、产品和应用细分研究报告
    云原生k8s的声明式哲学
    VDA到Excel方案介绍之自定义邮件接收主题
    Web3新品牌ZAN亮相外滩大会 为海外客户提供全栈安全可信技术
    LeetCode-重新安排行程(C++)
    解决MacOS 报错提示 zsh: command not found: wget
    【java】网络编程
    阿桂天山的技术小结:Flask对Ztree树节点搜索定位
    Vue定时器的使用和设置(图文详解)附上源码
    ExecutorService、Callable、Future实现有返回结果的多线程原理解析
  • 原文地址:https://blog.csdn.net/qq_53332962/article/details/126240705