cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1210
Views
0
Helpful
6
Replies

label per prefix mode with static routes

a.niko
Level 1
Level 1

Hi,

I am trying to recreate the working behaviour of an Label switched edge router on IOS towards the ASR9xxx platform running IOSXR5.3.3 in a hub and spoke model. 

What we typically do is switch traffic towards a centrale VRF provider edge router which forwards all traffic towards a central firewall/proxy environment. This is a strict topology enforcement model.

i am running label per prefix mode, however this only works for us when we use a dynamic PE-CE protocol such as bgp or ospf in the central VRF. If we statically route a default route, the label applied is the VRF aggregate label, resulting in hairpinning on the PE itself.

is there a way of statically configuring this model.

here some comparable output:

ios:

Local  Outgoing      Prefix            Bytes Label   Outgoing   Next Hop    

Label  Label or VC   or Tunnel Id      Switched      interface              

155    No Label      ::/0[V]           0             Gi7/1.3123  2A02:A43F:D000::2:1

228    Pop Label     IPv4 VRF[V]       0             aggregate/vpn-01             

293    Pop Label     IPv6 VRF[V]       0             aggregate/vpn-01             

394    No Label      0.0.0.0/0[V]      0             Gi7/1.3124  10.22.0.3     <------ this is a label for the static route.

ios-xr:

   Network            Next Hop        Rcvd Label      Local Label

Route Distinguisher: 139.156.152.0:14 (default for vrf GSI-URD-C11-S105)

*> 0.0.0.0/0          62.132.14.228   nolabel         17879           <---- this is the aggregate label

*> 62.132.14.224/29   0.0.0.0         nolabel         17879

thanks

Arnold

co

6 Replies 6

Aleksandar Vidakovic
Cisco Employee
Cisco Employee

hi Arnold,

are you using a fully qualified static route?

/Aleksandar

Hi Aleksandar,

it's a static route with a next hop + outgoing interface (which is reachable), so i think it qualifies...

/snip

router static

 vrf GSI-URD-C11-S105

  address-family ipv4 unicast

   0.0.0.0/0 Bundle-Ether31.526 62.132.14.228

  !

 !

!

the static route is redistributed into bgp vrf

RP/0/RP0/CPU0:nl-gv-pbl-t1gsi-cr01a#sh route vrf GSI-URD-C11-S105 

/

snip

Gateway of last resort is 62.132.14.228 to network 0.0.0.0

S*   0.0.0.0/0 [1/0] via 62.132.14.228, 1d23h, Bundle-Ether31.526

C    62.132.14.224/29 is directly connected, 2d23h, Bundle-Ether31.526

L    62.132.14.226/32 is directly connected, 2d23h, Bundle-Ether31.526

RP/0/RP0/CPU0:nl-gv-pbl-t1gsi-cr01a#

regards

Arnold

hi Arnold,

I'm not sure what is your entire configuration, but per-prefix allocation works both on IOS and IOS-XR.

When I use an IOS router  (c7600) as hub PE:

mpls label mode vrf av1 protocol all-afs per-prefix
!
router bgp 1
!
address-family vpnv4
  neighbor 172.16.255.1 activate
  neighbor 172.16.255.1 send-community both
 exit-address-family
 !
 address-family ipv4 vrf av1
  redistribute static metric 1234
  default-information originate
 exit-address-family
!
ip route vrf av1 0.0.0.0 0.0.0.0 Null0
a7606#sh bgp vpnv4 unicast vrf av1 labels
Load for five secs: 1%/0%; one minute: 3%; five minutes: 3%
Time source is NTP, .18:37:37.148 UTC Wed Feb 15 2017

   Network          Next Hop      In label/Out label
Route Distinguisher: 901:2 (av1)
   0.0.0.0          0.0.0.0         IPv4 VRF Aggr:21/aggregate(av1)
   10.255.255.2/32  0.0.0.0         IPv4 VRF Aggr:21/nolabel(av1)

ASR9k acting as spoke:

RP/0/RSP0/CPU0:our9001#sh bgp vpnv4 unicast vrf av1 labels
<snip>
   Network            Next Hop        Rcvd Label      Local Label
Route Distinguisher: 901:1 (default for vrf av1)
*>i0.0.0.0/0          172.16.255.2    21              24027
*>i10.255.255.2/32    172.16.255.2    21              24026

If I do it the other way around (i.e. asr9k is now the hub PE and c7600 as spoke):

RP/0/RSP0/CPU0:our9001#sh run router static vrf av1 address-family ipv4 unicast
Wed Feb 15 19:43:10.131 CET
router static
 vrf av1
  address-family ipv4 unicast
   0.0.0.0/0 GigabitEthernet0/0/1/6.101 192.168.101.2
RP/0/RSP0/CPU0:our9001#sh run router bgp 1 vrf av1
Wed Feb 15 19:43:57.449 CET
router bgp 1
 vrf av1
  rd 901:1
  default-information originate
  address-family ipv4 unicast
   label mode per-prefix
   redistribute static metric 5432
  !
 !
!
RP/0/RSP0/CPU0:our9001#sh bgp vpnv4 unicast vrf av1 labels
<snip>
   Network            Next Hop        Rcvd Label      Local Label
Route Distinguisher: 901:1 (default for vrf av1)
*> 0.0.0.0/0          192.168.101.2   nolabel         24027
*>i10.255.255.2/32    172.16.255.2    21              24026

Hope this helps,

/Aleksandar

hello Aleksandar,

