MPLS VPN Option C 方式 試驗及理解
預設情況下,未使能處理標籤路由能力。
如
ASBR-PE1 配置:
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
peer 192.1.1.2 as-number 200
#
ospf 1
import-route bgp
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 152.1.1.0 0.0.0.255
#
route-policy policy1 permit node 1
apply mpls-label
#
route-policy policy2 permit node 1
if-match mpls-label
apply mpls-label
undo synchronization
network 1.1.1.9 255.255.255.255
peer 1.1.1.9 enable
peer 1.1.1.9 route-policy policy2 export
peer 1.1.1.9 next-hop-local
peer 1.1.1.9 label-route-capability
peer 192.1.1.2 enable
peer 192.1.1.2 route-policy policy1 export
peer 192.1.1.2 label-route-capability
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
return
PE1 配置:
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
peer 4.4.4.9 as-number 200
peer 4.4.4.9 ebgp-max-hop 255
peer 4.4.4.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
peer 2.2.2.9 next-hop-local
peer 2.2.2.9 label-route-capability
peer 4.4.4.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 4.4.4.9 enable
#
ipv4-family vpn-instance vpn1
import-route direct
peer 10.1.1.1 as-number 101
peer 10.1.1.1 ebgp-max-hop 2
可以看到 PE1 上有到4.4.4.9的 lsp 路徑,該路徑通過BGP LSP建立
在ASBR-PE2上去掉 peer 4.4.4.9 route-policy policy2 export 命令,可以看到PE2上沒有到1.1.1.9 的MPLS 路徑。
ASBR-PE2 部分配置如下:
bgp 200
peer 4.4.4.9 as-number 200
peer 4.4.4.9 connect-interface LoopBack1
peer 192.1.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 4.4.4.9 255.255.255.255
peer 4.4.4.9 enable
peer 4.4.4.9 next-hop-local
peer 4.4.4.9 label-route-capability
peer 192.1.1.1 enable
peer 192.1.1.1 route-policy policy1 export
peer 192.1.1.1 label-route-capability
#
ipv4-family vpnv4
policy vpn-target
peer 4.4.4.9 enable