Some questions - bgp and routing

I’m rather new user to Mikrotik, I have read all docs and some questions are still unanswered:

  • why bgp has so poor performance?
  • why bgp does not see restart of a peer? I have to refresh the peer
    manualy on Mikrotik every time I reset its peer
  • how to check what prefixes are announced to peer?
  • why routing table performance is so poor? (for example - list 180.000
    entries, remove some etc)
  • is it possible to do ttl checking of packets?
  • how to make network definition in bgp instance
  • how to make null interface
  • [admin@krk-r1] > /ip route remove 14235
    item number too large
    what to do with the above problem?
  • how to list only static routes?

I use MikroTik RouterOS 2.9.22 and routing-test package.
Thanks in advance for any help.

Hi!

I’ll try to answer some of your questions below:

What do you mean by “poor” performance? We’re using BGP to our upstream providers without any issues (although we’re only accepting the default route and not a full table).

This is something that haunted us for quite some time, until we debugged it with our upstream provider and saw that the timers weren’t decrementing.

Access the CLI:

/routing bgp peer
print detail

Chances are there are no hold-timer or keepalive-timer references there (or they’re set to 0 or something).

Set the hold-timer to 60 and the keepalive timer to 20 in order to emulate the timers on a Cisco device.

set 0 hold-timer=60 keepalive-timer=20



You used to be able to access Quagga via telnet from the localhost on 2.8.xx, but 2.9.xx appears to have done away with that access to BGP.

You can view the networks you have in

/routing bgp network print detail

and also check your prefix lists that you may have attached for inbound or outbound advertisements.

I don’t have any info on these…

I don’t know if this is recommended, but I’ve created a bridge interface without any ports being assigned to it in order to simulate a null interface.

You cannot (at least on 2.8.xx) remove a dynamic route. If you wish to prevent a route learned via BGP from being injected into your table, use prefix lists to deny it.

You could use some scripting:

:foreach route in [/ip route find static=yes] do [/ip route print from=$route]

Not pretty, but it could get you started to what you’re trying to find.

-Rich

I mean that I have Pentium III 1.7 GHz machine with Mikrotik and whole BGP list is loaded about 30 minutes!!! Quagga on the same machine loads all prefixes in abount 30 seconds.

Thanks, that should be helpful, however I think that mikrotik should see tcp reset packets and imidiatly reset the session not waiting to time out.

That is not the answer. For now Mikrotik is amateur and cannot act a professional router. Such router needs sh ip bg nei X.Y.W.Z ad command and full other bgp functionality.

It’s still a trick or hack, I prefer using documented solutions.

No, the route number 14235 was static - I have checked it :slight_smile:
But Mikrotik does not accept the input.

Thanks, that should be helpful!

Gregor

Sorry, can’t help you there. We only accept the default route from our upstream peers (one per city) and redistribute that default route with a lower priority to the other cities. That way the upstream for a city is always it’s upstream peer and falls back to our fiber between cities if the upstream peer fails.

I’m not an authority on BGP, but from what I understand, BGP does not maintain an established connection.

The keepalive-timer sends out a keepalive packet to the remote host upon expiration if no packets have been received from the remote host. Any packets received from the remote host reset the keepalive-timer.

The hold-timer sets how long can go between received packets from the peer before closing the session due to keepalive failure.

Setting hold-timer to 60 and keepalive-time to 20, 2 keepalive packets will be sent to try to establish that the BGP session is still up. If, after 60 seconds, no reply is received, BGP drops the session.

I agree that a command line interface to the BGP and OSPF functions is necessary… and was provided (though not actually documented - like the hold-timer and keepalive-timer) in RouterOS 2.8.xx, but has been removed in 2.9.xx to my knowledge.

The null interface on a Cisco (or other router) is the same kind of trick or hack… It’s an interface that not used for actual traffic. You create one on a Cisco and reference it as Null0 (or whatever) and I create one on a MikroTik and reference it as null. Granted, it is not an official “null interface”, but performs the exact same function.

After all, this is just my advice and/or opinions… take them or leave them :wink:

Ah… perhaps the remove command is looking for a different integer size than the add/print commands or something. That would have to be resolved by MikroTik support. But, you could get the route reference using a technique like below for finding all the static routes and remove it by reference instead of route number.

Yes, the scripting is quite powerful (for a CLI) on the MikroTiks. Allows you to script almost anything that you can do manually, if you know the steps to take to get the desired result.

Good luck!

-Rich

It does. BGP uses TCP connections on port 179. When BGP router receives TCP reset it MUST close the session and clear all routes immediately!
It can’t wait any second. I use Mikrotik not for fun. I want router, not a toy.

Is a TCP RESET not causing the RIB to update? If it is not, send a bug report to mikrotik because it used to and should.