华为NE40E路由器实验配置示例 | 配置L3VdPdNd over IS-IS SR-MPLS Flex-Algo LSP基于亲和属性算路

Posted COCOgsta

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了华为NE40E路由器实验配置示例 | 配置L3VdPdNd over IS-IS SR-MPLS Flex-Algo LSP基于亲和属性算路相关的知识,希望对你有一定的参考价值。

素材来源:《华为NetEngine40E用户手册》

组网需求

图1所示:

  • CE1、CE2属于vpna。

  • vpna使用的VPN-target属性为111:1。

配置L3VPN迭代IS-IS SR-MPLS Flex-Algo LSP,保证相同VPN用户之间的安全互访。同时由于公网PE之间存在多条链路,要求数据流量在指定链路PE1-P1-PE2上进行转发。

本例通过定义亲和属性,来支持vpna的业务需求。

图1 L3VPN迭代IS-IS SR-MPLS Flex-Algo LSP基于亲和属性算路组网图

 配置思路

  1. 配置接口的IP地址。

  2. 骨干网上配置IS-IS实现PE之间的互通。

  3. 骨干网上使能MPLS。

  4. 配置Flex-Algo算法定义。
  5. 配置Segment Routing,同时使能IS-IS发布灵活算法能力,建立普通SR LSP和Flex-Algo LSP。

  6. 在PE设备为路由配置扩展团体属性Color,可以使用入口策略也可以使用出口策略,本例使用出口策略在发布路由时设置扩展团体属性Color。
  7. PE之间配置MP-IBGP交换路由信息。

  8. PE上配置使能IPv4地址族VPN实例,并把与CE相连的接口和相应的VPN实例绑定。
  9. 配置扩展团体属性Color与Flex-Algo的映射关系。
  10. 在PE设备上配置隧道选择策略,优选Flex-Algo LSP。
  11. PE与CE之间配置EBGP交换路由信息。

操作步骤

1. 配置接口的IP地址。

# 配置PE1。

<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] interface loopback 1
[*PE1-LoopBack1] ip address 1.1.1.9 32
[*PE1-LoopBack1] quit
[*PE1] interface gigabitethernet1/0/0
[*PE1-GigabitEthernet1/0/0] ip address 172.18.1.1 24
[*PE1-GigabitEthernet1/0/0] quit
[*PE1] interface gigabitethernet3/0/0
[*PE1-GigabitEthernet3/0/0] ip address 172.16.1.1 24
[*PE1-GigabitEthernet3/0/0] quit
[*PE1] commit

# 配置P1。

<HUAWEI> system-view
[~HUAWEI] sysname P1
[*HUAWEI] commit
[~P1] interface loopback 1
[*P1-LoopBack1] ip address 2.2.2.9 32
[*P1-LoopBack1] quit
[*P1] interface gigabitethernet1/0/0
[*P1-GigabitEthernet1/0/0] ip address 172.16.1.2 24
[*P1-GigabitEthernet1/0/0] quit
[*P1] interface gigabitethernet2/0/0
[*P1-GigabitEthernet2/0/0] ip address 172.17.1.1 24
[*P1-GigabitEthernet2/0/0] quit
[*P1] commit

# 配置PE2。

<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] interface loopback 1
[*PE2-LoopBack1] ip address 3.3.3.9 32
[*PE2-LoopBack1] quit
[*PE2] interface gigabitethernet1/0/0
[*PE2-GigabitEthernet1/0/0] ip address 172.19.1.2 24
[*PE2-GigabitEthernet1/0/0] quit
[*PE2] interface gigabitethernet3/0/0
[*PE2-GigabitEthernet3/0/0] ip address 172.17.1.2 24
[*PE2-GigabitEthernet3/0/0] quit
[*PE2] commit

# 配置P2。

<HUAWEI> system-view
[~HUAWEI] sysname P2
[*HUAWEI] commit
[~P2] interface loopback 1
[*P2-LoopBack1] ip address 4.4.4.9 32
[*P2-LoopBack1] quit
[*P2] interface gigabitethernet1/0/0
[*P2-GigabitEthernet1/0/0] ip address 172.18.1.2 24
[*P2-GigabitEthernet1/0/0] quit
[*P2] interface gigabitethernet2/0/0
[*P2-GigabitEthernet2/0/0] ip address 172.19.1.1 24
[*P2-GigabitEthernet2/0/0] quit
[*P2] commit

