Mikrotik – Configure BGP (eBGP) for a given network

Published on Author gryzli

I assume the following setup:

Router1 (Some external router) , with AS: 65532

Mikrotik router (our internal router) , with AS: 65535

Network prefix: , delegated to AS 65535 (our internal router)

Router1.IP ==

Mikrotik.IP ==


1. Enable BGP on the Mikrotik router

[admin@MikroTik] /interface> /routing bgp instance set default as=65535 redistribute-static=no router-id=


2. Add our network to BGP on Mikrotik

[admin@MikroTik] > /routing bgp network add network=  comment="Network delegated to our AS: 65535"


3. Create input/output filters on Mikrotik router

We must create input/output filters on our router in order we to NOT annouce other network.

When using invert-match=yes, we tell the router to discard everything BUT the prefix stated

# Allow only as annoucements
[admin@MikroTik] > /routing filter add chain=to_R1 prefix= invert-match=yes action=discard


4. Add BGP neighbour R1 to Mikrotik

[admin@MikroTik] > /routing bgp peer add remote-address= remote-as=65532


5. Finally … Validate the route for the network

[admin@MikroTik] /routing bgp advertisements> /ip  route print where dst-address=