Community discussions

MikroTik App
 
connected2122
just joined
Topic Author
Posts: 4
Joined: Fri Oct 21, 2022 10:54 pm

bgp-local-pref issue CHR v7.6

Fri Oct 21, 2022 11:43 pm

Hi folks.

I'm currently evaluating RouterOS v7.6 using the CHR.

I'm probably overlooking something simple here but I don't know where else to go.

The BGP documentation (https://help.mikrotik.com/docs/display/ ... hSelection) for Best Path Selection states:
Prefer the path with the highest LOCAL_PREF.
This attribute is used only within an AS. A path without the LOCAL_PREF attribute has a value of 100 by default.

I cannot understand why a route with bgp-local-preference 80 is preferred over a route with bgp-local-preference 120.

Here is the output of "routing/route/print detail where bgp dst-address=100.0.0.0/8"
The inactive BGP route (local pref 120) next hop is reachable on the loopback of the iBGP peer through OSPF.
The active BGP route (local pref 80) next is reachable on the other side of a directly connected network.

NOTE: This is within a LAB environment as we are still evaluating, so happy to share full configs or any other output as required.
[admin@UK-IX2-SOUTH] > routing/route/print detail where bgp dst-address=100.0.0.0/8
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy;
H - hw-offloaded; + - ecmp, B - blackhole
  b   afi=ip4 contribution=best-candidate dst-address=100.0.0.0/8 routing-table=main gateway=10.255.255.1
       immediate-gw=10.0.0.1%ether3 distance=200 scope=40 target-scope=30 belongs-to="bgp-IP-10.255.255.1"
       bgp.peer-cache-id=*B000003 .as-path="1264" .communities=1111:120 .local-pref=120 .atomic-aggregate=yes .origin=igp
       debug.fwp-ptr=0x20342360

 Ab   afi=ip4 contribution=active dst-address=100.0.0.0/8 routing-table=main gateway=100.0.2.1
       immediate-gw=100.0.2.1%ether1 distance=20 scope=40 target-scope=10 belongs-to="bgp-IP-100.0.2.1"
       bgp.peer-cache-id=*B000001 .as-path="1264" .communities=1111:80 .local-pref=80 .atomic-aggregate=no .origin=igp
       debug.fwp-ptr=0x203422A0
[admin@UK-IX2-SOUTH] >
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7041
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: bgp-local-pref issue CHR v7.6  [SOLVED]

Sat Oct 22, 2022 10:56 am

The best path algorithm also compares routes received only by a single BGP instance.
 
connected2122
just joined
Topic Author
Posts: 4
Joined: Fri Oct 21, 2022 10:54 pm

Re: bgp-local-pref issue CHR v7.6

Sat Oct 22, 2022 2:00 pm

The best path algorithm also compares routes received only by a single BGP instance.
Thanks @mrz

After checking through the configuration, I did find that I was using different router ID's across the 2 peerings, casing 2 separate BGP instances.
After correcting the router ID's and re-establishing the sessions, The routes and local pref are being handled correctly.
[admin@UK-IX2-SOUTH] > routing/route/print detail where dst-address=100.0.0.0/8
Flags: X - disabled, F - filtered, U - unreachable, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, d - dhcp, v - vpn, m - modem, a - ldp-address, l - ldp-mapping, y - copy;
H - hw-offloaded; + - ecmp, B - blackhole
 Ab   afi=ip4 contribution=active dst-address=100.0.0.0/8 routing-table=main gateway=10.255.255.1
       immediate-gw=10.0.0.1%ether3 distance=200 scope=40 target-scope=30 belongs-to="bgp-IP-10.255.255.1"
       bgp.peer-cache-id=*B000003 .as-path="1264" .communities=1111:120 .local-pref=120 .atomic-aggregate=yes .origin=igp
       debug.fwp-ptr=0x20342360

  b   afi=ip4 contribution=candidate dst-address=100.0.0.0/8 routing-table=main gateway=100.0.2.1
       immediate-gw=100.0.2.1%ether1 distance=20 scope=40 target-scope=10 belongs-to="bgp-IP-100.0.2.1"
       bgp.peer-cache-id=*B000001 .as-path="1264" .communities=1111:80 .local-pref=80 .atomic-aggregate=no .origin=igp
       debug.fwp-ptr=0x203422A0
[admin@UK-IX2-SOUTH] >

Who is online

Users browsing this forum: No registered users and 17 guests