2. 在骨干网上配置IGP协议,实现骨干网PE和P的互通。本例中以IS-IS为例进行说明

# 配置PE1。

[~PE1] isis 1
[*PE1-isis-1] is-level level-1
[*PE1-isis-1] network-entity 10.0000.0000.0001.00
[*PE1-isis-1] quit
[*PE1] interface loopback 1
[*PE1-LoopBack1] isis enable 1
[*PE1-LoopBack1] quit
[*PE1] interface gigabitethernet1/0/0
[*PE1-GigabitEthernet1/0/0] isis enable 1
[*PE1-GigabitEthernet1/0/0] quit
[*PE1] interface gigabitethernet3/0/0
[*PE1-GigabitEthernet3/0/0] isis enable 1
[*PE1-GigabitEthernet3/0/0] quit
[*PE1] commit

# 配置P1。

[~P1] isis 1
[*P1-isis-1] is-level level-1
[*P1-isis-1] network-entity 10.0000.0000.0002.00
[*P1-isis-1] quit
[*P1] interface loopback 1
[*P1-LoopBack1] isis enable 1
[*P1-LoopBack1] quit
[*P1] interface gigabitethernet1/0/0
[*P1-GigabitEthernet1/0/0] isis enable 1
[*P1-GigabitEthernet1/0/0] quit
[*P1] interface gigabitethernet2/0/0
[*P1-GigabitEthernet2/0/0] isis enable 1
[*P1-GigabitEthernet2/0/0] quit
[*P1] commit

# 配置PE2。

[~PE2] isis 1
[*PE2-isis-1] is-level level-1
[*PE2-isis-1] network-entity 10.0000.0000.0003.00
[*PE2-isis-1] quit
[*PE2] interface loopback 1
[*PE2-LoopBack1] isis enable 1
[*PE2-LoopBack1] quit
[*PE2] interface gigabitethernet3/0/0
[*PE2-GigabitEthernet3/0/0] isis enable 1
[*PE2-GigabitEthernet3/0/0] quit
[*PE2] interface gigabitethernet1/0/0
[*PE2-GigabitEthernet1/0/0] isis enable 1
[*PE2-GigabitEthernet1/0/0] quit
[*PE2] commit

# 配置P2。

[~P2] isis 1
[*P2-isis-1] is-level level-1
[*P2-isis-1] network-entity 10.0000.0000.0004.00
[*P2-isis-1] quit
[*P2] interface loopback 1
[*P2-LoopBack1] isis enable 1
[*P2-LoopBack1] quit
[*P2] interface gigabitethernet1/0/0
[*P2-GigabitEthernet1/0/0] isis enable 1
[*P2-GigabitEthernet1/0/0] quit
[*P2] interface gigabitethernet2/0/0
[*P2-GigabitEthernet2/0/0] isis enable 1
[*P2-GigabitEthernet2/0/0] quit
[*P2] commit

3. (可选)在骨干网上配置MPLS基本能力

当接口下使能IS-IS功能后,接口自动使能MPLS能力,所以也可以忽略此步骤。

# 配置PE1。

[~PE1] mpls lsr-id 1.1.1.9
[*PE1] mpls
[*PE1-mpls] commit
[~PE1-mpls] quit

# 配置P1。

[~P1] mpls lsr-id 2.2.2.9
[*P1] mpls
[*P1-mpls] commit
[~P1-mpls] quit

# 配置PE2。

[~PE2] mpls lsr-id 3.3.3.9
[*PE2] mpls
[*PE2-mpls] commit
[~PE2-mpls] quit

# 配置P2。

[~P2] mpls lsr-id 4.4.4.9
[*P2] mpls
[*P2-mpls] commit
[~P2-mpls] quit

4. 配置Flex-Algo链路属性

# 配置PE1。

