zl程序教程

您现在的位置是:首页 >  大数据

当前栏目

华为运营商级路由器配置示例 | L3VdPdNdv4 HoVdPdNd over MPLS拼接SRv6 TE Policy

配置华为 示例 路由器 拼接 运营商 Over policy
2023-09-14 09:09:07 时间

组网需求

如图1所示

  • 路由器UPE、SPE和NPE属于AS 100,要求它们之间通过IS-IS协议IPv6网络互连。
  • UPE、SPE和NPE属于IS-IS进程1。

要求在UPE和SPE之间建立双向MPLS LDP隧道,在SPE和NPE之间建立双向SRv6 TE Policy,承载L3VPNv4业务。

图1 配置L3VPNv4 HoVPN over MPLS拼接SRv6 TE Policy组网图

 

配置思路

  1. 使能UPE、NPE、SPE设备各接口的IPv6转发能力,配置各接口的IPv6/IPv4地址。
  2. 在各路由器上使能IS-IS,配置Level级别,指定网络实体。
  3. 在UPE和SPE上配置MPLS基本能力和MPLS LDP,建立MPLS LSP。
  4. 在UPE、NPE、SPE设备上配置使能IPv4地址族的VPN实例。
  5. 在UPE与CE1、NPE与CE2之间建立EBGP对等体关系。
  6. 在UPE、SPE、NPE之间建立MP-IBGP对等体关系。
  7. 配置SRv6 SID,同时在NPE、SPE上配置VPN路由携带SID属性。
  8. 在SPE和NPE上配置SRv6 TE Policy。
  9. 在SPE和NPE上配置隧道策略,引入流量。
  10. 在SPE上指定UPE设备,并向UPE设备发布缺省路由。
  11. 在SPE上配置向NPE发布重生成路由。

操作步骤

1.配置各设备的接口IP地址,使能接口的IPv6转发能力

# 配置NPE。SPE和UPE的配置过程与NPE类似,不再赘述,详情可参考配置文件。

<HUAWEI> system-view
[~HUAWEI] sysname NPE
[~HUAWEI] commit
[~NPE] interface gigabitethernet 1/0/0
[~NPE-GigabitEthernet1/0/0] ipv6 enable
[*NPE-GigabitEthernet1/0/0] ipv6 address 2001:DB8:2001::2 96
[*NPE-GigabitEthernet1/0/0] quit
[*NPE] interface LoopBack 1
[*NPE-LoopBack1] ip address 3.3.3.3 32
[*NPE-LoopBack1] ipv6 enable
[*NPE-LoopBack1] ipv6 address 2001:DB8:2::2 128
[*NPE-LoopBack1] quit
[*NPE] commit

2.配置IS-IS

# 配置UPE。

[~UPE] isis 1
[*UPE-isis-1] is-level level-1
[*UPE-isis-1] cost-style wide
[*UPE-isis-1] network-entity 10.0000.0000.0001.00
[*UPE-isis-1] quit
[*UPE] interface gigabitethernet 1/0/0
[*UPE-GigabitEthernet1/0/0] isis enable 1
[*UPE-GigabitEthernet1/0/0] quit
[*UPE] interface loopback1
[*UPE-LoopBack1] isis enable 1
[*UPE-LoopBack1] commit
[~UPE-LoopBack1] quit

# 配置SPE。

[~SPE] isis 1 
[*SPE-isis-1] is-level level-1
[*SPE-isis-1] cost-style wide
[*SPE-isis-1] network-entity 10.0000.0000.0002.00
[*SPE-isis-1] ipv6 enable topology ipv6
[*SPE-isis-1] quit
[*SPE] interface gigabitethernet 1/0/0
[*SPE-GigabitEthernet1/0/0] isis enable 1
[*SPE-GigabitEthernet1/0/0] quit
[*SPE] interface gigabitethernet 2/0/0
[*SPE-GigabitEthernet2/0/0] isis ipv6 enable 1
[*SPE-GigabitEthernet2/0/0] quit
[*SPE] interface loopback1
[*SPE-LoopBack1] isis ipv6 enable 1
[*SPE-LoopBack1] isis enable 1
[*SPE-LoopBack1] commit
[~SPE-LoopBack1] quit

