• MPLS综合实验


    目录

     实验要求:

    1,R1和R5是客户A两个站点的CE设备,R6和R7是客户b两个站点的CE设备。通过MPLSVPN骨干网络分别连接不同客户的不同站点

    一:首先把骨干网的基础配置ospf配好

    二:配置并激活全局和接口的mpls

    三:创建VRF空间并划分接口

    四:在R2和R4上建立普通BGPv4之上的VPNv4对等体关系

    2,R1和R5采用静态路由的方式传递私网路由;

     3,R6通过RIP将私网路由传递给PE设备;R7通过OSPF将私网路由传递给PE设备

    一:创建VRF空间并划分接口

    二:在R6上配置ripR7上配置ospf

    三:动态传递路由

    ​4,R7单独拉一根网线保证可以访问公网,R7可以访问R2/R3/R4环回


     实验要求:

    1,R1和R5是客户A两个站点的CE设备,R6和R7是客户b两个站点的CE设备。通过MPLSVPN骨干网络分别连接不同客户的不同站点

    一:首先把骨干网的基础配置ospf配好

    1. [r2]ospf 1 router-id 2.2.2.2
    2. [r2-ospf-1]a 0
    3. [r2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
    4. [r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
    5. ------------------------------------------------------
    6. [r3]ospf 1 router-id 3.3.3.3
    7. [r3-ospf-1]a 0
    8. [r3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
    9. [r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
    10. [r3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
    11. ------------------------------------------------------
    12. [r4]ospf 1 router-id 4.4.4.4
    13. [r4-ospf-1]a 0
    14. [r4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255
    15. [r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0

    二:配置并激活全局和接口的mpls

    1. [r2]mpl lsr 2.2.2.2
    2. [r2]mpls
    3. Info: Mpls starting, please wait... OK!
    4. [r2-mpls]mpl ld
    5. [r2-mpls-ldp]int g0/0/1
    6. [r2-GigabitEthernet0/0/1]mpl
    7. [r2-GigabitEthernet0/0/1]mpl ld
    8. -------------------------------------------
    9. [r3]mpl lsr 3.3.3.3
    10. [r3]mpls
    11. Info: Mpls starting, please wait... OK!
    12. [r3-mpls]mpl ld
    13. [r3-mpls-ldp]int g0/0/0
    14. [r3-GigabitEthernet0/0/0]mpls
    15. [r3-GigabitEthernet0/0/0]mpls ld
    16. [r3-GigabitEthernet0/0/0]int g0/0/1
    17. [r3-GigabitEthernet0/0/1]mpls
    18. [r3-GigabitEthernet0/0/1]mpls ld
    19. --------------------------------------------
    20. [r4]mpl lsr 4.4.4.4
    21. [r4]mpls
    22. Info: Mpls starting, please wait... OK!
    23. [r4-mpls]mpls ld
    24. [r4-mpls-ldp]int g0/0/0
    25. [r4-GigabitEthernet0/0/0]mpls
    26. [r4-GigabitEthernet0/0/0]mpls ld

    三:创建VRF空间并划分接口

    1. [r2]ip vpn-instance a
    2. [r2-vpn-instance-a]route-distinguisher 100:1
    3. [r2-vpn-instance-a-af-ipv4]vpn-target 100:1 b
    4. [r2-vpn-instance-a-af-ipv4]vpn-target 100:1 both
    5. IVT Assignment result:
    6. Info: VPN-Target assignment is successful.
    7. EVT Assignment result:
    8. Info: VPN-Target assignment is successful.
    9. [r2-vpn-instance-a-af-ipv4]int g0/0/0
    10. [r2-GigabitEthernet0/0/0]ip binding vpn-instance a
    11. Info: All IPv4 related configurations on this interface are removed!
    12. Info: All IPv6 related configurations on this interface are removed!
    13. [r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
    14. ------------------------------------------------------------------------
    15. [r4]ip vpn-instance a
    16. [r4-vpn-instance-a]route-distinguisher 100:1
    17. [r4-vpn-instance-a-af-ipv4]vpn-target 100:1 b
    18. IVT Assignment result:
    19. Info: VPN-Target assignment is successful.
    20. EVT Assignment result:
    21. Info: VPN-Target assignment is successful.
    22. [r4-vpn-instance-a-af-ipv4]int g0/0/1
    23. [r4-GigabitEthernet0/0/1]ip binding vpn-instance a
    24. Info: All IPv4 related configurations on this interface are removed!
    25. Info: All IPv6 related configurations on this interface are removed!
    26. [r4-GigabitEthernet0/0/1]ip add 192.168.3.1 24

    四:在R2和R4上建立普通BGPv4之上的VPNv4对等体关系

    1. [r2]bgp 1
    2. [r2-bgp]peer 4.4.4.4 as-number 1
    3. [r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
    4. [r2-bgp]ipv4-family vpnv4
    5. [r2-bgp-af-vpnv4]peer 4.4.4.4 enable
    6. ---------------------------------------------------------
    7. [r4]bgp 1
    8. [r4-bgp]peer 2.2.2.2 as-number 1
    9. [r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
    10. [r4-bgp]ipv4-family vpnv4
    11. [r4-bgp-af-vpnv4]peer 2.2.2.2 enable

    2,R1和R5采用静态路由的方式传递私网路由;

    1. [r1]ip route-static 192.168.3.0 24 192.168.2.2
    2. [r1]ip route-static 192.168.4.0 24 192.168.2.2
    3. [r5]ip route-static 192.168.2.0 24 192.168.3.1
    4. [r5]ip route-static 192.168.1.0 24 192.168.3.1
    1. [r2]ip route-static vpn-instance a 192.168.1.0 24 192.168.2.1
    2. [r2]bgp 1
    3. [r2-bgp]ipv4-family vpn-instance a
    4. [r2-bgp-a]import-route direct
    5. [r2-bgp-a]import-route static
    1. [r4]ip route-static vpn-instance a 192.168.4.0 24 192.168.3.2
    2. [r4]bgp 1
    3. [r4-bgp]ipv4-family vpn-instance a
    4. [r4-bgp-a]import-route static
    5. [r4-bgp-a]import-route direct

     3,R6通过RIP将私网路由传递给PE设备;R7通过OSPF将私网路由传递给PE设备

    一:创建VRF空间并划分接口

    1. [r2]ip vpn-instance b
    2. [r2-vpn-instance-b]route-distinguisher 200:2
    3. [r2-vpn-instance-b-af-ipv4]vpn-target 200:2 b
    4. IVT Assignment result:
    5. Info: VPN-Target assignment is successful.
    6. EVT Assignment result:
    7. Info: VPN-Target assignment is successful.
    8. [r2-vpn-instance-b-af-ipv4]int g0/0/2
    9. [r2-GigabitEthernet0/0/2]ip binding vpn-instance b
    10. Info: All IPv4 related configurations on this interface are removed!
    11. Info: All IPv6 related configurations on this interface are removed!
    12. [r2-GigabitEthernet0/0/2]ip add 192.168.5.1 24
    1. [r4]ip vpn-instance b
    2. [r4-vpn-instance-b]route-distinguisher 200:2
    3. [r4-vpn-instance-b-af-ipv4]vpn-target 200:2 b
    4. IVT Assignment result:
    5. Info: VPN-Target assignment is successful.
    6. EVT Assignment result:
    7. Info: VPN-Target assignment is successful.
    8. [r4-vpn-instance-b-af-ipv4]int g0/0/2
    9. [r4-GigabitEthernet0/0/2]ip binding vpn-instance b
    10. Info: All IPv4 related configurations on this interface are removed!
    11. Info: All IPv6 related configurations on this interface are removed!
    12. [r4-GigabitEthernet0/0/2]ip add 192.168.7.1 24

    二:在R6上配置ripR7上配置ospf

    1. [r6]rip 1
    2. [r6-rip-1]v 2
    3. [r6-rip-1]network 192.168.5.0
    4. [r6-rip-1]network 192.168.6.0
    1. [r7]ospf 2 router-id 7.7.7.7
    2. [r7-ospf-2]a 0
    3. [r7-ospf-2-area-0.0.0.0]network 192.168.7.0 0.0.0.255
    4. [r7-ospf-2-area-0.0.0.0]network 192.168.8.0 0.0.0.255

    三:动态传递路由

    1. [r2]rip 1 vpn-instance b
    2. [r2-rip-1]network 192.168.5.0
    3. [r2-bgp]ipv4-family vpn-instance b
    4. [r2-bgp-b]import-route rip 1
    5. [r2-rip-1]import-route bgp
    1. [r4]ospf 2 vpn-instance b router-id 4.4.4.4
    2. [r4-ospf-2]a 0
    3. [r4-ospf-2-area-0.0.0.0]network 192.168.7.0 0.0.0.255
    4. [r4-bgp]ipv4-family vpn-instance b
    5. [r4-bgp-b]import-route ospf 2
    6. [r4-ospf-2]import-route bgp


    4,R7单独拉一根网线保证可以访问公网,R7可以访问R2/R3/R4环回

    1. [r4]ospf 1
    2. [r4-ospf-1]a 0
    3. [r4-ospf-1-area-0.0.0.0]network 47.0.0.0 0.0.0.255
    4. [r7]ospf 1 router-id 7.7.7.7
    5. [r7-ospf-1]a 0
    6. [r7-ospf-1-area-0.0.0.0]network 47.0.0.0 0.0.0.255

     

  • 相关阅读:
    Vue3+Typescript学习笔记(九)组件通信--父子组件通信(props,$emit)
    QFramework Pro 开发日志(七)v0.4 版本审核通过 与 对话编辑器功能预告
    力扣232 - 用栈实现队列【C语言实现】
    【Go语言】Go语言中的流程控制
    页面设计都有哪些好用的工具推荐?
    【C++】公有_保护_私有_继承—代码学习记录
    GIS跟踪监管系统信息查询
    一篇博客搞懂HashMap相关知识
    【CSS】object-fit 和 object-position 属性详解
    Zabbix实现对Tomcat的监控
  • 原文地址:https://blog.csdn.net/weixin_64051859/article/details/127589596