跨域的OptionC配置和标签分配分析
isis network-entity 47.0001.0000.0000.0003.00
# 配置到ASBR2的接口,并在此接口启用MPLS
interface Ethernet2/0/4 undo shutdown negotiation auto ip address 10.0.0.26 255.255.255.252
mpls
# 配置到RR1的接口,并在此接口启用MPLS LDP
interface Ethernet2/0/6 undo shutdown negotiation auto ip address 10.0.0.21 255.255.255.252 isis enable mpls mpls ldp
# 创建loopback 接口0,在接口上运行ISIS
interface LoopBack0 ip address 1.1.1.3 255.255.255.255 isis enable
# 创建访问列表 2900,允许PE1的loopback接口 0的主机地址通过
acl number 2900
rule 0 permit source 1.1.1.10 0
# 在ASBR1上运行BGP,AS号 100,配置到RR1的IBGP对等体组,配置到ASBR2的
EBGP对等体组,引用路由策略rr和asbr在EBGP对等体组和IBGP对等体组上
bgp 100 network 1.1.1.8 255.255.255.255 network 1.1.1.10 255.255.255.255 undo synchronization group EXT external peer EXT as-number 200 peer EXT label-route-capability peer EXT route-policy rr export peer 10.0.0.25 group EXT group RR1 internal peer RR1 label-route-capability peer RR1 next-hop-local peer RR1 route-policy asbr export peer 1.1.1.8 group RR1
peer RR1 connect-interface LoopBack0
# 配置路由策略rr和asbr
华为技术有限公司
第 4 页
跨域的OptionC配置和标签分配分析
route-policy rr permit node 0 if-match acl 2900 if-match ip-prefix pe apply mpls-label route-policy rr permit node 1 route-policy asbr permit node 0 if-match mpls-label apply mpls-label
route-policy asbr permit node 1
# 创建前缀列表 pe,允许PE1的loopback接口 0的主机地址通过
ip ip-prefix pe index 10 permit 1.1.1.10 32
4.2 A市RR1 配置
router id 1.1.1.8 mpls lsr-id 1.1.1.8
# 配置Router ID为loopback接口 0的地址
# 配置MPLS LSR ID为loopback接口 0的地址
# 启用MPLS LDP
mpls ldp
# 启用ISIS为IGP路由协议,network entity为47.0001
isis network-entity 47.0001.0000.0000.0008.00 silent-interface LoopBack0 interface Ethernet2/2/0 ip address 10.0.0.201 255.255.255.252 isis enable mpls mpls ldp
# 配置到PE1的接口,并在此接口启用MPLS LDP
# 配置到ASBR1的接口,并在此接口启用MPLS LDP
interface Ethernet4/2/0 ip address 10.0.0.22 255.255.255.252 isis enable mpls
mpls ldp
# 创建loopback 接口0,在接口上运行ISIS
interface LoopBack0 ip address 1.1.1.8 255.255.255.255
isis enable
# 在RR1上运行BGP,AS号 100,配置到PE1,ASBR1的IBGP对等体组,配置到RR2的
EBGP对等体组
bgp 100 undo synchronization group PE1 internal peer PE1 advertise-community peer PE1 connect-interface LoopBack0
peer PE1 label-route-capability
peer 1.1.1.10 group PE1 group ASBR1 internal peer ASBR1 connect-interface LoopBack0
peer ASBR1 label-route-capability
华为技术有限公司 第 5 页
跨域的OptionC配置和标签分配分析
peer 1.1.1.3 group ASBR1 group RR external peer RR ebgp-max-hop peer RR connect-interface LoopBack0 peer 1.1.1.1 group RR as-number 200
# 配置到PE1的VPNv4对等体组,配置到RR2的VPNv4对等体组 ipv4-family vpnv4 peer RR enable peer RR next-hop-invariable peer 1.1.1.1 group RR peer PE1 enable peer PE1 reflect-client peer 1.1.1.10 group PE1
4.3 A市 PE1 配置
router id 1.1.1.10
# 配置Router ID为loopback接口 0的地址
# 配置MPLS LSR ID为loopback接口 0的地址
mpls lsr-id 1.1.1.10
# 启用MPLS LDP
mpls ldp
# 启用ISIS为IGP路由协议,network entity为47.0001
isis network-entity 47.0001.0000.0000.0010.00 silent-interface LoopBack0
# 配置VPN实例,配置RD,RT
ip vpn-instance vpna route-distinguisher 1:1 vpn-target 1:1 export-extcommunity vpn-target 1:1 import-extcommunity
# 配置到RR1的接口,并在此接口启用MPLS LDP
interface Ethernet2/2/0 ip address 10.0.0.202 255.255.255.252 isis enable mpls mpls ldp
# 创建loopback 接口0,在接口上运行ISIS
interface LoopBack0 ip address 1.1.1.10 255.255.255.255
isis enable
# 创建loopback 接口200,将接口加入VPN实例vpna
interface LoopBack200 ip binding vpn-instance vpna ip address 200.1.1.1 255.255.255.0
# 在PE1上运行BGP,AS号 100,配置到RR的IBGP对等体组RR1
bgp 100 network 100.1.1.1 255.255.255.255 undo synchronization group RR internal peer RR label-route-capability
华为技术有限公司 第 6 页
跨域的OptionC配置和标签分配分析
peer RR connect-interface LoopBack0
peer 1.1.1.8 group RR
# 将直连端口loopback 200引入vpna的路由表
ipv4-family vpn-instance vpna import-route direct undo synchronization # 配置到
RR1的VPNv4对等体组
ipv4-family vpnv4 peer RR enable peer 1.1.1.8 group RR
PE2,RR2,ASBR2的配置和PE1,RR1,ASBR1的配置类同,略。
等待所有bgp邻居连接建立以后,在PE1、PE2上可以看到对方的IPV4路由200.1.1.1、201.1.1.1,使用display bgp routing-table label、display mpls lsp,display bgp vpn all routing-table label命令可以看到BGP+、私网VPNv4、公网MPLS的label,可以看到从对方学到的VPNV4路由。隧道建立成功后,属于一个VPN的CE之间可以ping通。
5 标签分配
5.1 从AS100内VPNA 发往AS200 VPNA 报文的标签 分配图
5.2 从AS200内VPNA 发往AS100 VPNA 报文的标签 分配图
华为技术有限公司 第 7 页
相关推荐: