DuxTel Systems (11)
Interface Cards and Adapters (14)
Mikrotik Systems-> (157)
Mimosa Wireless (5)
RouterBOARD (11)
Router Enclosures (11)
Power Supplies & PoE-> (29)
Antennas and Accessories-> (106)
Mikrotik RouterOS (6)
Assembled Kits (6)
Carrier Wireless (1)
Cable and Misc (14)
Hardware and Mounting (23)
Configuration Library (FREE!) (7)
Quick Find
search products
search articles
New Articles
Case Studies
Product Guides (2)
Mikrotik Configuration (17)
Technical (5)
Community News (9)
Q&A (28)
Product Advisory (7)
Policy and Information (7)
Shipping & Returns
Privacy Notice
Conditions of Use
Contact Us
Load balancing with Fail-over by Mike Everest

Q: We want to have the mikrotik manage the connections to be load balanced, so we aren’t hammering either link more than the other. The only caveat for us is there’s a bunch of inbound traffic that will come over one link, obviously that needs to go back out over that link… right?

Of course, we want failover too, so if one link drops, the other will do its job.

 The technique is conceptually straight-forward:

1. Use ‘mangle’ feature to select and mark connections, e.g. add connection mark “web” to traffic with dest port=80:

/ip firewall mangle add action=mark-connection chain=prerouting connection-state=new \
    disabled=no dst-port=80 new-connection-mark=web passthrough=yes protocol=tcp

2. Use ‘mangle’ feature to add route mark on selected connections, e.g. add route mark “isp2” when connection mark is “web”:

/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=web disabled=no \
new-routing-mark=isp2 passthrough=yes

3. Add default route for marked traffic with distance=1, e.g. send traffic via ppp-out2 for route mark “isp2”:

/ip route add check-gateway=ping disabled=no distance=1 dst-address= gateway=pppoe-out2 \

4.Add backup route (distance >1) via other uplink for failover, e.g. use pppoe-out1 when check-gateway=ping fails for primary uplink path:

/ip route add check-gateway=ping disabled=no distance=10 dst-address= gateway=pppoe-out1 \


a. When the uplink path is not ppp, use the next hop gateway address instead of pppoe interface name
b. Use ‘per connection classifier’ (ppc) feature to balance approximately equally across multiple uplinks

You are welcome to contact us at any time if you wish to discuss these concepts further.



Date Added:
Current Comments: 0
Write Review
Tell a friend
Tell a friend about this article:  
Shopping Cart
0 items
Latest News
about 5 days ago
LOOK! The new wsAP-lite is a dual band WiFi AP with passthrough PoE ethernet that fits into a power point profile!
more >>
about 5 days ago
The new LtAP-mini is the ideal mobile and vehicle connectivity system with GPS - add your own 4G modem for the ulti…
more >>
about 5 days ago
The cool new RBLHGG-60adkit Wireless Wire Dish Kit is on its way - available for pre-order right now!
more >>
about 5 days ago
DuxTel News: Half-price Mimosa, MikroTik LTE updates, MUM 2018 Highlights -
more >>
about 01 month ago
CCR1072-1G-8S+ - it doesn't get any better than this! Normally $4325, special price $2999 - (ex demo model, 1 unit…
more >>
about 01 month ago
ready for MikroTik Certified Training - kicking off TOMORROW! :)
more >>
about 01 month ago
MikroTik's first ever true 802.3af/at PoE switch with auto-detecting 24v/48v and 4x 10GB SFP+ uplink is available n…
more >>
about 01 month ago
Thinking about horns? See here! :)
more >>
about 01 month ago
The QuickMount-PRO includes support for the new SQT-Sq products has just arrived!
more >>
Follow our tweets for all the latest news and updates!
GrooveA-52HPn: dual-band outdoor AP
The GrooveA-52HPn is an amazing unit. Exactly what you would ..
5 of 5 Stars!

Copyright © 2018 DuxTel Online Store