the example configuration helped us find the missing setting, we were redistributing from static route like you illustrated, but we were missing the "default-information originate" command.

i now see a local prefix label for my default route

RP/0/RP0/CPU0:nl-gv-pbl-t1gsi-cr01a#sh bgp vrf  GSI-URD-C11-S105 labels         

/

snip

  Network            Next Hop        Rcvd Label      Local Label

Route Distinguisher: 139.156.152.0:14 (default for vrf GSI-URD-C11-S105)

*> 0.0.0.0/0          62.132.14.228   nolabel         17073           

*> 62.132.14.224/29   0.0.0.0         nolabel         16986  

thanks for the tip

Arnold

Use the redistribute command to redistribute routes from another protocol into BGP. By default, if these routes include the default route (0.0.0.0/0 for IPv4 or ::/0 for IPv6), the default route is ignored. Use the default-information originate command to change this behavior so that the default route is not ignored and is redistributed into BGP along with the other routes for the protocol being redistributed.

router bgp 100
 !
 vrf A
  default-information originate

adam

adam

Looks like you are looking at the wrong outputs

Use combination of "show bgp vpnv4 u lab" and "show mpls forwarding" to determine whether a prefix got allocated an aggregate label or not

================================================================

Default label allocation mode

================================================================

interface GigabitEthernet0/0/0/0
 vrf A
 ipv4 address 10.0.0.1 255.255.255.252

router static
 vrf A
  address-family ipv4 unicast
   0.0.0.0/0 GigabitEthernet0/0/0/0 10.0.0.2
   2.2.2.2/32 GigabitEthernet0/0/0/0 10.0.0.2

router bgp 100
 vrf A
  rd 1.1.1.1:102
  default-information originate
  address-family ipv4 unicast
   label mode per-vrf
   redistribute connected
   redistribute static


Route Distinguisher: 1.1.1.1:102 (default for vrf A)
*> 0.0.0.0/0          10.0.0.2        nolabel         24002           
*> 2.2.2.2/32         10.0.0.2        nolabel         24001           
*> 10.0.0.0/30        0.0.0.0         nolabel         24000           

Processed 3 prefixes, 3 paths
RP/0/0/CPU0:R1#show mpls for
Thu Feb 16 10:58:42.516 UTC
Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
24000  Aggregate   A: Per-VRF Aggr[V] A                            0           
24001  Unlabelled  2.2.2.2/32[V]      Gi0/0/0/0    10.0.0.2        0           
24002  Unlabelled  0.0.0.0/0[V]       Gi0/0/0/0    10.0.0.2        0           

================================================================

Per-Prefix label allocation mode

================================================================

RP/0/0/CPU0:R1(config)#router bgp 100
RP/0/0/CPU0:R1(config-bgp)#vrf A
RP/0/0/CPU0:R1(config-bgp-vrf)#address-family ipv4 u
RP/0/0/CPU0:R1(config-bgp-vrf-af)#label mode per-prefix
RP/0/0/CPU0:R1(config-bgp-vrf-af)#commit

Route Distinguisher: 1.1.1.1:102 (default for vrf A)
*> 0.0.0.0/0          10.0.0.2        nolabel         24002           
*> 2.2.2.2/32         10.0.0.2        nolabel         24001           
*> 10.0.0.0/30        0.0.0.0         nolabel         24000           

Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
24000  Aggregate   A: Per-VRF Aggr[V] A                            0           
24001  Unlabelled  2.2.2.2/32[V]      Gi0/0/0/0    10.0.0.2        0           
24002  Unlabelled  0.0.0.0/0[V]       Gi0/0/0/0    10.0.0.2        0   

================================================================

Per-CE label allocation mode

================================================================

RP/0/0/CPU0:R1(config)#router bgp 100
RP/0/0/CPU0:R1(config-bgp)#vrf A
RP/0/0/CPU0:R1(config-bgp-vrf)#address-family ipv4 u
RP/0/0/CPU0:R1(config-bgp-vrf-af)#label mode per-ce
RP/0/0/CPU0:R1(config-bgp-vrf-af)#commit

Route Distinguisher: 1.1.1.1:102 (default for vrf A)
*> 0.0.0.0/0          10.0.0.2        nolabel         24003           
*> 2.2.2.2/32         10.0.0.2        nolabel         24003           
*> 10.0.0.0/30        0.0.0.0         nolabel         24000           

Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
24000  Aggregate   A: Per-VRF Aggr[V] A                            0           
24003  Unlabelled  No ID              Gi0/0/0/0    10.0.0.2        0           
             Aggregate   No ID              A                            0            (!)

================================================================

Per-VRF label allocation mode

================================================================

RP/0/0/CPU0:R1(config)#router bgp 100
RP/0/0/CPU0:R1(config-bgp)#vrf A
RP/0/0/CPU0:R1(config-bgp-vrf)#address-family ipv4 u
RP/0/0/CPU0:R1(config-bgp-vrf-af)#label mode per-vrf
RP/0/0/CPU0:R1(config-bgp-vrf-af)#commit

Route Distinguisher: 1.1.1.1:102 (default for vrf A)
*> 0.0.0.0/0          10.0.0.2        nolabel         24000           
*> 2.2.2.2/32         10.0.0.2        nolabel         24000           
*> 10.0.0.0/30        0.0.0.0         nolabel         24000           

Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes       
Label  Label       or ID              Interface                    Switched    
------ ----------- ------------------ ------------ --------------- ------------
24000  Aggregate   A: Per-VRF Aggr[V] A                            0           

adam

adam