Community discussions

MikroTik App
 
bdowne01
just joined
Topic Author
Posts: 3
Joined: Sun Jan 28, 2024 9:45 pm

BGP Default Route Disappearing

Sun Jan 28, 2024 10:09 pm

Hi all. New to Mikrotik, but not new to routing. Trying to learn the nuances of the platform.

I have three router eBGP peers configured as follows, each with their own AS. R2 is the Mikrotik. The others are different vendors.

R1 <-> R2 <-> R3

R1 is originating default and injecting into eBGP. R2, the Mikrotik, is receiving it passing it to R3 with no problems. R1 & R2 are peered over a shared /29, R1 being 192.168.68.209 and R2's being 192.168.68.210.

However R2, the Mikrotik, doesn't seem to want to use the default route learned via BGP. It only works if I configure a static entry with the same info. For example:
[localadmin@MikroTik] /ip/route> pr
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, s - STATIC, b - BGP, o - OSPF
Columns: DST-ADDRESS, GATEWAY, DISTANCE
#     DST-ADDRESS        GATEWAY                           DISTANCE
  D b 0.0.0.0/0          192.168.68.209                          20
0  As 0.0.0.0/0          192.168.68.209                          10
[localadmin@MikroTik] /ip/route> /ping 1.1.1.1
  SEQ HOST                                     SIZE TTL TIME       STATUS
    0 1.1.1.1                                    56  50 20ms24us
    1 1.1.1.1                                    56  50 19ms960us
Note the static distance, I can ping 1.1.1.1 just fine.

Now, if I make the static distance longer so BGP is selected, it go boom.
[localadmin@MikroTik] /ip/route> pr
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, s - STATIC, b - BGP, o - OSPF
Columns: DST-ADDRESS, GATEWAY, DISTANCE
#     DST-ADDRESS        GATEWAY                           DISTANCE
  DAb 0.0.0.0/0          192.168.68.209                          20
0   s 0.0.0.0/0          192.168.68.209                          25
[localadmin@MikroTik] /ip/route> /ping 1.1.1.1
  SEQ HOST                                     SIZE TTL TIME       STATUS
    0 1.1.1.1                                                      timeout
    1 1.1.1.1                                                      timeout
Doing more debug, I see strange behavior if I disable the static outright. The BGP route briefly goes 'Active' but then disappears leaving no default route in the FIB.
[localadmin@MikroTik] /ip/route> print detail where dst-address=0.0.0.0/0
Flags: D - dynamic; X - disabled, I - inactive, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, i - is-is, d - dhcp, v - vpn, m - modem, y - bgp-mpls-vpn;
H - hw-offloaded; + - ecmp
 0  Xs   dst-address=0.0.0.0/0 gateway=192.168.68.209 distance=10

   DAb   dst-address=0.0.0.0/0 routing-table=main gateway=192.168.68.209 immediate-gw=192.168.68.209%ether1
         distance=20 scope=40 target-scope=10 suppress-hw-offload=no
 
Then a few moments later...
[localadmin@MikroTik] /ip/route> print detail where dst-address=0.0.0.0/0
Flags: D - dynamic; X - disabled, I - inactive, A - active;
c - connect, s - static, r - rip, b - bgp, o - ospf, i - is-is, d - dhcp, v - vpn, m - modem, y - bgp-mpls-vpn;
H - hw-offloaded; + - ecmp
 0  Xs   dst-address=0.0.0.0/0 gateway=192.168.68.209 distance=10

 
I've reviewed the route selection documentation and understanding anything that explains the behavior. Where am I going wrong?
 
bdowne01
just joined
Topic Author
Posts: 3
Joined: Sun Jan 28, 2024 9:45 pm

Re: BGP Default Route Disappearing

Mon Jan 29, 2024 8:10 pm

Ok, after bonking my head on this for a day I figured it out. I had "output.default-originate=if-installed" defined at the bgp template level. When the BGP default route from R1 went active, the R2 Mikrotik would advertise 0.0.0.0/0 right back to R1 creating a loop. I fixed this by removing output.default-originate from the template and defining it at the connection instead.

However this presents another question. In a topology such as this, where each router is a private AS, where R1 is originating the 'real' default route, 0.0.0.0/0:
 |----- R3
 |       |    
R1  --- R2 ---  R5
 |       |
 |----- R4
Normally R2, R3 and R4 would have output.default-originate disabled to the sessions facing each other and perhaps R2->R5 set to output.originate-default=always.

However, if any session from R2, R3, or R4 to R1 goes down they should advertise 0.0.0.0/0 via the closest peer.

How is this accomplished in conjunction with the output.default-originate parameter?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP Default Route Disappearing

Tue Jan 30, 2024 11:00 am

Typically you run IGP in your network, which deals with the default route.
 
bdowne01
just joined
Topic Author
Posts: 3
Joined: Sun Jan 28, 2024 9:45 pm

Re: BGP Default Route Disappearing

Tue Jan 30, 2024 8:26 pm

Makes sense to use an IGP in most situations, but is there a mechanism to allow routerOS to operate in a mixed router vendor environment where default is distributed like other prefixes?

Who is online

Users browsing this forum: No registered users and 3 guests