[~PE1] te attribute enable            
[*PE1] path-constraint affinity-mapping
[*PE1-pc-af-map] attribute green bit-sequence 1
[*PE1-pc-af-map] attribute red bit-sequence 9
[*PE1-pc-af-map] quit
[*PE1] interface gigabitethernet1/0/0
[*PE1-GigabitEthernet1/0/0] te link-attribute-application flex-algo  
[*PE1-GigabitEthernet1/0/0-te-link-attribute-application] link administrative group name red      
[*PE1-GigabitEthernet1/0/0-te-link-attribute-application] quit
[*PE1-GigabitEthernet1/0/0] quit 
[*PE1] interface gigabitethernet3/0/0
[*PE1-GigabitEthernet3/0/0] te link-attribute-application flex-algo
[*PE1-GigabitEthernet3/0/0-te-link-attribute-application] link administrative group name green
[*PE1-GigabitEthernet3/0/0-te-link-attribute-application] quit                           
[*PE1-GigabitEthernet3/0/0] quit                                       
[*PE1] commit

# 配置P1。

[~P1] te attribute enable            
[*P1] path-constraint affinity-mapping
[*P1-pc-af-map] attribute green bit-sequence 1
[*P1-pc-af-map] attribute red bit-sequence 9
[*P1-pc-af-map] quit
[*P1] interface gigabitethernet1/0/0
[*P1-GigabitEthernet1/0/0] te link-attribute-application flex-algo  
[*P1-GigabitEthernet1/0/0-te-link-attribute-application] link administrative group name green      
[*P1-GigabitEthernet1/0/0-te-link-attribute-application] quit
[*P1-GigabitEthernet1/0/0] quit 
[*P1] interface gigabitethernet2/0/0
[*P1-GigabitEthernet2/0/0] te link-attribute-application flex-algo
[*P1-GigabitEthernet2/0/0-te-link-attribute-application] link administrative group name green
[*P1-GigabitEthernet2/0/0-te-link-attribute-application] quit                           
[*P1-GigabitEthernet2/0/0] quit                                       
[*P1] commit

# 配置PE2。

[~PE2] te attribute enable            
[*PE2] path-constraint affinity-mapping
[*PE2-pc-af-map] attribute green bit-sequence 1
[*PE2-pc-af-map] attribute red bit-sequence 9
[*PE2-pc-af-map] quit
[*PE2] interface gigabitethernet1/0/0
[*PE2-GigabitEthernet1/0/0] te link-attribute-application flex-algo  
[*PE2-GigabitEthernet1/0/0-te-link-attribute-application] link administrative group name red      
[*PE2-GigabitEthernet1/0/0-te-link-attribute-application] quit
[*PE2-GigabitEthernet1/0/0] quit 
[*PE2] interface gigabitethernet3/0/0
[*PE2-GigabitEthernet3/0/0] te link-attribute-application flex-algo
[*PE2-GigabitEthernet3/0/0-te-link-attribute-application] link administrative group name green
[*PE2-GigabitEthernet3/0/0-te-link-attribute-application] quit                           
[*PE2-GigabitEthernet3/0/0] quit                                       
[*PE2] commit

# 配置P2。

[~P2] te attribute enable            
[*P2] path-constraint affinity-mapping
[*P2-pc-af-map] attribute green bit-sequence 1
[*P2-pc-af-map] attribute red bit-sequence 9
[*P2-pc-af-map] quit
[*P2] interface gigabitethernet1/0/0
[*P2-GigabitEthernet1/0/0] te link-attribute-application flex-algo  
[*P2-GigabitEthernet1/0/0-te-link-attribute-application] link administrative group name red      
[*P2-GigabitEthernet1/0/0-te-link-attribute-application] quit
[*P2-GigabitEthernet1/0/0] quit 
[*P2] interface gigabitethernet2/0/0
[*P2-GigabitEthernet2/0/0] te link-attribute-application flex-algo
[*P2-GigabitEthernet2/0/0-te-link-attribute-application] link administrative group name red
[*P2-GigabitEthernet2/0/0-te-link-attribute-application] quit                           
[*P2-GigabitEthernet2/0/0] quit                                       
[*P2] commit

5. 配置Flex-Algo算法定义

# 配置PE1。

[~PE1] flex-algo identifier 128 
[*PE1-flex-algo-128] priority 100   
[*PE1-flex-algo-128] affinity include-all green
[*PE1-flex-algo-128] quit
[*PE1] commit

# 配置P1。

[~P1] flex-algo identifier 128 
[*P1-flex-algo-128] priority 100   
[*P1-flex-algo-128] affinity include-all green
[*P1-flex-algo-128] quit
[*P1] commit

# 配置PE2。

[~PE2] flex-algo identifier 128 
[*PE2-flex-algo-128] priority 100   
[*PE2-flex-algo-128] affinity include-all green
[*PE2-flex-algo-128] quit
[*PE2] commit

# 配置P2。

[~P2] flex-algo identifier 128     
[*P2-flex-algo-128] priority 100
[*P2-flex-algo-128] affinity include-all green
[*P2-flex-algo-128] quit
[*P2] commit

6. 在骨干网上配置Segment Routing,同时使能IS-IS发布灵活算法能力

# 配置PE1。

[~PE1] segment-routing
[*PE1-segment-routing] quit
[*PE1] isis 1
[*PE1-isis-1] cost-style wide
[*PE1-isis-1] traffic-eng level-1
[*PE1-isis-1] segment-routing mpls
[*PE1-isis-1] segment-routing global-block 16000 23999
[*PE1-isis-1] flex-algo 128 level-1
[*PE1-isis-1] quit
[*PE1] interface loopback 1
[*PE1-LoopBack1] isis prefix-sid index 10
[*PE1-LoopBack1] isis prefix-sid index 110 flex-algo 128
[*PE1-LoopBack1] quit
[*PE1] commit

# 配置P1。

[~P1] segment-routing
[*P1-segment-routing] quit
[*P1] isis 1
[*P1-isis-1] cost-style wide
[*P1-isis-1] traffic-eng level-1
[*P1-isis-1] segment-routing mpls
[*P1-isis-1] segment-routing global-block 16000 23999
[*P1-isis-1] flex-algo 128 level-1
[*P1-isis-1] quit
[*P1] interface loopback 1
[*P1-LoopBack1] isis prefix-sid index 20
[*P1-LoopBack1] isis prefix-sid index 220 flex-algo 128
[*P1-LoopBack1] quit
[*P1] commit

# 配置PE2。

[~PE2] segment-routing
[*PE2-segment-routing] quit
[*PE2] isis 1
[*PE2-isis-1] cost-style wide
[*PE2-isis-1] traffic-eng level-1
[*PE2-isis-1] segment-routing mpls
[*PE2-isis-1] segment-routing global-block 16000 23999
[*PE2-isis-1] flex-algo 128 level-1
[*PE2-isis-1] quit
[*PE2] interface loopback 1
[*PE2-LoopBack1] isis prefix-sid index 30
[*PE2-LoopBack1] isis prefix-sid index 330 flex-algo 128
[*PE2-LoopBack1] quit
[*PE2] commit

# 配置P2。

[~P2] segment-routing
[*P2-segment-routing] quit
[*P2] isis 1
[*P2-isis-1] cost-style wide
[*P2-isis-1] traffic-eng level-1
[*P2-isis-1] segment-routing mpls
[*P2-isis-1] segment-routing global-block 16000 23999
[*P2-isis-1] flex-algo 128 level-1
[*P2-isis-1] quit
[*P2] interface loopback 1
[*P2-LoopBack1] isis prefix-sid index 40
[*P2-LoopBack1] isis prefix-sid index 440 flex-algo 128
[*P2-LoopBack1] quit
[*P2] commit

# 配置完成后,在PE设备上执行display tunnel-info all命令,可以看到SR LSP已建立。以PE1和PE2的显示为例。

[~PE1] display tunnel-info all
Tunnel ID            Type                Destination                             Status                                             
----------------------------------------------------------------------------------------                                            
0x000000002900000003 srbe-lsp            2.2.2.9                                 UP                                                 
0x000000002900000005 srbe-lsp            4.4.4.9                                 UP                                                 
0x000000002900000006 srbe-lsp            3.3.3.9                                 UP                                                 
0x000000009300000041 flex-algo-lsp       2.2.2.9                                 UP                                                 
0x000000009300000042 flex-algo-lsp       3.3.3.9                                 UP 
[~PE2] display tunnel-info all
Tunnel ID            Type                Destination                             Status                                             
----------------------------------------------------------------------------------------                                            
0x000000002900000004 srbe-lsp            2.2.2.9                                 UP                                                 
0x000000002900000005 srbe-lsp            1.1.1.9                                 UP                                                 
0x000000002900000006 srbe-lsp            4.4.4.9                                 UP                                                 
0x000000009300000041 flex-algo-lsp       2.2.2.9                                 UP                                                 
0x000000009300000042 flex-algo-lsp       1.1.1.9                                 UP 