# 配置NPE。

[~NPE] isis 1
[*NPE-isis-1] is-level level-1
[*NPE-isis-1] cost-style wide
[*NPE-isis-1] network-entity 10.0000.0000.0003.00
[*NPE-isis-1] ipv6 enable topology ipv6
[*NPE-isis-1] quit
[*NPE] interface gigabitethernet 1/0/0
[*NPE-GigabitEthernet1/0/0] isis ipv6 enable 1
[*NPE-GigabitEthernet1/0/0] quit
[*NPE] interface loopback1
[*NPE-LoopBack1] isis ipv6 enable 1
[*NPE-LoopBack1] commit
[~NPE-LoopBack1] quit

配置完成后,可按如下指导检查IS-IS是否配置成功。

# 显示IS-IS邻居信息。以UPE为例。

[~UPE] display isis peer 
 
                          Peer information for ISIS(1) 
                          
  System Id     Interface          Circuit Id        State HoldTime Type     PRI 
-------------------------------------------------------------------------------- 
0000.0000.0002* GE1/0/0            0000.0000.0002.01  Up   8s       L1       64  
 
Total Peer(s): 1

# 显示IS-IS路由表信息。以NPE为例。

[~NPE] display isis route 
                         Route information for ISIS(1) 
                         ----------------------------- 
 
                        ISIS(1) Level-1 Forwarding Table 
                        -------------------------------- 
 
 IPV6 Dest.          ExitInterface   NextHop                    Cost     Flags     
-------------------------------------------------------------------------------- 
2001:DB8:1::1/128    GE1/0/0         FE80::3A92:6CFF:FE21:10    10       A/-/-/-   
2001:DB8:2::2/128    Loop1           Direct                     0        D/-/L/-   
2001:DB8:2001::/96   GE1/0/0         Direct                     10       D/-/L/-   
     Flags: D-Direct, A-Added to URT, L-Advertised in LSPs, S-IGP Shortcut,  
            U-Up/Down Bit Set, LP-Local Prefix-Sid
     Protect Type: L-Link Protect, N-Node Protect

3.UPE和SPE配置MPLS基本能力和MPLS LDP,建立LDP LSP

# 配置UPE。

[~UPE] mpls lsr-id 1.1.1.1
[*UPE] mpls
[*UPE-mpls] commit
[~UPE-mpls] quit
[~UPE] mpls ldp
[*UPE-mpls-ldp] quit
[*UPE] interface gigabitethernet 1/0/0
[*UPE-GigabitEthernet1/0/0] mpls
[*UPE-GigabitEthernet1/0/0] mpls ldp
[*UPE-GigabitEthernet1/0/0] commit
[~UPE-GigabitEthernet1/0/0] quit

# 配置SPE。

[~SPE] mpls lsr-id 2.2.2.2
[*SPE] mpls
[*SPE-mpls] commit
[~SPE-mpls] quit
[~SPE] mpls ldp
[*SPE-mpls-ldp] quit
[*SPE] interface gigabitethernet 1/0/0
[*SPE-GigabitEthernet1/0/0] mpls
[*SPE-GigabitEthernet1/0/0] mpls ldp
[*SPE-GigabitEthernet1/0/0] commit
[~SPE-GigabitEthernet1/0/0] quit

上述配置完成后,UPE与SPE之间应能建立LDP会话,执行display mpls ldp session命令可以看到显示结果中Status项为“Operational”。执行display mpls ldp lsp命令,可以看到LDP LSP的建立情况。

# 以UPE的显示为例:

[~UPE] display mpls ldp session
               LDP Session(s) in Public Network
 Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDD:HH:MM)
 An asterisk (*) before a session means the session is being deleted.
 -------------------------------------------------------------------------
 Peer-ID            Status      LAM  SsnRole  SsnAge      KA-Sent/Rcv
 -------------------------------------------------------------------------
 2.2.2.2:0          Operational DU   Passive  006:20:55   39551/39552
 -------------------------------------------------------------------------
 TOTAL: 1 session(s) Found.
 LAM : Label Advertisement Mode      SsnAge Unit : DDD:HH:MM
[~UPE] display mpls ldp lsp
 LDP LSP Information
 -------------------------------------------------------------------------------
 Flag after Out IF: (I) - RLFA Iterated LSP, (I*) - Normal and RLFA Iterated LSP
 -------------------------------------------------------------------------------
 DestAddress/Mask   In/OutLabel    UpstreamPeer    NextHop         OutInterface
 -------------------------------------------------------------------------------
 1.1.1.1/32         3/NULL         2.2.2.2         127.0.0.1       Loop1
*1.1.1.1/32         Liberal/1024                   DS/2.2.2.2
 2.2.2.2/32         NULL/3         -               10.1.2.2        GE1/0/0
 2.2.2.2/32         1024/3         2.2.2.2         10.1.2.2        GE1/0/0
-------------------------------------------------------------------------------
 TOTAL: 3 Normal LSP(s) Found.
 TOTAL: 1 Liberal LSP(s) Found.
 TOTAL: 0 FRR LSP(s) Found.
 An asterisk (*) before an LSP means the LSP is not established
 An asterisk (*) before a Label means the USCB or DSCB is stale
 An asterisk (*) before an UpstreamPeer means the session is stale
 An asterisk (*) before a DS means the session is stale
 An asterisk (*) before a NextHop means the LSP is FRR LSP

4.在UPE、NPE、SPE设备上配置使能IPv4地址族的VPN实例

# 配置UPE。

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

# 配置SPE。

