Skip to content

Pratama Digital

Your Digital Partner

Menu
  • Home
  • Download Area
  • Pratama Digital Net
  • Internet Speed Test
  • About Us
Menu

Mikrotik load balance with 3 ISP, 2 ISP with ECMP and 1 ISP for static routing

Posted on January 17, 2024

Configuring load balancing with MikroTik for three ISPs, where two ISPs use Equal-Cost Multi-Path (ECMP) and the third ISP employs static routing, involves a combination of routing policies and firewall rules. Below is a general guide to help you set up this scenario. Note that specific details may vary based on your network architecture and MikroTik RouterOS version.

1. Configure IP Addresses:

  • Assign IP addresses to the relevant interfaces for each ISP.
/interface ethernet
add name=ether1-wan1
add name=ether2-wan2
add name=ether3-wan3

/ip address
add interface=ether1-wan1 address=10.1.2.2/30
add interface=ether2-wan2 address=10.2.3.2/30
add interface=ether3-wan3 address=10.3.4.2/30

2. Configure ECMP for ISP1 and ISP2:

  • Set up ECMP for ISP1 and ISP2.
/ip route
add dst-address=0.0.0.0/0 gateway=10.1.2.1 scope=10
add dst-address=0.0.0.0/0 gateway=10.2.3.1 scope=10

3. Configure Static Route for ISP3:

  • Add a static route for ISP3.
/ip route
add dst-address=0.0.0.0/0 gateway=10.3.4.1 scope=10

4. Set Up ECMP for Client 172.2.2.0/24:

  • Create an address list for the client network.
/ip firewall address-list
add list=client-network address=172.2.2.0/24
  • Set up ECMP for the client network.
/ip route
add dst-address=172.2.2.0/24 gateway=10.1.2.1
add dst-address=172.2.2.0/24 gateway=10.2.3.1

5. Set Up Static Routing for Client 172.3.3.0/24:

  • Add a static route for the static routing client network.
/ip route
add dst-address=172.3.3.0/24 gateway=10.3.4.1

6. Configure Firewall Mangle Rules:

  • Create mangle rules to mark connections for each ISP.
/ip firewall mangle
add action=mark-routing chain=prerouting src-address-list=client-network new-routing-mark=to-isp1
add action=mark-routing chain=prerouting src-address-list=client-network new-routing-mark=to-isp2
add action=mark-routing chain=prerouting src-address=172.3.3.0/24 new-routing-mark=to-isp3

7. Configure NAT Rules:

  • Set up NAT rules to masquerade traffic going out through each ISP.
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-wan1 routing-mark=to-isp1
add action=masquerade chain=srcnat out-interface=ether2-wan2 routing-mark=to-isp2
add action=masquerade chain=srcnat out-interface=ether3-wan3 routing-mark=to-isp3

8. Firewall Filter Rules:

  • Create filter rules to accept established and related connections.
/ip firewall filter
add action=accept chain=input connection-state=established,related
add action=accept chain=output connection-state=established,related

These steps provide a basic configuration for load balancing with MikroTik using ECMP for two ISPs and static routing for the third ISP. Ensure that you adapt the configuration to your specific network setup, considering factors such as interface names, IP addresses, and subnet masks. Testing and monitoring the network behavior after applying these configurations are crucial to ensure proper load balancing and failover functionality.

Share this:

  • Facebook
  • X

Related

Leave a Reply Cancel reply

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

Recent Posts

  • 10 Powerful Alternatives to MikroTik for Small to Enterprise Networks
  • LDAP: A Guide for Linux System Administrators
  • Virtual Private Server (VPS): A Guide for Beginners
  • Forward Ports on Your Router for Online Games
  • MikroTik RouterOS 6 vs. RouterOS 7: Key Differences, Advantages, and Disadvantages

Tags

24h clock adobe adobe cc adobe cs master almalinux arduino autodesk basic ip address cad software calculator php connect java dns server download photoshop ecmp formula ipv4 innodb install iptables ipsec iptables java mysql linux firewall linux mint linux security load balance microsoft office myisam mysql mysql engine node.js nodejs nth office alternative openvpn pcc php port game online port mikrotik postgresql postgresql to mysql public dns rocky linux running text script php ubuntu LTS wireguard

Categories

  • Advertising
  • CAD software
  • Computer Component
  • Control Panel
  • Database
  • DNS
  • Download
  • File Server
  • Firewall
  • Graphic Design
  • Internet
  • IP Address
  • Linux OS
  • Load Balance
  • Mikrotik
  • Movie
  • Novel/Book
  • Office
  • OpenWRT
  • Processor & GPU
  • Programming
  • Routing
  • Security
  • Server
  • Tutorial
  • Video Editing
  • VPN
  • Web Programming
  • Windows OS
  • Wordpress

About Us

We are a company specializing in network configuration, MikroTik and computer installation services, as well as wifi setup. With experience dating back to 2017, we have gained the trust of numerous clients from various regions who rely on our services. Our expertise extends to catering to personal, office, institutional, and industrial needs.

Archives

  • December 2024
  • September 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023

Recent Posts

  • 10 Powerful Alternatives to MikroTik for Small to Enterprise Networks
  • LDAP: A Guide for Linux System Administrators
  • Virtual Private Server (VPS): A Guide for Beginners
  • Forward Ports on Your Router for Online Games
  • MikroTik RouterOS 6 vs. RouterOS 7: Key Differences, Advantages, and Disadvantages
©2025 Pratama Digital | Design: Newspaperly WordPress Theme