# 执行display segment-routing prefix mpls forwarding flex-algo命令,查看Segment Routing基于Flex-Algo的标签转发表信息。

[~PE1] display segment-routing prefix mpls forwarding flex-algo                                                                      

                   Segment Routing Prefix MPLS Forwarding Information                                                               
             --------------------------------------------------------------                                                         
             Role : I-Ingress, T-Transit, E-Egress, I&T-Ingress And Transit                                                         

Prefix             Label      OutLabel   Interface         NextHop          Role  MPLSMtu   Mtu     State      Flexalgo             
-----------------------------------------------------------------------------------------------------------------------             
1.1.1.9/32         16110      NULL       Loop1             127.0.0.1        E     ---       1500    Active       128                
2.2.2.9/32         16220      3          GE3/0/0           172.16.1.2       I&T   ---       1500    Active       128                
3.3.3.9/32         16330      16330      GE3/0/0           172.16.1.2       I&T   ---       1500    Active       128                

Total information(s): 3 
[~P1] display segment-routing prefix mpls forwarding flex-algo

                   Segment Routing Prefix MPLS Forwarding Information                                                               
             --------------------------------------------------------------                                                         
             Role : I-Ingress, T-Transit, E-Egress, I&T-Ingress And Transit                                                         

Prefix             Label      OutLabel   Interface         NextHop          Role  MPLSMtu   Mtu     State      Flexalgo             
-----------------------------------------------------------------------------------------------------------------------             
1.1.1.9/32         16110      3          GE1/0/0           172.16.1.1       I&T   ---       1500    Active       128                
2.2.2.9/32         16220      NULL       Loop1             127.0.0.1        E     ---       1500    Active       128                
3.3.3.9/32         16330      3          GE2/0/0           172.17.1.2       I&T   ---       1500    Active       128                

Total information(s): 3
[~P2] display segment-routing prefix mpls forwarding flex-algo

                   Segment Routing Prefix MPLS Forwarding Information                                                               
             --------------------------------------------------------------                                                         
             Role : I-Ingress, T-Transit, E-Egress, I&T-Ingress And Transit                                                         

Prefix             Label      OutLabel   Interface         NextHop          Role  MPLSMtu   Mtu     State      Flexalgo             
-----------------------------------------------------------------------------------------------------------------------             
4.4.4.9/32         16440      NULL       Loop1             127.0.0.1        E     ---       1500    Active       128                

Total information(s): 1 
[~PE2] display segment-routing prefix mpls forwarding flex-algo

                   Segment Routing Prefix MPLS Forwarding Information                                                               
             --------------------------------------------------------------                                                         
             Role : I-Ingress, T-Transit, E-Egress, I&T-Ingress And Transit                                                         

Prefix             Label      OutLabel   Interface         NextHop          Role  MPLSMtu   Mtu     State      Flexalgo             
-----------------------------------------------------------------------------------------------------------------------             
1.1.1.9/32         16110      16110      GE3/0/0           172.17.1.1       I&T   ---       1500    Active       128                
2.2.2.9/32         16220      3          GE3/0/0           172.17.1.1       I&T   ---       1500    Active       128                
3.3.3.9/32         16330      NULL       Loop1             127.0.0.1        E     ---       1500    Active       128                

Total information(s): 3 

7. 配置路由策略

# 配置PE1。

[~PE1] route-policy color100 permit node 1
[*PE1-route-policy] apply extcommunity color 0:100
[*PE1-route-policy] quit
[*PE1] commit

# 配置PE2。

[~PE2] route-policy color100 permit node 1
[*PE2-route-policy] apply extcommunity color 0:100
[*PE2-route-policy] quit
[*PE2] commit

8. 在PE之间建立MP-IBGP对等体关系

# 配置PE1。

