How to Configuration Routing BGP on 3 Mikrotik RouterOS v7.5

3 min read 2 hours ago
Published on Oct 20, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the configuration of Border Gateway Protocol (BGP) on three MikroTik routers running RouterOS v7.5. BGP is essential for exchanging routing information between different Autonomous Systems (AS), making it a crucial component in managing internet routing. By following this guide, you will be able to set up BGP for efficient and reliable routing in your network.

Step 1: Prepare Your Environment

Before configuring BGP, ensure that you have:

  • Three MikroTik routers with RouterOS v7.5 installed.
  • Access to the routers via Winbox or SSH.
  • Static IP addresses assigned to each router for proper connectivity.

Practical Tips

  • Make a backup of your current configuration.
  • Use a consistent naming convention for interfaces and routers for ease of management.

Step 2: Configure Basic Settings on Each Router

  1. Access each router using Winbox or SSH.

  2. Set Hostname for each router:

    • Go to System > Identity.
    • Set a unique hostname for each router (e.g., Router1, Router2, Router3).
  3. Configure IP addresses:

    • Navigate to IP > Addresses.
    • Add an IP address for each router’s interface that connects to the other routers.
    • Example:
      • Router1: 192.168.1.1/30
      • Router2: 192.168.1.2/30
      • Router3: 192.168.1.3/30

Common Pitfalls

  • Ensure no IP address conflicts occur between routers.
  • Verify that interfaces are enabled and connected.

Step 3: Enable BGP on Each Router

  1. Navigate to BGP settings:

    • Go to Routing > BGP.
  2. Add a BGP instance:

    • Click on Instances and add a new instance.
    • Set the following:
      • Name: Main_BGP
      • AS Number: Set a unique AS number for each router (e.g., 65001 for Router1, 65002 for Router2, 65003 for Router3).
      • Router ID: Use the IP address of the router as the Router ID.
  3. Repeat the above for all routers, ensuring unique AS numbers.

Practical Tips

  • Use an AS number that is registered to your organization or use private AS numbers (64512–65535) if applicable.

Step 4: Configure BGP Peers

  1. Add BGP peers:

    • Under Routing > BGP > Peers, add a new peer for each router.
    • Set the following parameters:
      • Name: Peer to Router2 (for Router1), Peer to Router1 (for Router2), etc.
      • Remote Address: IP address of the neighboring router.
      • Remote AS: AS number of the neighboring router.
  2. Example for Router1:

    • Add a peer:
      • Name: Peer_Router2
      • Remote Address: 192.168.1.2
      • Remote AS: 65002
  3. Repeat for all routers to establish peer relationships.

Common Pitfalls

  • Ensure that the remote IP addresses are correctly inputted and reachable.

Step 5: Verify BGP Configuration

  1. Check BGP Status:

    • Go to Routing > BGP > Peers.
    • Verify the status of the BGP peers (should show "Established").
  2. View BGP Routes:

    • Navigate to Routing > BGP > Routes to see the routes learned via BGP.

Practical Tips

  • Use the ping command to test connectivity between routers if the BGP session does not establish.

Conclusion

You have successfully configured BGP on three MikroTik routers. By ensuring proper IP addressing, setting up BGP instances, and configuring peers, you enable efficient routing between different Autonomous Systems. For further optimization, consider exploring BGP attributes and route filtering based on your network requirements. Next steps may include setting up route redistribution or implementing additional routing protocols like OSPF for internal routing.