Community discussions

MikroTik App
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

BGP attributes inside VRF

Thu Feb 09, 2023 8:27 pm

Hello, I am having problems in the implementation of MPLS-VPNv4. I am receiving prefixes from a route reflector that contain BGP communities information. These prefixes appear as learned by BGP. However, the same prefixes found within the VRF_INET routing table appear to be of type "copy" and do not contain the BGP attributes.

/routing/route/print detail  where dst-address=1.1.1.0/24

 Ay   afi=ip4 contribution=active dst-address=1.1.1.0/24 routing-table=VRF_INET label=274 gateway=192.168.1.10 immediate-gw=172.16.1.1%sfp-sfpplus1 distance=0 scope=40 target-scope=30 
       belongs-to="copy" 
       debug.fwp-ptr=0x202C40C0 

 Ab   afi=vpn4 contribution=active dst-address=1.1.1.0/24&65000:111 routing-table=main label=274 gateway=192.168.1.10 immediate-gw=172.16.1.1%sfp-sfpplus1 distance=200 scope=40 target-scope=30 
       belongs-to="bgp-VPN4-192.168.1.20" 
       bgp.peer-cache-id=*B000002 .as-path="65001" .communities=65000:1234,65000:5678 .ext-communities=rt:65000:111 .originator-id=192.168.1.10 .local-pref=100 .med=0 
       .atomic-aggregate=no .origin=igp 
       debug.fwp-ptr=0x202C2DE0

Below is the relevant configuration associated with BGP.

/routing bgp connection
add address-families=vpnv4 as=65000 local.address=192.168.1.30 .role=ibgp name=ROUTE_REFLECTOR output.network=bgp-networks .redistribute="" remote.address=192.168.1.20

/routing bgp vpn
add disabled=no export-route-targets=65000:111 import-route-targets=65000:111 label-allocation-policy=per-vrf redistribute=connected,bgp route-distinguisher=65000:111 vrf=VRF_INET

Is this the expected behavior? or is there an error in my configuration?
Last edited by clambert on Mon Mar 27, 2023 4:25 pm, edited 1 time in total.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes on BGP

Fri Feb 10, 2023 12:10 am

Yes, that is correct, currently BGP is not copying BGP attributes from VPNv4 route to copy route.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes on BGP

Fri Feb 10, 2023 2:53 am

Understood mrz. Will BGP attributes be available within the VRFs at some point in the future? Or is there any other way to use BGP attributes inside a VRF? We currently use BGP attributes to filter eBGP advertised prefixes within VRFs in ROSv6.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes on BGP

Fri Feb 10, 2023 12:19 pm

Right now we are working on changes to get full set of BGP attributes for ip routes in the vrf.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes on BGP

Fri Feb 10, 2023 12:40 pm

Great! Thank you mrz for your assistance!
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1275
Joined: Tue Jun 23, 2015 2:35 pm

Re: BGP attributes on BGP

Fri Feb 10, 2023 12:49 pm

@mrz


also i got issues when i'm running Route-Reflector with vpn4-VRF.

do we know when this will be fixed?
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Mon Mar 27, 2023 4:36 pm

RouterOS version 7.9beta version brings with it the following change:
*) bgp - improved BGP VPN selection;

Now prefixes learned within the VRF no longer appear as "copy" type. However, the origin of the prefixes (within the VRF) is eBGP, therefore the distance is 20.

In addition, BGP attributes, such as communities, are still not transmitted within the VRF.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes inside VRF

Mon Mar 27, 2023 4:53 pm

I do not understand how distance is related to attributes being transferred or not, these are completely unrelated things. Also, BGP attributes are forwarded in both cases whether it is iBGP or eBGP.

To run BGP best path between BGP routes received within VRF and imported vpnv4 routes, you have to set up the proper router id on the BGP VPN configuration. ID must be equal to the ID of the peer in the VRF. Only then routes will be considered to be from the same BGP instance and the best path algorithm will be executed.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Mon Mar 27, 2023 6:47 pm

You probably misinterpreted what I wrote. I was referring to problems in distance and BGP attributes as separate topics.

In ROSv6, prefixes learned via VPNv4 are received with distance 200 (iBGP) within the VRF, but in ROSv7.9beta4 the distance for these prefixes is 20 (eBGP).

On the other hand, the BGP attributes (eg communities), present in the routing table for the vpn4 afi, are not present for the ip4 afi within the VRF.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes inside VRF

Tue Mar 28, 2023 7:06 pm

copying community attribute will be fixed in the next beta.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Tue Mar 28, 2023 7:55 pm

Great! Thanks again mrz!
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Fri Mar 31, 2023 3:37 pm

ROS version 7.9rc1 resolved the issue with BGP attributes within a VRF.

On the other hand, the administrative distance continues to be 20 (eBGP) despite the fact that in this version 7.9rc1 the origin attribute was corrected and the prefixes appear as coming from iBGP.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes inside VRF

Fri Mar 31, 2023 3:40 pm

origin attribute has nothing to do with whether the route comes from iBGP or eBGP.
IGP means that the route is imported into BGP via BGP networks
EGP historic from EGP protocol
incomplete - imported via other IGP protocols like OSPF or static routes.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Fri Mar 31, 2023 3:46 pm

Thank you very much mrz, i was totally confused with the meaning of that attribute.

I also ask you the reason why the distance is 20, since these routes are learned through iBGP.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP attributes inside VRF

Fri Mar 31, 2023 3:53 pm

Currently logic is that since there is no actual BGP connection between VRFs of remote PEs these routes are considered external, because imported from the external source aka from VPNv4. But we can change to 200 it does not make much difference anyway.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Fri Mar 31, 2023 4:03 pm

Understood. This criteria differs from the one used in ROS v6.48.6 and also from other vendors (where the administrative distance value 200 is used for prefixes learned via iBGP within the VRF).
 
EvilBart
just joined
Posts: 3
Joined: Thu Apr 27, 2023 10:12 am
Location: Warsaw/Poland

Re: BGP attributes inside VRF

Thu Apr 27, 2023 10:08 pm

I do not understand how distance is related to attributes being transferred or not, these are completely unrelated things. Also, BGP attributes are forwarded in both cases whether it is iBGP or eBGP.

To run BGP best path between BGP routes received within VRF and imported vpnv4 routes, you have to set up the proper router id on the BGP VPN configuration. ID must be equal to the ID of the peer in the VRF. Only then routes will be considered to be from the same BGP instance and the best path algorithm will be executed.
Can You please clarify "you have to set up the proper router id on the BGP VPN configuration" with example? What command sets the router id in BGP VPN configuration?

Regards
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: BGP attributes inside VRF

Sun Apr 30, 2023 9:02 pm

Here you can find the configuration of the mentioned parameter:
https://help.mikrotik.com/docs/display/ ... Properties

Who is online

Users browsing this forum: No registered users and 13 guests