In this post i would like to explain the usage of the “MPLS VPN Per VRF Label” feature.
By default, in each VRF, prefixes are assigned a VPN label, used to identify the route within the VRF itself.
This label is the only label that is being looked at by the receiving PE router.
In theory, you only need a single label to identify the VRF for the destination prefix, and then you can do an IP lookup to further process the packet.
This is what the “MPLS VPN Per VRF Label” does.
Im going to be using the simple topology below to illustrate the functionality:
In this topology, R2 receives 2 prefixes from R1 through RIP.
Since we are redistributing RIP into BGP, we can see these two routes in the BGP table:
And we can check which labels R2 allocates for each of the prefixes:
For prefix 1.1.1.1/32 a VPN label of 20 has been assigned and for 11.11.11.11/32, label 21 is used.
Lets check the settings for the VRF VPN_A:
We can see that the label allocation mode is “per-prefix” which is what we expect and have verified by looking at the labels assigned by BGP.
The final verification of this can be see on R3:
We can see that the “Out label” for 1.1.1.1/32 is in fact 20 and for 11.11.11.11/32 21. Everything we expect.
Now lets change the setting on R2 to be “Per VRF”:
Verification of the VRF setting:
And verify the BGP label allocation:
What we can see now, is that the prefixes are being treated as an aggregate with a label of 18 for both prefixes.
Finally, if i look at the changes on R3, we can see that label 18 is indeed being used for all the routes from R2 (and hence R1):
Thats all i had for now. Hope you enjoyed it. Take care!