Community discussions

MikroTik App
 
LookedPath
just joined
Topic Author
Posts: 12
Joined: Fri Jan 28, 2022 1:03 pm

ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 3:37 pm

Hello,
I have a CCR1036 that receives a FIRT from my transit and I also have a peering session in an IXP.
I have filters that set the local-pref of all the routes that I receive from the IXP's Route Server at 150.
Google announces its networks on my IXP and testing I noticed that I was being routed through my transit provider instead of the IXP.
After investigating I verified that I receive the routes from Google and they have a local-pref of 150 but the routes coming from my transit are still active even though they have a lower local-pref.
You can see a screenshot of the routes:
ecmp-google.jpg
As you can see they both of them are active and marked with ECMP despite the second one having a higher local-pref and a shorter as-path.
I've also tried setting a higher weight for the routes coming from the IXP but there's no difference.
The only way that I was able to select the second route without filtering the first is setting a lower distance on the routes coming from the IXP.
Am I forgetting something or is there something wrong?
You do not have the required permissions to view the files attached to this post.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7167
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 3:42 pm

BGP from one instance can install only one best route. From your route output it appears that each route is received from its own BGP instance. In this case of course bgp best path selection is not applied.
 
LookedPath
just joined
Topic Author
Posts: 12
Joined: Fri Jan 28, 2022 1:03 pm

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 3:59 pm

BGP from one instance can install only one best route. From your route output it appears that each route is received from its own BGP instance. In this case of course bgp best path selection is not applied.
Yes the two routes are received from two different sessions but I really don't understand what you're saying.
What is the point of having a local-pref for a specific route if the bgp best path selection isn't applied to the same route being sent from another session?
The problem here is not that the route is installed but rather that is being marked as active and not as a candidate.
I have other routes that are being announced both on the transit and at the IXP and the local-pref is working as intended, the routes with a lower local-pref are being marked as candidates and the ones with a higher local-pref are being marked as active.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7167
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 4:03 pm

Post your BGP config
 
LookedPath
just joined
Topic Author
Posts: 12
Joined: Fri Jan 28, 2022 1:03 pm

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 5:18 pm

Here is the BGP configuration for those two peers and the filters:
Post your BGP config
/routing bgp connection
add address-families=ip as=56488 connect=yes disabled=no input.filter=\
IXP_IN_IPv4 local.address=185.1.114.91 .role=ebgp-peer name=\
"MINAP rs1 IPv4" output.filter-chain=OUT_IPv4 .filter-select="" .network=\
bgp-announce-v4 remote.address=185.1.114.252/32 .as=43369 router-id=\
185.1.114.91 routing-table=main templates=default

add address-families=ip as=56488 connect=yes disabled=no input.filter=\
TRANSIT_IN_IPv4 listen=yes local.address=185.157.231.101 .role=\
ebgp-provider name="FiberTelecom IPv4" output.filter-chain=OUT_IPv4 \
.filter-select="" .network=bgp-announce-v4 remote.address=\
185.157.231.100/32 .as=41327 router-id=185.157.231.101 routing-table=main \
templates=default
/routing filter rule
add chain=TRANSIT_IN_IPv4 disabled=no rule="if (dst-len > 24) \r\
\n{reject}\r\
\nelse\r\
\n{\r\
\nset bgp-local-pref 100;\r\
\njump IN-RFC-6890-IPv4;\r\
\n}\r\
\n"
add chain=IXP_IN_IPv4 disabled=no rule="if (dst-len == 0 || dst-len > 24) \r\
\n{reject}\r\
\nelse\r\
\n{\r\
\nset bgp-local-pref 150;\r\
\njump IN-RFC-6890-IPv4;\r\
\n}"
add chain=IN-RFC-6890-IPv4 comment="Discard private IPv4" disabled=no rule="if\
( dst in 0.0.0.0/8 || dst in 10.0.0.0/8 || dst in 100.64.0.0/10 || dst in \
127.0.0.0/8 || dst in 169.254.0.0/16 || dst in 172.16.0.0/12 || dst in 192\
.0.2.0/24 || dst in 192.88.99.0/24 || dst in 192.168.0.0/16 || dst in 198.\
18.0.0/15 || dst in 198.51.100.0/24 || dst in 203.0.113.0/24 || dst in 240\
.0.0.0/4 || dst in 255.255.255.255/32)\r\
\n{reject}\r\
\nelse\r\
\n{jump IN_OWN_PREFIX_IPv4}"
add chain=IN_OWN_PREFIX_IPv4 comment="Discard own prefix" disabled=no rule=\
"if (dst in x.x.x.x/24) \r\
\n{reject}\r\
\nelse\r\
\n{accept}"
Let me know if you need more.
Last edited by LookedPath on Wed Mar 02, 2022 5:50 pm, edited 1 time in total.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7167
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 5:43 pm

Set to use the same template and the same router-id for both connections.
 
LookedPath
just joined
Topic Author
Posts: 12
Joined: Fri Jan 28, 2022 1:03 pm

Re: ROS 7.1.2 BGP Ignoring local-pref and bgp-weight

Wed Mar 02, 2022 6:07 pm

Set to use the same template and the same router-id for both connections.
You are right, it was the router-id.
Thanks for the help.

Who is online

Users browsing this forum: No registered users and 4 guests