Tuesday , 5 May 2026
Home » MikroTik » BGP on MikroTik

BGP on MikroTik

BGP on MikroTik

 

bgp on mikrotik, To add a BGP peer in a MikroTik router, follow these steps:


✅ Step 1: Enable BGP on MikroTik

Before adding a BGP peer, ensure BGP is enabled:

/routing bgp instance set default as=<YOUR_AS_NUMBER> router-id=<YOUR_ROUTER_ID>
  • AS Number: Your autonomous system number (e.g., 65001)

  • Router ID: Typically the highest IP on the router (e.g., 192.168.1.1)

Example:

/routing bgp instance set default as=65001 router-id=192.168.1.1

✅ Step 2: Add BGP Peer

Now, add the BGP peer:

/routing bgp peer add name=PEER1 remote-address=<PEER_IP> remote-as=<PEER_AS> update-source=<YOUR_INTERFACE>
  • PEER_IP: The IP of your BGP neighbor

  • PEER_AS: The AS number of your neighbor

  • YOUR_INTERFACE: Interface for the BGP session (or leave blank to use the main route)

Example:

/routing bgp peer add name=ISP1 remote-address=192.168.100.2 remote-as=65002 update-source=ether1

✅ Step 3: Add Networks to Advertise

Specify which networks you want to advertise via BGP:

/routing bgp network add network=<YOUR_NETWORK>

Example:

/routing bgp network add network=10.10.10.0/24

🚨 Make sure this network exists in your routing table (/ip route print).


✅ Step 4: Verify BGP Peer Status

Check if the peer is established:

/routing bgp peer print

Expected State: established


✅ Step 5: Check Advertised and Received Routes

See advertised routes:

/routing bgp advertisements print

See received routes:

/ip route print where bgp

✅ Step 6: (Optional) Apply BGP Filters

If you want to filter which routes are advertised/accepted:

  • Allow all incoming routes:

    /routing filter add chain=bgp-in action=accept
  • Allow all outgoing routes:

    /routing filter add chain=bgp-out action=accept

For custom filters, use prefix lists or match rules.


🎯 Summary

  1. Enable BGP → Set AS number & Router ID

  2. Add BGP Peer → Define the remote IP & AS

  3. Advertise Networks → Add networks to BGP

  4. Check Peer Status → Verify it’s “established”

  5. Monitor Routes → Check advertised & received routes

  6. (Optional) Apply Filters → Control route flow


Let me know if you need help!

HOME

Check Also

BRIDGE CONFIGURATION ON MIKROTIK ROUTER

BRIDGE CONFIGURATION ON MIKROTIK ROUTER

Bridge Configuration on MikroTik Router A bridge in MikroTik allows multiple interfaces to be grouped …

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »