实验:跨域MPLS OptionB方案-无RR场景及RR场景

张开发
2026/4/11 6:26:06 15 分钟阅读

分享文章

实验:跨域MPLS OptionB方案-无RR场景及RR场景
OptionB方案中ASBR-PE无需维护vpn-instanceASBR-PE之间通过MP-EBGP交换从PE接收到的VPNv4路由信息一、无RR场景实验拓扑规划AS内运行OSPF现实互通PE与CE之间运行OSPF实现互通AS内PE与ASBR-PE之间建立MP-IBGP对等体AS间ASBR-PE之间建立MP-EBGP对等体关系不对接收的VPNv4路由进行VPN-Target过虑使能ASBR-PE按下一跳分配标签配置思路、AS域内基础IP、MPLS、MPLS LDP配置、AS域内PE与ASBRPE之间建立MPIBGP对等体关系、AS域内PE绑定vpn-instance并与CE实现互通4、ASBR-PE互联接口使能MPLS并建立MP-EBGP对等体关系配置内容CE1# sysname CE1 # interface GigabitEthernet0/0/0 ip address 192.168.100.1 255.255.255.0 # interface LoopBack0 ip address 192.168.1.1 255.255.255.0 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.100.0 0.0.0.255PE1# sysname PE1 ip vpn-instance vpna ipv4-family route-distinguisher 100:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 1.1.1.1 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip binding vpn-instance vpna ip address 192.168.100.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 10.10.100.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # bgp 100 router-id 1.1.1.1 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable # ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable # ipv4-family vpn-instance vpna import-route ospf 2 # ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.10.100.0 0.0.0.255 # ospf 2 vpn-instance vpna import-route bgp area 0.0.0.0 network 192.168.100.0 0.0.0.255P1# sysname P1 # mpls lsr-id 2.2.2.2 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.100.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 10.10.101.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.10.100.0 0.0.0.255 network 10.10.101.0 0.0.0.255ASBR-PE1# sysname ASBR-PE1 # mpls lsr-id 3.3.3.3 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.101.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 10.10.102.1 255.255.255.0 mpls # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # bgp 100 router-id 3.3.3.3 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack0 peer 10.10.102.2 as-number 200 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 10.10.102.2 enable # ipv4-family vpnv4 undo policy vpn-target apply-label per-nexthop peer 1.1.1.1 enable peer 10.10.102.2 enable # ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.10.101.0 0.0.0.255ASBR-PE2# sysname ASBR-PE2 # mpls lsr-id 4.4.4.4 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.102.2 255.255.255.0 mpls # interface GigabitEthernet0/0/1 ip address 10.10.103.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 4.4.4.4 255.255.255.255 # bgp 200 router-id 4.4.4.4 peer 6.6.6.6 as-number 200 peer 6.6.6.6 connect-interface LoopBack0 peer 10.10.102.1 as-number 100 # ipv4-family unicast undo synchronization peer 6.6.6.6 enable peer 10.10.102.1 enable # ipv4-family vpnv4 undo policy vpn-target apply-label per-nexthop peer 6.6.6.6 enable peer 10.10.102.1 enable # ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 10.10.103.0 0.0.0.255P2# sysname P2 # mpls lsr-id 5.5.5.5 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.103.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 10.10.104.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 5.5.5.5 255.255.255.255 # ospf 1 router-id 5.5.5.5 area 0.0.0.0 network 5.5.5.5 0.0.0.0 network 10.10.103.0 0.0.0.255 network 10.10.104.0 0.0.0.255PE2# sysname PE2 # ip vpn-instance vpna ipv4-family route-distinguisher 200:6 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 6.6.6.6 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.104.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip binding vpn-instance vpna ip address 192.168.200.2 255.255.255.0 # interface LoopBack0 ip address 6.6.6.6 255.255.255.255 # bgp 200 router-id 6.6.6.6 peer 4.4.4.4 as-number 200 peer 4.4.4.4 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 4.4.4.4 enable # ipv4-family vpnv4 policy vpn-target peer 4.4.4.4 enable # ipv4-family vpn-instance vpna import-route ospf 2 # ospf 1 router-id 6.6.6.6 area 0.0.0.0 network 6.6.6.6 0.0.0.0 network 10.10.104.0 0.0.0.255 # ospf 2 vpn-instance vpna import-route bgp area 0.0.0.0 network 192.168.200.0 0.0.0.255CE2# sysname CE2 # interface GigabitEthernet0/0/0 ip address 192.168.200.1 255.255.255.0 # interface LoopBack0 ip address 192.168.2.1 255.255.255.0 # ospf 2 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 192.168.200.0 0.0.0.255验证ASBR-PE1路由信息ASBR-PE2路由信息CE1 ping CE2抓包情况ASBR-PE1 G0/0/1接口抓包ASBR-PE2 G0/0/0接口抓包二、RR场景实验拓扑AS域内PE、ASBR-PE作为RR的客户端建立MP-IBGP对等体关系RR不再转发数据无需配置MPLS、MPLS LDP关键点RR同样需要不对接收的VPNv4路由进行过滤同时向PE和ASBR-PE发送路由时不改变下一跳属性确保数据流量不经过RR配置内容这里只列出AS 100内的配置AS200内的配置忽略PE1# sysname PE1 # ip vpn-instance vpna ipv4-family route-distinguisher 100:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity # mpls lsr-id 1.1.1.1 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip binding vpn-instance vpna ip address 192.168.100.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 10.10.100.1 255.255.255.0 mpls mpls ldp # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # bgp 100 router-id 1.1.1.1 peer 7.7.7.7 as-number 100 peer 7.7.7.7 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 7.7.7.7 enable # ipv4-family vpnv4 policy vpn-target peer 7.7.7.7 enable # ipv4-family vpn-instance vpna import-route ospf 2 # ospf 1 router-id 1.1.1.1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 10.10.100.0 0.0.0.255 # ospf 2 vpn-instance vpna import-route bgp area 0.0.0.0 network 192.168.100.0 0.0.0.255P1# sysname P1 # mpls lsr-id 2.2.2.2 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.100.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 10.10.101.1 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/2 ip address 10.10.27.2 255.255.255.0 # interface NULL0 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 10.10.27.0 0.0.0.255 network 10.10.100.0 0.0.0.255 network 10.10.101.0 0.0.0.255RR1# sysname RR1 # interface GigabitEthernet0/0/0 ip address 10.10.27.7 255.255.255.0 # interface LoopBack0 ip address 7.7.7.7 255.255.255.255 # bgp 100 router-id 7.7.7.7 peer 1.1.1.1 as-number 100 peer 1.1.1.1 connect-interface LoopBack0 peer 3.3.3.3 as-number 100 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 3.3.3.3 enable # ipv4-family vpnv4 undo policy vpn-target peer 1.1.1.1 enable peer 1.1.1.1 reflect-client peer 1.1.1.1 next-hop-invariable peer 3.3.3.3 enable peer 3.3.3.3 reflect-client peer 3.3.3.3 next-hop-invariable # ospf 1 router-id 7.7.7.7 area 0.0.0.0 network 7.7.7.7 0.0.0.0 network 10.10.27.0 0.0.0.255ASBR-PE1# sysname ASBR-PE1 # mpls lsr-id 3.3.3.3 mpls # mpls ldp # # interface GigabitEthernet0/0/0 ip address 10.10.101.2 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 10.10.102.1 255.255.255.0 mpls # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # bgp 100 router-id 3.3.3.3 peer 7.7.7.7 as-number 100 peer 7.7.7.7 connect-interface LoopBack0 peer 10.10.102.2 as-number 200 # ipv4-family unicast undo synchronization peer 7.7.7.7 enable peer 10.10.102.2 enable # ipv4-family vpnv4 undo policy vpn-target apply-label per-nexthop peer 7.7.7.7 enable peer 10.10.102.2 enable # ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 10.10.101.0 0.0.0.255验证PE1上192.168.2.1的路由信息ASBR-PE1上192.168.2.1的路由信息CE1测试连通性

更多文章