Community discussions

MikroTik App
 
RK
Long time Member
Long time Member
Topic Author
Posts: 565
Joined: Tue Nov 21, 2006 11:22 am
Location: Winnipeg, Canada and Central America

BGP Advertisement interval setting?

Mon May 24, 2021 6:04 pm

Does RouterOS implement the BGP Advertisement interval configuration?

I have a BGP peer which is unstable for a few minutes per day (this is a design limitation that can't be changed).
I want to be able to configure RouterOS to only use this peer after it has been online for at least 10 minutes.
 
Woudanator
just joined
Posts: 7
Joined: Sat Feb 03, 2018 11:27 pm

Re: BGP Advertisement interval setting?

Fri May 28, 2021 2:08 pm

Hi Rk

I don't think this is possible does it happen at a set time every day or is it at random times
 
RK
Long time Member
Long time Member
Topic Author
Posts: 565
Joined: Tue Nov 21, 2006 11:22 am
Location: Winnipeg, Canada and Central America

Re: BGP Advertisement interval setting?

Tue Jun 15, 2021 8:21 pm

Random times
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: BGP Advertisement interval setting?

Tue Jun 15, 2021 11:58 pm

One of our engineers did something similar.....you could try this

# PEER NAME
:local peer "HE"
# PREFIXES - SET A COMMENT TO KNOW WHICH ONES SHOULD BE ENABLE
:local peerOutFilterIdentifier "HE-OUT-PREFIXES"
# UPTIME IN MKT FORMAT
:local enoughUptime 10m
# GET CURRENT UPTIME
:local currentUptime [:routing bgp peer get value-name=uptime [:routing bgp peer find where name=$peer]]
# IS IT ENOUGH?
:if ($currentUptime > $enoughUptime) do={
# ENABLE THE FILTER
/routing filter enable [:routing filter find where comment=$peerOutFilterIdentifier]
} else={
# DISABLE THE FILTER
/routing filter disable [:routing filter find where chain=$peerOutFilterIdentifier]
}

You can put that into a scheduler every 1min or so.

There may be more efficient ways to do it, but this should work.

Who is online

Users browsing this forum: No registered users and 20 guests