Skip to content Skip to sidebar Skip to footer

Exploring MikroTik Router Proxy Load Balancing Techniques

In today's world, having reliable internet connectivity is essential for individuals and organizations alike. However, internet outages are bound to happen from time to time, causing inconvenience and hindrances in daily operations. To mitigate such situations, load balancing over multiple ISPs can be a viable solution.

Load Balancing

Load balancing is the technique of distributing network traffic across multiple internet service providers (ISPs) to avoid excessive load on any one of them. Further, it increases throughput, reliability, and redundancy of the network by utilizing available bandwidth from both ISPs. In this post, we will learn how to set up load balancing over two ISPs using a Mikrotik router.

Prerequisites

  1. A Mikrotik router with firmware version 6.0 or later installed.
  2. Two internet connections from different ISPs with their respective IP addresses and authentication details.
  3. Basic knowledge of networking concepts and the Mikrotik router.

Step 1: Configure Interfaces

The first step to setting up load balancing is to configure interfaces for each ISP connection. To do so, follow the steps below:

  1. Open the Mikrotik router WebFig interface and log in using your credentials.
  2. Go to the Interfaces tab and create two new VLAN interfaces for the two ISP connections.
  3. Go to the IP tab and assign a static IP address to each VLAN interface with the corresponding subnet mask and gateway IP from the respective ISP.

Step 2: Set Up Load Balancing

Load balancing can be set up in various ways using different techniques. However, in this post, we will use the PCC (Per Connection Classifier) method, which ensures that each connection uses a single ISP to maintain maximum connectivity. Follow the steps below:

  1. Go to the IP tab and choose the Firewall sub-menu.
  2. Create a new rule and set the chain to the "input" and the action to the "accept."
  3. Set the connection-state property to the "established, related" value.
  4. Go to the New Terminal and type the following command to set the mark for each interface.
  5. ip firewall mangle add action=mark-connection chain=prerouting in-interface=VLAN1 new-connection-mark=WAN1 passthrough=yes

    ip firewall mangle add action=mark-connection chain=prerouting in-interface=VLAN2 new-connection-mark=WAN2 passthrough=yes

  6. Create a new routing rule by navigating to the IP tab and choosing the Routes sub-menu.
  7. Set the Gateway value to the "main," and the distance value to a higher number than the default of 1.
  8. Click on the Advanced tab and set the "check gateway" and "add default route" properties to the "no" value.
  9. Go to the New Terminal and type the following command to enable NAT:
  10. ip firewall nat add chain=srcnat action=masquerade out-interface-list=WAN

Step 3: Configure Firewall and NAT Rules

The NAT and Firewall rules need to be set up to establish connectivity and avoid traffic collisions between the two ISPs. Follow the steps below:

  1. Go to the IP tab and choose the Firewall/Keeper sub-menu.
  2. Create a new rule and set the Chain value to the "input," the In-Interface value to the VLAN1/WAN1 interface, and the Action value to the "accept."
  3. Create a new rule with the Chain value set to the "input," In-Interface value to the VLAN2/WAN2 interface, and the Action value to the "accept."
  4. Set a default rule value to allow or block traffic.
  5. Go to the NAT sub-menu and create two rules to masquerade traffic over the two WAN interfaces.
  6. Go to the IP tab and choose the DNS sub-menu.
  7. Specify the DNS servers provided by both ISPs, prioritizing the primary DNS server for each ISP.
  8. Test the connectivity by pinging various web addresses and confirming that the network is balanced across both ISPs.

Conclusion

In conclusion, load balancing over multiple ISPs can help increase network redundancy, reliability, and throughput by optimizing available bandwidth. In this post, we learned how to set up load balancing over two ISPs using a Mikrotik router. By following the practical steps mentioned above, you can ensure that your network is balanced and optimized for maximum connectivity.

If you require any further assistance, please contact your local network support team.

Mikrotik Load Balancing – Template Mikrotik
mikrotik balancing wan


MikroTik Load Balancing with Failover using Policy Based Routing - YouTube
mikrotik load balancing failover routing policy based


.:SunShare IT:.: Setting Load Balancing 2 ISP di Mikrotik
balancing mikrotik isp


MikroTik Load Balancing with 2 PPPoE and 1 Static WAN using ECMP
wan balancing mikrotik pppoe ecmp



Post a Comment for "Exploring MikroTik Router Proxy Load Balancing Techniques"