拓扑图
配置
配置接口IP地址
配置VPN-Instance,RD,RT
配置ISIS
配置MPLS,针对BGP标签路由生成LSP标签转发路径,ASBR的互联接口开启MPLS
配置BGP,开启通告标签路由的能力,在ASBR的IGP中引入BGP
配置MP-BGP,通告路由
PC tracert查看标签转发路径,无需配置undo ttl expiration pop,ASBR间2层标签,可迭代到lsp隧道
sysname AR1
#
ip vpn-instance BJ
ipv4-family
route-distinguisher 100:1
vpn-target 100:1 export-extcommunity
vpn-target 200:6 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0001.00
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance BJ
ip address 10.0.1.254 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
isis enable 1
#
bgp 100
undo default ipv4-unicast
peer 6.6.6.6 as-number 200
peer 6.6.6.6 ebgp-max-hop 255
peer 6.6.6.6 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
undo peer 6.6.6.6 enable
#
ipv4-family vpnv4
policy vpn-target
peer 6.6.6.6 enable
#
ipv4-family vpn-instance BJ
network 10.0.1.0 255.255.255.0
#
sysname AR2
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0002.00
#
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 23.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
isis enable 1
#
sysname AR3
#
mpls lsr-id 3.3.3.3
mpls
lsp-trigger bgp-label-route
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0003.00
import-route bgp
#
interface GigabitEthernet0/0/0
ip address 23.1.1.3 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 34.1.1.3 255.255.255.0
mpls
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
isis enable 1
#
bgp 100
peer 34.1.1.4 as-number 200
#
ipv4-family unicast
undo synchronization
network 1.1.1.1 255.255.255.255
peer 34.1.1.4 enable
peer 34.1.1.4 route-policy ASBR-Label export
peer 34.1.1.4 label-route-capability
#
route-policy ASBR-Label permit node 10
apply mpls-label
#
sysname AR4
#
mpls lsr-id 4.4.4.4
mpls
lsp-trigger bgp-label-route
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0004.00
import-route bgp
#
interface GigabitEthernet0/0/0
ip address 34.1.1.4 255.255.255.0
mpls
#
interface GigabitEthernet0/0/1
ip address 45.1.1.4 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
isis enable 1
#
bgp 200
peer 34.1.1.3 as-number 100
#
ipv4-family unicast
undo synchronization
network 6.6.6.6 255.255.255.255
peer 34.1.1.3 enable
peer 34.1.1.3 route-policy ASBR-Label export
peer 34.1.1.3 label-route-capability
#
route-policy ASBR-Label permit node 10
apply mpls-label
#
sysname AR5
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0005.00
#
interface GigabitEthernet0/0/0
ip address 45.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 56.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
isis enable 1
#
sysname AR6
#
ip vpn-instance SH
ipv4-family
route-distinguisher 200:6
vpn-target 200:6 export-extcommunity
vpn-target 100:1 import-extcommunity
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
isis 1
is-level level-2
network-entity 49.0000.0000.0000.0006.00
#
interface GigabitEthernet0/0/0
ip address 56.1.1.6 255.255.255.0
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance SH
ip address 10.0.2.254 255.255.255.0
#
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
isis enable 1
#
bgp 200
undo default ipv4-unicast
peer 1.1.1.1 as-number 100
peer 1.1.1.1 ebgp-max-hop 255
peer 1.1.1.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
undo peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance SH
network 10.0.2.0 255.255.255.0
#
查看MP-BGP邻居
查看BGP路由
PC1访问PC2,查看路径
AR1访问AR6查看标签路径
查看VPNv4标签
查看MPLS标签
查看BGP标签