[~SPE] ip vpn-instance vpna
[*SPE-vpn-instance-vpna] ipv4-family
[*SPE-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[*SPE-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*SPE-vpn-instance-vpna-af-ipv4] quit
[*SPE-vpn-instance-vpna] quit
[*SPE] commit

# 配置NPE。

[~NPE] ip vpn-instance vpna
[*NPE-vpn-instance-vpna] ipv4-family
[*NPE-vpn-instance-vpna-af-ipv4] route-distinguisher 300:1
[*NPE-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[*NPE-vpn-instance-vpna-af-ipv4] quit
[*NPE-vpn-instance-vpna] quit
[*NPE] interface gigabitethernet 2/0/0
[*NPE-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[*NPE-GigabitEthernet2/0/0] ip address 10.2.1.1 24
[*NPE-GigabitEthernet2/0/0] quit
[*NPE] commit

配置完成后,在UPE、NPE设备上执行display ip vpn-instance verbose命令可以看到VPN实例的配置情况。

5.在UPE与CE1、NPE与CE2之间建立EBGP对等体关系

# 配置CE1。

[~CE1] interface loopback 1
[*CE1-LoopBack1] ip address 11.11.11.11 32
[*CE1-LoopBack1] quit
[*CE1] bgp 65410
[*CE1-bgp] peer 10.1.1.1 as-number 100
[*CE1-bgp] network 11.11.11.11 32
[*CE1-bgp] quit
[*CE1] commit

# 配置UPE。

[~UPE] bgp 100
[*UPE-bgp] router-id 1.1.1.1
[*UPE-bgp] ipv4-family vpn-instance vpna
[*UPE-bgp-vpna] peer 10.1.1.2 as-number 65410
[*UPE-bgp-vpna] import-route direct
[*UPE-bgp-vpna] commit
[~UPE-bgp-vpna] quit
[~UPE-bgp] quit

# 配置CE2。

[~CE2] interface loopback 1
[*CE2-LoopBack1] ip address 22.22.22.22 32
[*CE2-LoopBack1] quit
[*CE2] bgp 65420
[*CE2-bgp] peer 10.2.1.1 as-number 100
[*CE2-bgp] network 22.22.22.22 32
[*CE2-bgp] quit
[*CE2] commit

# 配置NPE。

[~NPE] bgp 100
[*NPE-bgp] router-id 3.3.3.3
[*NPE-bgp] ipv4-family vpn-instance vpna
[*NPE-bgp-vpna] peer 10.2.1.2 as-number 65420
[*NPE-bgp-vpna] import-route direct
[*NPE-bgp-vpna] commit
[~NPE-bgp-vpna] quit
[~NPE-bgp] quit

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

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

[~UPE] display bgp vpnv4 vpn-instance vpna peer
 BGP local router ID : 1.1.1.1
 Local AS number : 100

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

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

6.在UPE、SPE、NPE之间建立MP-IBGP对等体关系

# 配置UPE。

[~UPE] bgp 100
[~UPE-bgp] peer 2.2.2.2 as-number 100
[*UPE-bgp] peer 2.2.2.2 connect-interface loopback 1
[*UPE-bgp] ipv4-family vpnv4
[*UPE-bgp-af-vpnv4] peer 2.2.2.2 enable
[*UPE-bgp-af-vpnv4] commit
[~UPE-bgp-af-vpnv4] quit
[~UPE-bgp] quit

# 配置SPE。

[~SPE] bgp 100
[~SPE-bgp] peer 1.1.1.1 as-number 100
[*SPE-bgp] peer 1.1.1.1 connect-interface loopback 1
[*SPE-bgp] peer 2001:DB8:2::2 as-number 100
[*SPE-bgp] peer 2001:DB8:2::2 connect-interface loopback 1
[*SPE-bgp] ipv4-family vpnv4
[*SPE-bgp-af-vpnv4] peer 1.1.1.1 enable
[*SPE-bgp-af-vpnv4] peer 2001:DB8:2::2 enable
[*SPE-bgp-af-vpnv4] commit
[~SPE-bgp-af-vpnv4] quit
[~SPE-bgp] quit

# 配置NPE。

[~NPE] bgp 100
[~NPE-bgp] peer 2001:DB8:1::1 as-number 100
[*NPE-bgp] peer 2001:DB8:1::1 connect-interface loopback 1
[*NPE-bgp] ipv4-family vpnv4
[*NPE-bgp-af-vpnv4] peer 2001:DB8:1::1 enable
[*NPE-bgp-af-vpnv4] commit
[~NPE-bgp-af-vpnv4] quit
[~NPE-bgp] quit

配置完成后,在UPE、NPE设备上执行display bgp vpnv4 all peer命令,可以看到BGP对等体关系已建立,并达到Established状态。

以UPE显示为例:

[~UPE] display bgp vpnv4 all peer 
 
 BGP local router ID : 1.1.1.1 
 Local AS number : 100 
 Total number of peers : 2                 Peers in established state : 2 
 
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv 
  2.2.2.2            4         100      216      220     0 03:03:35 Established        2 
 
  Peer of IPv4-family for vpn instance : 
 
  VPN-Instance vpna, Router ID 1.1.1.1: 
  Peer            V          AS  MsgRcvd  MsgSent  OutQ  Up/Down       State  PrefRcv 
  10.1.1.2        4       65410      216      217     0 03:06:22 Established        1

7.配置SRv6 SID,同时在NPE、SPE上配置VPN路由携带SID属性

# 配置SPE。

[~SPE] segment-routing ipv6
[*SPE-segment-routing-ipv6] encapsulation source-address 2001:DB8:1::1
[*SPE-segment-routing-ipv6] locator as1 ipv6-prefix 10:: 64 static 32
[*SPE-segment-routing-ipv6-locator] quit
[*SPE-segment-routing-ipv6] quit
[*SPE] bgp 100
[*SPE-bgp] ipv4-family vpnv4
[*SPE-bgp-af-vpnv4] peer 2001:DB8:2::2 prefix-sid
[*SPE-bgp-af-vpnv4] quit
[*SPE-bgp] ipv4-family vpn-instance vpna
[*SPE-bgp-vpna] segment-routing ipv6 traffic-engineer best-effort
[*SPE-bgp-vpna] segment-routing ipv6 locator as1
[*SPE-bgp-vpna] commit
[~SPE-bgp-vpna] quit
[~SPE-bgp] quit
[~SPE] isis 1
[~SPE-isis-1] segment-routing ipv6 locator as1
[*SPE-isis-1] commit
[~SPE-isis-1] quit

# 配置NPE。

[~NPE] segment-routing ipv6
[*NPE-segment-routing-ipv6] encapsulation source-address 2001:DB8:2::2
[*NPE-segment-routing-ipv6] locator as1 ipv6-prefix 20:: 64 static 32
[*NPE-segment-routing-ipv6-locator] quit
[*NPE-segment-routing-ipv6] quit
[*NPE] bgp 100
[*NPE-bgp] ipv4-family vpnv4
[*NPE-bgp-af-vpnv4] peer 2001:DB8:1::1 prefix-sid
[*NPE-bgp-af-vpnv4] quit
[*NPE-bgp] ipv4-family vpn-instance vpna
[*NPE-bgp-vpna] segment-routing ipv6 traffic-engineer best-effort
[*NPE-bgp-vpna] segment-routing ipv6 locator as1
[*NPE-bgp-vpna] commit
[~NPE-bgp-vpna] quit
[~NPE-bgp] quit
[~NPE] isis 1
[~NPE-isis-1] segment-routing ipv6 locator as1
[*NPE-isis-1] commit
[~NPE-isis-1] quit

执行命令display segment-routing ipv6 local-sid end forwarding查看SRv6的Local SID表信息。

[~SPE] display segment-routing ipv6 local-sid end forwarding 
                    My Local-SID End Forwarding Table 
                    --------------------------------- 
 
SID         : 10::1:0:0/128                              FuncType : End 
Flavor      : NO-FLAVOR 
LocatorName : as1                                        LocatorID: 1 
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-30 02:50:43.171
 
SID         : 10::1:0:1/128                              FuncType : End 
Flavor      : PSP 
LocatorName : as1                                        LocatorID: 1 
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-30 01:49:56.292
 
SID         : 10::1:0:2/128                              FuncType : End 
Flavor      : PSP USP USD 
LocatorName : as1                                        LocatorID: 1 
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-30 01:49:56.292
 
Total SID(s): 3
[~NPE] display segment-routing ipv6 local-sid end forwarding 
                    My Local-SID End Forwarding Table 
                    --------------------------------- 
 
SID         : 20::1:0:0/128                              FuncType : End 
Flavor      : NO-FLAVOR  
LocatorName : as1                                        LocatorID: 1 
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-29 03:29:43.171
 
SID         : 20::1:0:1/128                              FuncType : End 
Flavor      : PSP 
LocatorName : as1                                        LocatorID: 1
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-30 01:17:59.324
 
SID         : 20::1:0:2/128                              FuncType : End 
Flavor      : PSP USP USD 
LocatorName : as1                                        LocatorID: 1
ProtocolType: ISIS                                       ProcessID: 1
UpdateTime  : 2021-08-30 01:17:59.324
 
Total SID(s): 2

8.配置SRv6 TE Policy

# 配置SPE。

[~SPE] segment-routing ipv6  
[~SPE-segment-routing-ipv6] segment-list list1  
[*SPE-segment-routing-ipv6-segment-list-list1] index 10 sid ipv6 20::1:0:0 
[*SPE-segment-routing-ipv6-segment-list-list1] commit 
[~SPE-segment-routing-ipv6-segment-list-list1] quit 
[~SPE-segment-routing-ipv6] srv6-te-policy locator as1  
[*SPE-segment-routing-ipv6] srv6-te policy policy1 endpoint 2001:DB8:2::2 color 101 
[*SPE-segment-routing-ipv6-policy-policy1] binding-sid 10::100 
[*SPE-segment-routing-ipv6-policy-policy1] candidate-path preference 100 
[*SPE-segment-routing-ipv6-policy-policy1-path] segment-list list1  
[*SPE-segment-routing-ipv6-policy-policy1-path] commit 
[~SPE-segment-routing-ipv6-policy-policy1-path] quit 
[~SPE-segment-routing-ipv6-policy-policy1] quit
[~SPE-segment-routing-ipv6] quit

# 配置NPE。

[~NPE] segment-routing ipv6  
[~NPE-segment-routing-ipv6] segment-list list1  
[*NPE-segment-routing-ipv6-segment-list-list1] index 10 sid ipv6 10::1:0:0 
[*NPE-segment-routing-ipv6-segment-list-list1] commit 
[~NPE-segment-routing-ipv6-segment-list-list1] quit 
[~NPE-segment-routing-ipv6] srv6-te-policy locator as1  
[*NPE-segment-routing-ipv6] srv6-te policy policy1 endpoint 2001:DB8:1::1 color 101 
[*NPE-segment-routing-ipv6-policy-policy1] binding-sid 20::200 
[*NPE-segment-routing-ipv6-policy-policy1] candidate-path preference 100 
[*NPE-segment-routing-ipv6-policy-policy1-path] segment-list list1  
[*NPE-segment-routing-ipv6-policy-policy1-path] commit 
[~NPE-segment-routing-ipv6-policy-policy1-path] quit 
[~NPE-segment-routing-ipv6-policy-policy1] quit
[~NPE-segment-routing-ipv6] quit

配置完成后,执行命令display srv6-te policy查看SRv6 TE Policy信息。

以SPE的显示为例:

[~SPE] display srv6-te policy  
PolicyName : policy1 
Color                   : 101                            Endpoint             : 2001:DB8:2::2 
TunnelId                : 1                              Binding SID          : 10::100 
TunnelType              : SRv6-TE Policy                 DelayTimerRemain     : - 
Policy State            : Up                             State Change Time    : 2020-04-02 01:18:25
Admin State             : Up                             Traffic Statistics   : Disable 
Backup Hot-Standby      : Disable                        BFD                  : Disable 
Interface Index         : -                              Interface Name       : - 
Interface State         : -                              Encapsulation Mode   : Insert
Candidate-path Count    : 1

 Candidate-path Preference : 100 
 Path State             : Active                         Path Type            : Primary 
 Protocol-Origin        : Configuration(30)              Originator           : 0, 0.0.0.0 
 Discriminator          : 100                            Binding SID          : 10::100 
 GroupId                : 1                              Policy Name          : policy1 
 Template ID            : 0                              Path Verification    : Disable
 DelayTimerRemain       : -                              Segment-List Count   : 1 
  Segment-List          : list1 
   Segment-List ID      : 1                              XcIndex              : 1   
   List State           : Up                             DelayTimerRemain     : -  
   Verification State   : -                              SuppressTimeRemain   : -   
   PMTU                 : 9600                           Active PMTU          : 9600
   Weight               : 1                              BFD State            : -
   SID :  
         20::1:0:0

9.配置隧道策略,引入流量

# 配置SPE。

[~SPE] route-policy p1 permit node 10 
[*SPE-route-policy] apply extcommunity color 0:101 
[*SPE-route-policy] quit 
[*SPE] bgp 100 
[*SPE-bgp] ipv4-family vpnv4 
[*SPE-bgp-af-vpnv4] peer 2001:DB8:2::2 route-policy p1 import  
[*SPE-bgp-af-vpnv4] quit 
[*SPE-bgp] quit 
[*SPE] tunnel-policy p1 
[*SPE-tunnel-policy-p1] tunnel select-seq ipv6 srv6-te-policy load-balance-number 1 
[*SPE-tunnel-policy-p1] quit 
[*SPE] ip vpn-instance vpna 
[*SPE-vpn-instance-vpna] ipv4-family
[*SPE-vpn-instance-vpna-af-ipv4] tnl-policy p1 
[*SPE-vpn-instance-vpna-af-ipv4] commit
[~SPE-vpn-instance-vpna-af-ipv4] quit
[~SPE-vpn-instance-vpna] quit

# 配置NPE。

[~NPE] route-policy p1 permit node 10 
[*NPE-route-policy] apply extcommunity color 0:101 
[*NPE-route-policy] quit 
[*NPE] bgp 100 
[*NPE-bgp] ipv4-family vpnv4 
[*NPE-bgp-af-vpnv4] peer 2001:DB8:1::1 route-policy p1 import  
[*NPE-bgp-af-vpnv4] quit 
[*NPE-bgp] quit 
[*NPE] tunnel-policy p1 
[*NPE-tunnel-policy-p1] tunnel select-seq ipv6 srv6-te-policy load-balance-number 1 
[*NPE-tunnel-policy-p1] quit 
[*NPE] ip vpn-instance vpna 
[*NPE-vpn-instance-vpna] ipv4-family
[*NPE-vpn-instance-vpna-af-ipv4] tnl-policy p1 
[*NPE-vpn-instance-vpna-af-ipv4] commit
[~NPE-vpn-instance-vpna-af-ipv4] quit
[~NPE-vpn-instance-vpna] quit

# 配置完成后,执行命令display ip routing-table vpn-instance vpna查看VPN实例路由表信息,可以看到路由已经成功迭代到SRv6 TE Policy。

以SPE、NPE的显示为例:

[~SPE] 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 : 8        Routes : 8          
 
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface 
 
       10.1.1.0/24  Direct  0    0             D   10.1.1.1        GigabitEthernet1/0/0 
       10.1.1.1/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.2.1.0/24  IBGP    255  0             RD  2001:DB8:2::2   policy1 
    11.11.11.11/32  EBGP    255  0             RD  10.1.1.2        GigabitEthernet1/0/0 
    22.22.22.22/32  IBGP    255  0             RD  2001:DB8:2::2   policy1 
      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
[~NPE] display ip routing-table vpn-instance vpna 22.22.22.22 verbose  
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route 
------------------------------------------------------------------------------ 
Routing Table : vpna 
Summary Count : 1 
 
Destination: 22.22.22.22/32       
     Protocol: IBGP               Process ID: 0               
   Preference: 255                      Cost: 0               
      NextHop: 2001:DB8:2::2       Neighbour: 2001:DB8:2::2 
        State: Active Adv Relied         Age: 00h03m15s            
          Tag: 0                    Priority: low             
        Label: 3                     QoSInfo: 0x0            
   IndirectID: 0x10000E0            Instance:                                  
 RelayNextHop: 2001:DB8:2::2        Interface: policy1 
     TunnelID: 0x000000003400000001    Flags: RD  

10.SPE指定UPE,并向UPE发布缺省路由

[~SPE] bgp 100
[~SPE-bgp] ipv4-family vpnv4
[*SPE-bgp-af-vpnv4] peer 1.1.1.1 upe
[*SPE-bgp-af-vpnv4] peer 1.1.1.1 default-originate vpn-instance vpna
[*SPE-bgp-af-vpnv4] commit
[~SPE-bgp-af-vpnv4] quit
[~SPE-bgp] quit

11.SPE配置发布重生成路由

[~SPE] bgp 100
[~SPE-bgp] ipv4-family vpn-instance vpna
[*SPE-bgp-vpna] advertise best-route route-reoriginate
[*SPE-bgp-vpna] commit
[~SPE-bgp-vpna] quit
[~SPE-bgp] ipv4-family vpnv4
[*SPE-bgp-af-vpnv4] peer 2001:DB8:2::2 advertise route-reoriginated vpnv4
[*SPE-bgp-af-vpnv4] commit
[~SPE-bgp-af-vpnv4] quit
[~SPE-bgp] quit

12.检查配置结果

# 查看SPE、NPE的路由表。

[~SPE] display bgp vpnv4 all routing-table 10.1.1.2 
 BGP local router ID : 2.2.2.2
 Local AS number : 100
 
 Total routes of Route Distinguisher(100:1): 1
 BGP routing table entry information of 10.1.1.0/24:
 Label information (Received/Applied): 48060/NULL
 From: 1.1.1.1 (10.1.1.2)  
 Route Duration: 0d01h06m07s
 Relay IP Nexthop: 11.11.11.1
 Relay IP Out-Interface: GigabitEthernet1/0/0
 Relay Tunnel Out-Interface: GigabitEthernet1/0/0
 Original nexthop: 1.1.1.1
 Qos information : 0x0
 Ext-Community: RT <111 : 1>
 AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, pre 255, IGP cost 10
 Not advertised to any peer yet
 
 Total routes of Route Distinguisher(200:1): 1
 BGP routing table entry information of 10.1.1.0/24:
 From: 1.1.1.1 (10.1.1.2)  
 Route Duration: 0d00h10m13s
 Relay Tunnel Out-Interface: GigabitEthernet1/0/0
 Original nexthop: 0.0.0.0
 Qos information : 0x0
 Ext-Community: RT <111 : 1>
 AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, pre 255, reoriginated, IGP cost 10
 Advertised to such 1 peers:
    2001:DB8:2::2
    
 VPN-Instance 1, Router ID 2.2.2.2:
 
 Total Number of Routes: 1
 BGP routing table entry information of 10.1.1.0/24:
 Route Distinguisher: 100:1
 Remote-Cross route
 Label information (Received/Applied): 48060/NULL
 From: 1.1.1.1 (10.1.1.2)  
 Route Duration: 0d00h10m40s
 Relay Tunnel Out-Interface: GigabitEthernet1/0/0
 Original nexthop: 1.1.1.1
 Qos information : 0x0
 Ext-Community: RT <111 : 1>
 AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, pre 255, IGP cost 10
 Not advertised to any peer yet
[~UPE] 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 
 
       0.0.0.0/24  IBGP    255  0           RD  2.2.2.2           GigabitEthernet2/0/0 
      10.1.1.0/24   Direct  0    0             D   10.1.1.1        GigabitEthernet1/0/0 
      10.1.1.1/32   Direct  0    0             D   127.0.0.1       GigabitEthernet1/0/0 
    10.1.1.255/24   Direct  0    0             D   127.0.0.1       GigabitEthernet1/0/0  
   11.11.11.11/32   EBGP    255  0             RD  10.1.1.2        GigabitEthernet1/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

# 从CE1可以Ping通CE2。

[~CE1] ping -a 11.11.11.11 22.22.22.22
  PING 22.22.22.22: 56  data bytes, press CTRL_C to break
    Reply from 22.22.22.22: bytes=56 Sequence=1 ttl=252 time=131 ms
    Reply from 22.22.22.22: bytes=56 Sequence=2 ttl=252 time=12 ms
    Reply from 22.22.22.22: bytes=56 Sequence=3 ttl=252 time=14 ms
    Reply from 22.22.22.22: bytes=56 Sequence=4 ttl=252 time=14 ms
    Reply from 22.22.22.22: bytes=56 Sequence=5 ttl=252 time=12 ms

  --- 22.22.22.22 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 12/36/131 ms