Label

Translate

Populer

Langsung ke konten utama

How to Configure BGP on RouterOS v7 | Full Setup Guide

How to Configure BGP on RouterOS v7 – A Comprehensive Guide


Haii kawan jumpa lagi bersama blog tak beraturan tapi pengalaman. kali ini kita akan bahas sedikit tips koneksi menggunakan BGP pada Mikrotik ros V7.X full setup. oke langsung aja gasssss...............

Border Gateway Protocol (BGP) is the backbone of internet routing, enabling dynamic communication between networks and autonomous systems. With the release of **RouterOS v7**, MikroTik has introduced a new approach to BGP configuration, streamlining workflows while offering greater flexibility for both enterprise and ISP environments.


In this article, we'll walk you through a **step-by-step guide** on how to configure BGP in **RouterOS v7**, covering everything from basic setup to route redistribution and advertisement. Whether you're an experienced network engineer or just starting with BGP, this guide will help you get your peers up and running efficiently using the latest features available in RouterOS v7.


---


## **Understanding BGP Basics Before Configuration**


Before diving into the configuration process, it's important to understand what BGP does and why it's crucial in large-scale networking environments.


### What is BGP?


BGP (Border Gateway Protocol) is a standardized exterior gateway protocol used to exchange routing information between different networks on the internet. It enables routers to determine the most efficient path for data transmission across multiple networks.


There are two primary types of BGP:


- **eBGP (External BGP):** Used between different autonomous systems (AS).

- **iBGP (Internal BGP):** Used within the same autonomous system, typically in large ISP infrastructures.


BGP works by maintaining a table of IP networks or prefixes, which designate network reachability among ASs. It’s often used for **multi-homing**, **route failover**, and **traffic engineering**.


---


## **Why Upgrade to RouterOS v7 for BGP?**


MikroTik’s **RouterOS v7** introduces a redesigned BGP configuration interface that simplifies peer management, improves scalability, and integrates better with modern routing practices. Some key changes include:


- Removal of traditional BGP instances

- Introduction of **BGP templates**

- Unified **connection-based configuration**

- Enhanced support for **address families**

- Improved **session monitoring**


These updates make BGP more intuitive and powerful than ever before.


> ✅ **Tip:** While BGP in RouterOS v7 is functional, some advanced features like prefix filtering and route reflectors are still under development. For production environments requiring full BGP capabilities, consider using RouterOS v6 until v7 matures further.


---


## **Step-by-Step BGP Configuration in RouterOS v7**


Let’s walk through the actual BGP configuration using a sample topology involving two routers: an **ISP router (PE1)** and a **customer premise equipment (CPE1)**.


### **Topology Overview**


- PE1 (AS65000) connects to CPE1 (AS65100)

- IP range between PE1 and CPE1: `172.29.0.0/30`

- CPE1 local subnet: `192.168.100.0/24`



---


### **1. Configuring BGP on PE1 (ISP Side)**


#### Step 1: Access Winbox and Navigate to BGP Settings


1. Open **Winbox** and connect to PE1.

2. Go to **Routing > BGP**.


You’ll notice there are no more "instances" — instead, BGP is now managed through **Templates** and **Connections**.


#### Step 2: Create a BGP Template (Optional)


Templates allow you to define reusable configurations for multiple peers.


1. Click on **Templates** tab.

2. Add a new template:

   - Name: `Temp1`

   - AS: `65000`

   - Address Family: IPv4

   - Default Originate: Enabled (if needed)

3. Click **Apply**.


This template can be applied when creating connections.


#### Step 3: Set Up the BGP Connection


1. Go to the **Connections** tab.

2. Click **+** to add a new connection.

3. Fill in the following fields:

   - Name: `Peer-to-CPE`

   - AS: `65000` (or use the template)

   - Address Family: IPv4

   - Remote Address: `172.29.0.2`

   - Local Role: eBGP

   - Connect Listen: Disabled (unless setting up dynamic listening)

   - Default Originate: Enabled (to send default route to CPE)

4. Click **Apply** and **OK**.





✅ This configuration allows PE1 to form a BGP session with CPE1 and advertise a default route.


---


### **2. Configuring BGP on CPE1 (Customer Side)**


#### Step 1: Use Terminal for Faster Setup


1. Open terminal on CPE1.

2. Run the following command to create a BGP connection:


```bash

/routing bgp connection add name=peer-to-isp remote.address=172.29.0.1 as=65100 local.role=eBGP

```


This command sets up a BGP peer to the ISP router at `172.29.0.1` using AS65100.


#### Step 2: Verify BGP Session Status


To check if the session is active:


```bash

/routing bgp session print

```


