• 跨域的MPLS VXN Option C


    实验目的

    理解Option C工作机制。

    熟练的掌握Option C的配置流程和校验方式。

    实验拓扑

    接口ip配置:

    1. R1(config)#interface e0/1
    2. R1(config-if)#ip address 17.17.17.1 255.255.255.0
    3. R1(config-if)#no shutdown
    4. R1(config-if)#interface e0/0
    5. R1(config-if)#ip address 12.12.12.1 255.255.255.0
    6. R1(config-if)#no shutdown
    7. R1(config)#interface loopback 0
    8. R1(config-if)#ip address 1.1.1.1 255.255.255.0
    9. R2(config)#interface e0/0
    10. R2(config-if)#ip address 12.12.12.2 255.255.255.0
    11. R2(config-if)#no shutdown
    12. R2(config-if)#interface e0/1
    13. R2(config-if)#ip address 23.23.23.2 255.255.255.0
    14. R2(config-if)#no shutdown
    15. R2(config)#interface loopback 0
    16. R2(config-if)#ip address 2.2.2.2 255.255.255.0
    17. R3(config)#interface e0/1
    18. R3(config-if)#ip address 23.23.23.3 255.255.255.0
    19. R3(config-if)#no shutdown
    20. R3(config-if)#interface e0/0
    21. R3(config-if)#ip address 34.34.34.3 255.255.255.0
    22. R3(config-if)#no shutdown
    23. R3(config)#interface loopback 0
    24. R3(config-if)#ip address 3.3.3.3 255.255.255.0
    25. R4(config)#interface e0/0
    26. R4(config-if)#ip address 34.34.34.4 255.255.255.0
    27. R4(config-if)#no shutdown
    28. R4(config-if)#interface e0/1
    29. R4(config-if)#ip address 45.45.45.4 255.255.255.0
    30. R4(config-if)#no shutdown
    31. R4(config)#interface loopback 0
    32. R4(config-if)#ip address 4.4.4.4 255.255.255.0
    33. R5(config)#interface e0/1
    34. R5(config-if)#ip address 45.45.45.5 255.255.255.0
    35. R5(config-if)#no shutdown
    36. R5(config-if)#interface e0/0
    37. R5(config-if)#ip address 56.56.56.5 255.255.255.0
    38. R5(config-if)#no shutdown
    39. R5(config)#interface loopback 0
    40. R5(config-if)#ip address 5.5.5.5 255.255.255.0
    41. R6(config)#interface e0/0
    42. R6(config-if)#ip address 56.56.56.6 255.255.255.0
    43. R6(config-if)#no shutdown
    44. R6(config-if)#interface e0/1
    45. R6(config-if)#ip address 68.68.68.6 255.255.255.0
    46. R6(config-if)#no shutdown
    47. R6(config)#interface loopback 0
    48. R6(config-if)#ip address 6.6.6.6 255.255.255.0
    49. R7(config)#interface e0/1
    50. R7(config-if)#ip address 17.17.17.7 255.255.255.0
    51. R7(config-if)#no shutdown
    52. R7(config)#interface loopback 0
    53. R7(config-if)#ip address 7.7.7.7 255.255.255.0
    54. R8(config)#interface e0/1
    55. R8(config-if)#ip address 68.68.68.8 255.255.255.0
    56. R8(config-if)#no shutdown
    57. R8(config)#interface loopback 0
    58. R8(config-if)#ip address 8.8.8.8 255.255.255.0

    完成AS1内及AS2内P-NETWORK及PE、CE间协议配置

    1. R7(config)#router ospf 1
    2. R7(config-router)#router-id 7.7.7.7
    3. R7(config-router)#network 7.7.7.7 0.0.0.0 area 0
    4. R7(config-router)#network 17.17.17.7 0.0.0.0 area 0
    5. R8(config)#router ospf 1
    6. R8(config-router)#router-id 8.8.8.8
    7. R8(config-router)#network 8.8.8.8 0.0.0.0 area 0
    8. R8(config-router)#network 68.68.68.8 0.0.0.0 area 0
    9. R1(config)#ip vrf vpn
    10. R1(config-vrf)#rd 100:100
    11. R1(config-vrf)#route-target 100:100
    12. R1(config)#mpls label protocol ldp
    13. R1(config)#mpls label range 100 199
    14. R1(config)#mpls ldp router-id loopback 0
    15. R1(config-if)#router isis
    16. R1(config-router)#net 49.0001.0000.0000.0001.00
    17. R1(config)#interface loopback 0
    18. R1(config-if)#ip router isis
    19. R1(config)#interface e0/0
    20. R1(config-if)#ip router isis
    21. R1(config-if)#mpls ip
    22. R1(config-if)#interface e0/1
    23. R1(config-if)#ip vrf forwarding vpn
    24. R1(config-if)#ip address 17.17.17.1 255.255.255.0
    25. R1(config)#router ospf 1 vrf vpn
    26. R1(config-router)#router-id 1.1.1.1
    27. R1(config-router)#redistribute bgp 1 subnets
    28. R1(config-router)#network 17.17.17.1 0.0.0.0 area 0
    29. R1(config-router)#router bgp 1
    30. R1(config-router)#bgp router-id 1.1.1.1
    31. R1(config-router)#neighbor 2.2.2.2 remote-as 1
    32. R1(config-router)#neighbor 2.2.2.2 update-source loopback 0
    33. R1(config-router)#address-family vpnv4
    34. R1(config-router-af)#neighbor 2.2.2.2 activate
    35. R1(config-router-af)#neighbor 2.2.2.2 send-community extended
    36. R1(config-router)#address-family ipv4 vrf vpn
    37. R1(config-router-af)#redistribute ospf 1
    38. R2(config)#router isis
    39. R2(config-router)#net 49.0001.0000.0000.0002.00
    40. R2(config)#mpls label protocol ldp
    41. R2(config)#mpls label range 200 299
    42. R2(config)#mpls ldp router-id loopback 0
    43. R2(config)#interface loopback 0
    44. R2(config-if)#ip add 2.2.2.2 255.255.255.0
    45. R2(config-if)#ip router isis
    46. R2(config-if)#interface e0/0
    47. R2(config-if)#ip router isis
    48. R2(config-if)#mpls ip
    49. R2(config-if)#interface e0/1
    50. R2(config-if)#ip router isis
    51. R2(config-if)#mpls ip
    52. R2(config-if)#router bgp 1
    53. R2(config-router)#bgp router-id 2.2.2.2
    54. R2(config-router)#neighbor 1.1.1.1 remote-as 1
    55. R2(config-router)#neighbor 1.1.1.1 update-source loopback 0
    56. R2(config-router)#neighbor 3.3.3.3 remote-as 1
    57. R2(config-router)#neighbor 3.3.3.3 update-source loopback 0
    58. R2(config-router)#address-family vpnv4
    59. R2(config-router-af)#neighbor 1.1.1.1 activate
    60. R2(config-router-af)#neighbor 1.1.1.1 route-reflector-client
    61. R2(config-router-af)#neighbor 3.3.3.3 activate
    62. R2(config-router-af)#neighbor 3.3.3.3 route-reflector-client
    63. R3(config)#router isis
    64. R3(config-router)#net 49.0001.0000.0000.0003.00
    65. R3(config)#mpls label protocol ldp
    66. R3(config)#mpls label range 300 399
    67. R3(config)#mpls ldp router-id loopback 0
    68. R3(config)#interface e0/1
    69. R3(config-if)#ip router isis
    70. R3(config-if)#mpls ip
    71. R3(config)#interface loopback 0
    72. R3(config-if)#ip router isis
    73. R3(config-if)#router bgp 1
    74. R3(config-router)#bgp router-id 3.3.3.3
    75. R3(config-router)#neighbor 2.2.2.2 remote-as 1
    76. R3(config-router)#neighbor 2.2.2.2 update-source loopback 0
    77. R3(config-router)#address-family vpnv4 unicast
    78. R3(config-router-af)#neighbor 2.2.2.2 activate
    79. R4(config)#router isis
    80. R4(config-router)#net 49.0002.0000.0000.0004.00
    81. R4(config)#mpls label protocol ldp
    82. R4(config)#mpls label range 400 499
    83. R4(config)#mpls ldp router-id loopback 0
    84. R4(config)#interface loopback 0
    85. R4(config-if)#ip router isis
    86. R4(config-if)#interface e0/1
    87. R4(config-if)#ip router isis
    88. R4(config-if)#mpls ip
    89. R4(config-if)#router bgp 2
    90. R4(config-router)#bgp router-id 4.4.4.4
    91. R4(config-router)#neighbor 5.5.5.5 remote-as 2
    92. R4(config-router)#neighbor 5.5.5.5 update-source loopback 0
    93. R4(config-router)#address-family vpnv4 unicast
    94. R4(config-router-af)#neighbor 5.5.5.5 activate
    95. R5(config)#router isis
    96. R5(config-router)#net 49.0002.0000.0000.0005.00
    97. R5(config)#mpls label protocol ldp
    98. R5(config)#mpls label range 500 599
    99. R5(config)#mpls ldp router-id loopback 0
    100. R5(config)#interface loopback 0
    101. R5(config-if)#ip router isis
    102. R5(config-if)#interface e0/1
    103. R5(config-if)#ip router isis
    104. R5(config-if)#mpls ip
    105. R5(config-if)#interface e0/0
    106. R5(config-if)#ip router isis
    107. R5(config-if)#mpls ip
    108. R5(config-if)#router bgp 2
    109. R5(config-router)#bgp router-id 5.5.5.5
    110. R5(config-router)#neighbor 4.4.4.4 remote-as 2
    111. R5(config-router)#neighbor 4.4.4.4 update-source loopback 0
    112. R5(config-router)#neighbor 6.6.6.6 remote-as 2
    113. R5(config-router)#neighbor 6.6.6.6 update-source loopback 0
    114. R5(config-router)#address-family vpnv4 unicast
    115. R5(config-router-af)#neighbor 4.4.4.4 activate
    116. R5(config-router-af)#neighbor 4.4.4.4 route-reflector-client
    117. R5(config-router-af)#neighbor 6.6.6.6 activate
    118. R5(config-router-af)#neighbor 6.6.6.6 route-reflector-client
    119. R6(config)#ip vrf vpn
    120. R6(config-vrf)#rd 100:100
    121. R6(config-vrf)#route-target 100:100
    122. R6(config)#router isis
    123. R6(config-router)#net 49.0002.0000.0000.0006.00
    124. R6(config)#mpls label protocol ldp
    125. R6(config)#mpls label range 600 699
    126. R6(config)#mpls ldp router-id loopback 0
    127. R6(config)#interface loopback 0
    128. R6(config-if)#ip router isis
    129. R6(config-if)#interface e0/0
    130. R6(config-if)#ip router isis
    131. R6(config-if)#mpls ip
    132. R6(config-if)#interface e0/1
    133. R6(config-if)#ip vrf forwarding vpn
    134. R6(config-if)#router ospf 1 vrf vpn
    135. R6(config-router)#router-id 6.6.6.6
    136. R6(config-router)#redistribute bgp 2 subnets
    137. R6(config-router)#net 68.68.68.6 0.0.0.0 area 0
    138. R6(config-router)#router bgp 2
    139. R6(config-router)#bgp router-id 6.6.6.6
    140. R6(config-router)#neighbor 5.5.5.5 remote-as 2
    141. R6(config-router)#neighbor 5.5.5.5 update-source loopback 0
    142. R6(config-router)#address-family vpnv4
    143. R6(config-router-af)#neighbor 5.5.5.5 activate
    144. R6(config-router-af)#neighbor 5.5.5.5 send-community extended
    145. R6(config-router)#address-family ipv4 vrf vpn
    146. R6(config-router-af)#redistribute ospf 1

    完成R3 R4的BGP EBGP PEER,并且发送标签信息抵达对等体。

    1. R3(config)#router bgp 1
    2. R3(config-router)#neighbor 34.34.34.4 remote-as 2
    3. R3(config-router)#neighbor 34.34.34.4 send-label
    4. R3(config-router)#neighbor 34.34.34.4 weight 1
    5. R4(config)#router bgp 2
    6. R4(config-router)#neighbor 34.34.34.3 remote-as 1
    7. R4(config-router)#neighbor 34.34.34.3 send-label
    8. R4(config-router)#neighbor 34.34.34.3 weight 1

    确认BGP PEER 关系建立。

    1. R3#show ip bgp all summary
    2. For address family: IPv4 Unicast
    3. BGP router identifier 3.3.3.3, local AS number 1
    4. BGP table version is 1, main routing table version 1
    5. Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    6. 2.2.2.2 4 1 46 43 1 0 0 00:35:12 0
    7. 34.34.34.4 4 2 28 27 1 0 0 00:17:55 0
    8. For address family: VPNv4 Unicast
    9. BGP router identifier 3.3.3.3, local AS number 1
    10. BGP table version is 1, main routing table version 1
    11. Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    12. 2.2.2.2 4 1 46 43 1 0 0 00:35:12 0

    R3 R4 将各自AS的PE和RR loopback 0网络宣告进BGP。

    1. R3(config)#router bgp 1
    2. R3(config-router)#network 1.1.1.0 mask 255.255.255.0
    3. R3(config-router)#network 2.2.2.0 mask 255.255.255.0
    4. R3(config-router)#neighbor 2.2.2.2 next-hop-self
    5. R4(config)#router bgp 2
    6. R4(config-router)#network 5.5.5.0 mask 255.255.255.0
    7. R4(config-router)#network 6.6.6.0 mask 255.255.255.0
    8. R4(config-router)#neighbor 5.5.5.5 next-hop-self

    确认R3 R4 交换各自AS RR PE 路由信息。

    1. R3#show ip bgp all
    2. Network Next Hop Metric LocPrf Weight Path
    3. *> 1.1.1.0/24 23.23.23.2 30 32768 i
    4. *> 2.2.2.0/24 23.23.23.2 20 32768 i
    5. *> 5.5.5.0/24 34.34.34.4 20 1 2 i
    6. *> 6.6.6.0/24 34.34.34.4 30 1 2 i
    7. R4#show ip bgp all
    8. Network Next Hop Metric LocPrf Weight Path
    9. *> 1.1.1.0/24 34.34.34.3 30 1 1 i
    10. *> 2.2.2.0/24 34.34.34.3 20 1 1 i
    11. *> 5.5.5.0/24 45.45.45.5 20 32768 i
    12. *> 6.6.6.0/24 45.45.45.5 30 32768 i

    R2 与R5 利用loopback 0口建立MP-BGP EBGP PEER,并且保障共享路由信息下一跳不变。

    1. R2(config)#router bgp 1
    2. R2(config-router)#neighbor 5.5.5.5 remote-as 2
    3. R2(config-router)#neighbor 5.5.5.5 update-source loopback 0
    4. R2(config-router)#neighbor 5.5.5.5 ebgp-multihop 255
    5. R2(config-router)#address-family vpnv4
    6. R2(config-router-af)#neighbor 5.5.5.5 activate
    7. R2(config-router-af)#neighbor 5.5.5.5 next-hop-unchanged
    8. R5(config)#router bgp 2
    9. R5(config-router)#neighbor 2.2.2.2 remote-as 1
    10. R5(config-router)#neighbor 2.2.2.2 update-source loopback 0
    11. R5(config-router)#neighbor 2.2.2.2 ebgp-multihop 255
    12. R5(config-router)#address-family vpnv4
    13. R5(config-router-af)#neighbor 2.2.2.2 activate
    14. R5(config-router-af)#neighbor 2.2.2.2 next-hop-unchanged

    确认R2 R5 建立BGP PEER 关系,且交换PE C-network路由。

    1. R2#show ip bgp vpnv4 all summary
    2. Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    3. 1.1.1.1 4 1 78 86 9 0 0 01:06:05 2
    4. 3.3.3.3 4 1 9 16 9 0 0 00:01:48 0
    5. 5.5.5.5 4 2 11 11 1 0 0 00:00:44 2
    6. R5#show ip bgp vpnv4 all summary
    7. Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
    8. 2.2.2.2 4 1 11 12 1 0 0 00:01:04 2
    9. 4.4.4.4 4 2 10 16 9 0 0 00:02:00 0
    10. 6.6.6.6 4 2 68 70 9 0 0 00:55:05 2
    1. R2#show ip bgp vpnv4 all
    2. Network Next Hop Metric LocPrf Weight Path
    3. Route Distinguisher: 100:100
    4. *>i 7.7.7.7/32 1.1.1.1 11 100 0 ?
    5. *> 8.8.8.8/32 6.6.6.6 0 2 ?
    6. *>i 17.17.17.0/24 1.1.1.1 0 100 0 ?
    7. *> 68.68.68.0/24 6.6.6.6 0 2 ?
    8. R5#show ip bgp vpnv4 all
    9. Network Next Hop Metric LocPrf Weight Path
    10. Route Distinguisher: 100:100
    11. *> 7.7.7.7/32 1.1.1.1 0 1 ?
    12. *>i 8.8.8.8/32 6.6.6.6 11 100 0 ?
    13. *> 17.17.17.0/24 1.1.1.1 0 1 ?
    14. *>i 68.68.68.0/24 6.6.6.6 0 100 0 ?

    R3 R4上将学习到的对端AS PE RR 路由重分发进底层协议:

    1. R3(config)#access-list 56 permit 5.5.5.0 0.0.0.255
    2. R3(config)#access-list 56 permit 6.6.6.0 0.0.0.255
    3. R3(config)#route-map as2 permit 10
    4. R3(config-route-map)#match ip address 56
    5. R3(config-route-map)#router isis
    6. R3(config-router)#redistribute bgp 1 route-map as2
    7. R4(config)#access-list 12 permit 1.1.1.0 0.0.0.255
    8. R4(config)#access-list 12 permit 2.2.2.0 0.0.0.255
    9. R4(config)#route-map as1 permit 10
    10. R4(config-route-map)#match ip address 12
    11. R4(config-route-map)#router isis
    12. R4(config-router)#redistribute bgp 2 route-map as2

    验证R7 R8 是否学习对端路由,且是否可以PING 通。

    1. R7#show ip route ospf
    2. Gateway of last resort is not set
    3. 8.0.0.0/32 is subnetted, 1 subnets
    4. O IA 8.8.8.8 [110/11] via 17.17.17.1, 00:00:41, Ethernet0/1
    5. 68.0.0.0/24 is subnetted, 1 subnets
    6. O IA 68.68.68.0 [110/11] via 17.17.17.1, 00:00:41, Ethernet0/1

    如上现象表明R7 R8已经通过MPLS VPN 交换路由信息。

    1. R8#ping 7.7.7.7 source 8.8.8.8
    2. Type escape sequence to abort.
    3. Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds:
    4. Packet sent with a source address of 8.8.8.8
    5. !!!!!
    6. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms

  • 相关阅读:
    麒麟信安携手河南IT联盟召开 《麒麟信安信创应用解决方案》线上分享会
    Linux 中查看本机的子网掩码和网关
    【大体思路】rv1126 跑通 yolov5
    Android音乐播放器(三)轮播图
    Python1-Pillow库简单使用
    Flutter笔记:关于Flutter中的大文件上传(上)
    oracle查询历史SQL记录
    人类历史上第一个人工神经元模型为mp模型有何不提出
    CentOS 安装MySQL 详细教程
    我有 7种 实现web实时消息推送的方案,7种!
  • 原文地址:https://blog.csdn.net/qq_43210022/article/details/125784248