[~PE1] bgp 100
[~PE1-bgp] peer 3.3.3.9 as-number 100
[*PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[*PE1-bgp] ipv4-family vpnv4
[*PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[*PE1-bgp-af-vpnv4] peer 3.3.3.9 route-policy color100 export
[*PE1-bgp-af-vpnv4] commit
[~PE1-bgp-af-vpnv4] quit
[~PE1-bgp] quit

# 配置PE2。

[~PE2] bgp 100
[~PE2-bgp] peer 1.1.1.9 as-number 100
[*PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[*PE2-bgp] ipv4-family vpnv4
[*PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[*PE2-bgp-af-vpnv4] peer 1.1.1.9 route-policy color100 export
[*PE2-bgp-af-vpnv4] commit
[~PE2-bgp-af-vpnv4] quit
[~PE2-bgp] quit

配置完成后,在PE设备上执行display bgp peerdisplay bgp vpnv4 all peer命令,可以看到PE之间的BGP对等体关系已建立,并达到Established状态。以PE1的显示为例。

[~PE1] display bgp peer

 BGP local router ID : 1.1.1.9
 Local AS number : 100
 Total number of peers : 1          Peers in established state : 1

  Peer            V    AS  MsgRcvd  MsgSent     OutQ  Up/Down    State        PrefRcv
  3.3.3.9         4   100        2        6     0     00:00:12   Established   0
[~PE1] display bgp vpnv4 all peer

 BGP local router ID : 1.1.1.9
 Local AS number : 100
 Total number of peers : 1                 Peers in established state : 1

  Peer            V    AS  MsgRcvd  MsgSent    OutQ  Up/Down    State        PrefRcv
  3.3.3.9         4   100   12      18         0     00:09:38   Established   0

9. 在PE设备上配置使能IPv4地址族的VPN实例,将CE接入PE

# 配置PE1。

[~PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*PE1-vpn-instance-vpna-af-ipv4] quit
[*PE1-vpn-instance-vpna] quit
[*PE1] interface gigabitethernet2/0/0
[*PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[*PE1-GigabitEthernet2/0/0] ip address 10.1.1.2 24
[*PE1-GigabitEthernet2/0/0] quit
[*PE1] commit

# 配置PE2。

[~PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[*PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*PE2-vpn-instance-vpna-af-ipv4] quit
[*PE2-vpn-instance-vpna] quit
[*PE2] interface gigabitethernet2/0/0
[*PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[*PE2-GigabitEthernet2/0/0] ip address 10.2.1.2 24
[*PE2-GigabitEthernet2/0/0] quit
[*PE2] commit

# 按图1配置各CE的接口IP地址,配置过程请参见后面的配置文件。

配置完成后,在PE设备上执行display ip vpn-instance verbose命令可以看到VPN实例的配置情况。各PE能ping通自己接入的CE。

10. 配置扩展团体属性Color与Flex-Algo的映射关系

# 配置PE1。

[~PE1] flex-algo color-mapping
[*PE1-flex-algo-color-mapping] color 100 flex-algo 128 
[*PE1-flex-algo-color-mapping] quit
[*PE1] commit

# 配置PE2。

[~PE2] flex-algo color-mapping
[*PE2-flex-algo-color-mapping] color 100 flex-algo 128 
[*PE2-flex-algo-color-mapping] quit
[*PE2] commit

11. 在PE设备上配置隧道选择策略,优选Flex-Algo LSP

# 配置PE1。

[~PE1] tunnel-policy p1
[*PE1-tunnel-policy-p1] tunnel select-seq flex-algo-lsp load-balance-number 1 unmix 
[*PE1-tunnel-policy-p1] quit
[*PE1] ip vpn-instance vpna
[*PE1-vpn-instance-vpna] ipv4-family
[*PE1-vpn-instance-vpna-af-ipv4] tnl-policy p1
[*PE1-vpn-instance-vpna-af-ipv4] quit
[*PE1-vpn-instance-vpna] quit
[*PE1] commit

# 配置PE2。

[~PE2] tunnel-policy p1
[*PE2-tunnel-policy-p1] tunnel select-seq flex-algo-lsp load-balance-number 1 unmix
[*PE2-tunnel-policy-p1] quit
[*PE2] ip vpn-instance vpna
[*PE2-vpn-instance-vpna] ipv4-family
[*PE2-vpn-instance-vpna-af-ipv4] tnl-policy p1
[*PE2-vpn-instance-vpna-af-ipv4] quit
[*PE2-vpn-instance-vpna] quit
[*PE2] commit

12. 在PE与CE之间建立EBGP对等体关系

# 配置CE1。

<HUAWEI> system-view
[~HUAWEI] sysname CE1
[*HUAWEI] commit
[~CE1] interface loopback 1
[*CE1-LoopBack1] ip address 10.11.1.1 32
[*CE1-LoopBack1] quit
[*CE1] interface gigabitethernet1/0/0
[*CE1-GigabitEthernet1/0/0] ip address 10.1.1.1 24
[*CE1-GigabitEthernet1/0/0] quit
[*CE1] bgp 65410
[*CE1-bgp] peer 10.1.1.2 as-number 100
[*CE1-bgp] network 10.11.1.1 32
[*CE1-bgp] quit
[*CE1] commit

# 配置PE1。

[~PE1] bgp 100
[~PE1-bgp] ipv4-family vpn-instance vpna
[*PE1-bgp-vpna] peer 10.1.1.1 as-number 65410
[*PE1-bgp-vpna] commit
[~PE1-bgp-vpna] quit
[~PE1-bgp] quit

配置完成后,在PE设备上执行display bgp vpnv4 vpn-instance peer命令,可以看到PE与CE之间的BGP对等体关系已建立,并达到Established状态。

以PE1与CE1的对等体关系为例:

[~PE1] display bgp vpnv4 vpn-instance vpna peer

 BGP local router ID : 1.1.1.9
 Local AS number : 100

 VPN-Instance vpna, Router ID 1.1.1.9:
 Total number of peers : 1            Peers in established state : 1

  Peer            V    AS  MsgRcvd  MsgSent    OutQ  Up/Down    State        PrefRcv
  10.1.1.1        4   65410  11     9          0     00:06:37   Established  1

13. 检查配置结果

在PE设备上执行display ip routing-table vpn-instance命令,可以看到去往CE上的Loopback接口路由。

以PE1的显示为例:

[~PE1] display ip routing-table vpn-instance vpna
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table: vpna
         Destinations : 7        Routes : 7
Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
     10.1.1.0/24    Direct 0    0        D     10.1.1.2        GigabitEthernet1/0/0
     10.1.1.2/32    Direct 0    0        D     127.0.0.1       GigabitEthernet1/0/0
   10.1.1.255/32    Direct 0    0        D     127.0.0.1       GigabitEthernet1/0/0
   10.11.1.1/32     EBGP   255  0        RD    10.1.1.1        GigabitEthernet1/0/0
   10.22.2.2/32     IBGP   255  0        RD    3.3.3.9         GigabitEthernet3/0/0
     127.0.0.0/8    Direct 0    0        D     127.0.0.1       InLoopBack0
255.255.255.255/32  Direct 0    0        D     127.0.0.1       InLoopBack0

同一VPN的CE能够相互Ping通,例如:CE1能够Ping通CE2(10.22.2.2)。

[~CE1] ping -a 10.11.1.1 10.22.2.2
  PING 10.22.2.2: 56  data bytes, press CTRL_C to break
    Reply from 10.22.2.2: bytes=56 Sequence=1 ttl=252 time=72 ms
    Reply from 10.22.2.2: bytes=56 Sequence=2 ttl=252 time=34 ms
    Reply from 10.22.2.2: bytes=56 Sequence=3 ttl=252 time=50 ms
    Reply from 10.22.2.2: bytes=56 Sequence=4 ttl=252 time=50 ms
    Reply from 10.22.2.2: bytes=56 Sequence=5 ttl=252 time=34 ms
  --- 10.22.2.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 34/48/72 ms  

以上是关于华为NE40E路由器实验配置示例 | 配置L3VdPdNd over IS-IS SR-MPLS Flex-Algo LSP基于亲和属性算路的主要内容,如果未能解决你的问题,请参考以下文章

华为NE40E路由器实验配置示例 | 配置SR-MPLS BE隧道的TI-LFA FRR功能

华为NE40E路由器实验配置示例 | 配置EVdPdNd VPLS over SR-MPLS BE(BD EVdPdNd)

华为NE40E路由器实验配置示例 | 配置L3VdPdNd over OSPF SR-MPLS BE

华为NE40E路由器实验配置示例 | 配置L3VdPdNd over OSPF SR-MPLS BE

华为NE40E路由器实验配置示例 | 配置EVdPdNd L3VdPdNdv4 over SRv6 BE

华为NE40E路由器实验配置示例 | 配置EVdPdNd L3VdPdNdv6 over SRv6 BE