You should see the session state as **Established**.


---


## **Redistributing Routes via BGP**


Now that the BGP session is established, let’s explore how to redistribute routes from other protocols (like connected or static routes) into BGP.


### **Option 1: Redistribute Connected Routes**


On CPE1, run:


```bash

/routing bgp connection set [find name=peer-to-isp] output.redistribute-connected=yes

```


This tells the router to advertise all directly connected subnets to the BGP peer.


⚠️ **Warning:** Redistribution without filtering can lead to unintended route leaks. Always use filters to control what gets advertised.


---


### **Option 2: Advertise Specific Networks Using Address Lists**


For more granular control, use **firewall address lists** to specify which networks should be advertised.


#### Step 1: Create an Address List


```bash

/ip firewall address-list add list=bgp-out address=192.168.100.0/24

```


#### Step 2: Apply the Address List to BGP Output


```bash

/routing bgp connection set [find name=peer-to-isp] output.network=bgp-out

```


This ensures only the `192.168.100.0/24` network is advertised via BGP.



---


## **Troubleshooting Common BGP Issues in RouterOS v7**


Even though BGP in RouterOS v7 is functional, some bugs may cause confusion during setup.



### Issue: Prefix Count Shows Zero


Sometimes, the prefix count in the session tab remains zero even after successful route exchange. This is a known UI bug.


**Workaround:**


Disable and re-enable the BGP connection:


```bash

/routing bgp connection disable [find name=peer-to-isp]

/routing bgp connection enable [find name=peer-to-isp]

```


Then verify routes on PE1:


```bash

/ip route print where protocol=bpg

```


You should now see the advertised route (`192.168.100.0/24`) from CPE1.


---


## **Best Practices for BGP in RouterOS v7**


Here are some tips to ensure smooth operation and scalability:


- **Use Templates for Bulk Peer Management**: Save time by applying common settings to multiple peers.

- **Filter Everything You Advertise**: Always use address lists or route filters to avoid leaking unwanted routes.

- **Monitor Sessions Regularly**: Use `/routing bgp session print` to check session health.

- **Test in Lab Environments First**: Especially when upgrading from v6 to v7, test in controlled labs.

- **Stay Updated with Release Notes**: MikroTik is actively improving BGP in v7, especially in RC versions like 7.2.


---


## **Future Enhancements and Roadmap for BGP in RouterOS v7**


As of **v7.11**, BGP functionality is stable but not yet fully mature for large-scale deployments. The roadmap includes:


- Route reflection support

- Advanced filtering options

- Integration with VRFs

- Better prefix counting in UI

- Enhanced logging and debugging tools


If you're managing a large ISP or enterprise network, it may be best to **stick with v6** for now and transition once v7 reaches feature parity.


---


## **Conclusion: BGP Configuration Made Easier with RouterOS v7**


RouterOS v7 brings a fresh and simplified approach to BGP configuration, making it easier to manage large numbers of peers and streamline routing policies. While some advanced features are still under development, the current version is already suitable for lab environments, small businesses, and testing scenarios.


By following the steps outlined in this guide, you can successfully configure BGP sessions, redistribute or advertise specific routes, and maintain a secure and scalable routing infrastructure.



## **Frequently Asked Questions (FAQs)**


### Q1: Can I use BGP templates in RouterOS v7?


Yes, BGP templates allow you to define reusable configurations for multiple peers, saving time and ensuring consistency.


### Q2: Is BGP in RouterOS v7 ready for production?


While BGP is functional, advanced features like route reflection and improved filtering are still being developed. Consider using v6 for critical production environments.


### Q3: How do I advertise specific routes in BGP?


Use **firewall address lists** and apply them to the `output.network` parameter in your BGP connection.


### Q4: Why isn’t my BGP session learning routes?


Ensure the BGP session is in the **Established** state and verify your route filters or redistribution settings. Disabling and re-enabling the connection may also help.


---


## **Final Thoughts**


RouterOS v7 marks a significant shift in how BGP is configured and managed. While some features are still evolving, the foundation is strong, and the potential for future enhancements is promising.


Whether you're configuring BGP for a small business or preparing for a larger deployment, this guide gives you the tools and knowledge to get started confidently.


---


## **Support & Resources**


- [MikroTik BGP Documentation](https://help.mikrotik.com/docs/display/ROS/BGP)

- [MikroTik Community Forum](https://forum.mikrotik.com/)

- [MikroTik Training Videos](https://www.mikrotik.com/training)


If you found this guide helpful, consider supporting our work through **Patreon** or **YouTube Membership**. Your contributions help us bring more high-quality technical content to the community.


--- 


**See you in the next post!** 🚀

Komentar