Can someone the right configuration please?
With 2 WAN’s so i can build the 8x WAN load-balancing.
I hope that this can.
I try the tutorial from Steve again and i have no solution with this tutorial.
Can someone the right configuration please?
With 2 WAN’s so i can build the 8x WAN load-balancing.
I hope that this can.
I try the tutorial from Steve again and i have no solution with this tutorial.
Hi Solar77,
Good Job!
Unfortunate I see your post only now, I went through the same nightmare:
Load balancing (LTE and DSL) with PCC, then Queueing subnets and remote GW failover (not only next GW)
Indeed all Wiki posts are outdated/not good or do not use one or the other.
Or this strange example of using fake 'hops" for remote GW test.
I had do dig into the original thread from ~2010 from Chupaka to find the right solution
for load balancing with failover AND with remote connection check (once you read it becomes simple to understand).
I can’t find that thread right now unfortunately.
As I did not have time to read your complete post below comments/advice might already been addressed:
But in this context they might help you or someone else.
PCC with “both address” mode works well as long as you use “RP Filtering” loose (took me 2 weeks to find that)
Keep in mind that connections and data rates are very unbalanced, so the packet traffic amount is not really equally distributed.
I would suggest you make the “failover” route distance = 2 and enable it, then it can indeed take over if one of the other fails.
Even better directly add the remote ping function for the routes (right now you only ping next hop, if something fails after that device
you are stuck as the router believes the connection is up (next hop can be pinged). All this is from Chupaka’s solution
and applied here to two WAN lines:
use 8.8.8.8 for testing that GW1 is really connected to internet
use 8.8.4.4. for testing GW2.
/ip route
add check-gateway=ping comment="ping-tested GW-1" distance=1 gateway=8.8.8.8 routing-mark=to_WAN1
add check-gateway=ping comment="ping-tested GW-2" distance=1 gateway=8.8.4.4 routing-mark=to_WAN2
add check-gateway=ping comment="Backup onto GW1 all GW2 connections" distance=2 gateway=8.8.8.8
add check-gateway=ping comment="Backup onto GW2 all GW1 connections" distance=3 gateway=8.8.4.4
add comment="route to reach ping-test-GW-2" distance=1 dst-address=8.8.4.4/32 gateway=YOUR_WAN_IP_GW1 scope=10
add comment="route to reach ping-test-GW-1" distance=1 dst-address=8.8.8.8/32 gateway=YOUR_WAN_IP_GW2 scope=10
This can be extended to more WAN, and also use more “external test points” as just Google DNS servers.
PS: If you use DHCP client on WAN , then disable “add route”
Hopefully this helps a bit.
my config can work at 2 wan as well, just remove anything to do with wan3 and change PCC to 2/0 and 2/1
the only reason I did not do a whole router export is I’ve used it to test vlan staff before and there are many unrelated code left.
what I did was step by step:
get each of wan connection working, make sure it goes to the internet
then I did test with ECMP, just add all 3 gateway IP into the route, (this route is left in my config, been disabled) . it should use them all,
once these are working, I applied rest mangle rules and added routes with marks but it did not work.
so disabled them,
I used connection-mark and routing mark to create rule for only one LAN IP 192.168.88.100 to use wan2, as an example. doing this allowed me to find the mistake where I missed in-interface.
I think the prerouting chain and in-interface=wan is to do with traffic initialised from the Internet so if you have dst-nat rule of somesort this will ensure traffic goes back to the correct gateway, I don’t use them so I’ve disabled these:
add action=mark-connection chain=prerouting connection-mark=no-mark disabled=yes in-interface=wlan2 new-connection-mark=wan1_conn passthrough=yes
Thanks for tips. This is only a trial for me to see how it would work out. If I was using it, yes fail-over will have to be there.
. I am still not clear where the DNS traffic from the router itself goes , I think this is what this rule is for but not tested and I am using 8.8.8.8 on local DHCP setting.
add action=mark-routing chain=output connection-mark=wan1_conn disabled=yes new-routing-mark=wan1_mark passthrough=yes
also, I’d expect ping 8.8.8.8 from the router itself to use the output chain and get marked but without the
add check-gateway=ping comment="fail-over route" distance=1 gateway=10.10.1.1
I am not able to ping 8.8.8.8 from the router, it just say no route to host. so clearly it’s not getting marked and I don’t understand this.
I will try to use this tomorrow and see if it gets marked
add action=mark-routing chain=output new-routing-mark=wan1_mark passthrough=yes
Yes why does output chain rule with mark route rule need passthrough=yes…
Arggg I am bamboozled.
Thank you verry much Solar77, i try this out and let you know of its working.
Anav,
Indeed in my setup output chain also has passthrough enabled:
On one WAN connection (DSL) I do further queuing in mangle to prioritise traffic based on IP subnets.
On the other WAN as it is a bigger pipe I do nothing, but it does not harm neither
as everything I do after output chain rule does not alter the routing mark afterwards, I only using connection marks.
I could try put output rules at the end, then no passthrough, but as everything works I rather don’t touch…
add action=mark-routing chain=output comment="DSL routing to interface" connection-mark=WAN1_conn new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output comment="LTE routing to interface" connection-mark=WAN2_conn new-routing-mark=to_WAN2 passthrough=yes
a
Both output rules are hit in my setup…not often but they are as this is traffic from the router itself I believe to the GW (DHCP, broadcast?).
Hello, i have try another tutorial and let you see with a video.
Load balancing don’t work, bandwidth is not cummulative i want create more bandwidth with 2 WAN"s
Why respond Mikrotik not.
https://youtu.be/sQOx1dAvta4
With RouterOS 37.4 i had now problems
plisken,
not sure I understand your post:
I am using the PCC setup as shown in this wiki:
https://wiki.mikrotik.com/wiki/Manual:PCC
this works fine, provides load balancing and has basic failover (only for next GW, but is a good starting point).
Once this works, you can add remote GW ping but this is just changing the routing rules, and will not do
anything to the load balancing (see my previous post on routes to add with recursive look up).
Make sure you use “loose” mode for RP filter if PCC / both address is selected or use source address only.
And yes, do not use “ADD DEFAULT ROUTE” in your DHCP client.
Since I don’t see that question asked, how exactly you test it?
If you have per-connection-classifier=both-addresses:x/y, it takes source and destination addresses and uses some hash to make them into number, which is then divided by x, gives you remainder y, and that’s how you split the traffic. The rest is a matter of statistics. Communication between single local device a single remote device will always use only one WAN. If the same local device starts to communicate with another remote device, it might use different WAN, but there’s still a change that the same one will be chosen. The more devices, the better. Have a thousand of local devices communicating each with thousand remote devices, and all WANs will be used equally. The less variability, the worse the distribution will be.
I had another look at your original config.
As you can see in RED, I only detected one potential error (to be removed).
As you can see in BLUE, I only added one change that is Steves presentation and is probably better programming.
Other than that I dont see anything wrong with the config? (its not complete without seeing firewall rules)
/interface bridge
add fast-forward=no name=LAN
/interface ethernet
set [ find default-name=ether9 ] name=LAN9
set [ find default-name=ether10 ] name=LAN10
set [ find default-name=ether11 ] name=LAN11
set [ find default-name=ether12 ] name=LAN12
set [ find default-name=ether13 ] name=LAN13
set [ find default-name=ether14 ] name=LAN14
set [ find default-name=ether15 ] name=LAN15
set [ find default-name=ether16 ] name=LAN16
set [ find default-name=ether1 ] name=WAN1
set [ find default-name=ether2 ] name=WAN2
set [ find default-name=ether3 ] name=WAN3
set [ find default-name=ether4 ] name=WAN4
set [ find default-name=ether5 ] name=WAN5
set [ find default-name=ether6 ] name=WAN6
set [ find default-name=ether7 ] name=WAN7
set [ find default-name=ether8 ] name=WAN8
/ip pool
add name=dhcp_pool0 ranges=192.168.100.20-192.168.100.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=LAN name=dhcp1
/interface bridge port
add bridge=LAN interface=LAN9
add bridge=LAN interface=LAN10
add bridge=LAN interface=LAN11
add bridge=LAN interface=LAN12
add bridge=LAN interface=LAN13
add bridge=LAN interface=LAN14
add bridge=LAN interface=LAN15
add bridge=LAN interface=LAN16
/ip address
add address=192.168.100.1/24 interface=LAN network=192.168.100.0
add address=192.168.1.2/24 interface=WAN1 network=192.168.1.0
add address=192.168.2.2/24 interface=WAN1 network=192.168.2.0
add address=192.168.3.2/24 interface=WAN1 network=192.168.3.0
add address=192.168.4.2/24 interface=WAN1 network=192.168.4.0
add address=192.168.5.2/24 interface=WAN1 network=192.168.5.0
add address=192.168.6.2/24 interface=WAN1 network=192.168.6.0
add address=192.168.7.2/24 interface=WAN1 network=192.168.7.0
add address=192.168.8.2/24 interface=WAN1 network=192.168.8.0
/ip dhcp-server network
add address=192.168.100.0/24 dns-server=192.168.100.1,1.1.2.2 gateway=192.168.100.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,1.1.2.2
/ip dns static
add address=192.168.100.1 name=ns1
/ip firewall mangle
add action=mark-connection chain=input in-interface=WAN1 connection-mark=no mark new-connection-mark=WAN1_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN2 connection-mark=no mark new-connection-mark=WAN2_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN3 connection-mark=no mark new-connection-mark=WAN3_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN4 connection-mark=no mark new-connection-mark=WAN4_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN5 connection-mark=no mark new-connection-mark=WAN5_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN6 connection-mark=no mark new-connection-mark=WAN6_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN7 connection-mark=no mark new-connection-mark=WAN7_conn passthrough=yes
add action=mark-connection chain=input in-interface=WAN8 connection-mark=no mark new-connection-mark=WAN8_conn passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1_conn new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_conn new-routing-mark=to_WAN2 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN3_conn new-routing-mark=to_WAN3 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN4_conn new-routing-mark=to_WAN4 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN5_conn new-routing-mark=to_WAN5 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN6_conn new-routing-mark=to_WAN6 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN7_conn new-routing-mark=to_WAN7 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN8_conn new-routing-mark=to_WAN8 passthrough=yes
add action=accept chain=prerouting dst-address=192.168.1.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.2.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.3.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.4.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.5.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.6.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.7.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.8.0/24 in-interface=LAN
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-mark new-connection-mark=WAN1_conn passthrough=yes per-connection-classifier=both-addresses:8/0
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN2_conn passthrough=yes per-connection-classifier=both-addresses:8/1
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN3_conn passthrough=yes per-connection-classifier=both-addresses:8/2
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN4_conn passthrough=yes per-connection-classifier=both-addresses:8/3
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN5_conn passthrough=yes per-connection-classifier=both-addresses:8/4
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN6_conn passthrough=yes per-connection-classifier=both-addresses:8/5
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN7_conn passthrough=yes per-connection-classifier=both-addresses:8/6
add action=mark-connection chain=prerouting dst-address-type=!local in-interface=LAN connection mark=no-marknew-connection-mark=WAN8_conn passthrough=yes per-connection-classifier=both-addresses:8/7
add action=mark-routing chain=prerouting connection-mark=WAN1_conn in-interface=LAN new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2_conn in-interface=LAN new-routing-mark=to_WAN2 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN3_conn in-interface=LAN new-routing-mark=to_WAN3 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN4_conn in-interface=LAN new-routing-mark=to_WAN4 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN5_conn in-interface=LAN new-routing-mark=to_WAN5 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN6_conn in-interface=LAN new-routing-mark=to_WAN6 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN7_conn in-interface=LAN new-routing-mark=to_WAN7 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN8_conn in-interface=LAN new-routing-mark=to_WAN8 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
add action=masquerade chain=srcnat out-interface=WAN3
add action=masquerade chain=srcnat out-interface=WAN4
add action=masquerade chain=srcnat out-interface=WAN5
add action=masquerade chain=srcnat out-interface=WAN6
add action=masquerade chain=srcnat out-interface=WAN7
add action=masquerade chain=srcnat out-interface=WAN8
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=to_WAN1
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.3.1 routing-mark=to_WAN3
add check-gateway=ping distance=1 gateway=192.168.4.1 routing-mark=to_WAN4
add check-gateway=ping distance=1 gateway=192.168.5.1 routing-mark=to_WAN5
add check-gateway=ping distance=1 gateway=192.168.6.1 routing-mark=to_WAN6
add check-gateway=ping distance=1 gateway=192.168.7.1 routing-mark=to_WAN7
add check-gateway=ping distance=1 gateway=192.168.8.1 routing-mark=to_WAN8
add check-gateway=ping distance=1 gateway=192.168.1.1
add check-gateway=ping distance=2 gateway=192.168.2.1
add check-gateway=ping distance=3 gateway=192.168.3.1
add check-gateway=ping distance=4 gateway=192.168.4.1
add check-gateway=ping distance=5 gateway=192.168.5.1
add check-gateway=ping distance=6 gateway=192.168.6.1
add check-gateway=ping distance=7 gateway=192.168.7.1
add check-gateway=ping distance=8 gateway=192.168.8.1
Looking good:
Hello, I tried all types and all tutorials, but still found no solution.
I already send 3 supout.rif files and there is still no solution.
In the past, that failover worked well with the 6.37 bugfix.
Since I now have newer Mikrotik routers with I can no longer use this 6.37 and this RouterOS is outdated.
This must be a bug, I know how to configure a failover but the failover fails.
I am sure there is a bug in the Mikrotik router Load balancing and failover does not work.
Mikrotik’s answer is also not clear and when I ask for an example. No reaction. If anything has changed in this configuration, I have also tried the 2019 tutorial. But its not working.
code tags do not allow me to highlight with colour and besides I was hoping that you didnt have the attention span to read it that way. ![]()
scrolling is tiresome activity, agreed
I’m going to send you some rubber bands, to help you strengthen up your scrolling finger muscles. ![]()
@anav Do you mean me that you sent me rubber tires?
No unless you need major body work LOL, the comment was meant for Sebastia. ![]()
@anav I would say otherwise, this would cost money to send the rubber tires to my house ![]()
Now seriously, the load balancing and failover configuration has always worked. I have a person who tested it and reduced the speed instead of increasing it. And the problem is that the 8xWAN failover chooses just one WAN interface.
All other interfaces are not chosen for load balancing.
It seems like a routing error. I have already tried all the tutorials.
But RouterOS larger than the 6.37 no longer works.
I think there is a bug in the RouterOS that does not allow load balancing.
Which tutorials have I already tried:
https://mum.mikrotik.com/presentations/US12/tomas.pdf
https://mum.mikrotik.com/presentations/US12/steve.pdf
https://systemzone.net/mikrotik-dual-wan-load-balancing-with-failover-using-pcc/
https://www.manitonetworks.com/mikrotik/2017/1/29/wan-load-balancing
https://wiki.mikrotik.com/wiki/Manual:PCC
https://www.askitmen.com/network/mikrotik/bandwidth-based-load-balancing-with-fail-over-in-mikrotik/
Can it be determined how much throughput will go through WAN1 and then send the rest through WAN2?
Greatings
https://mum.mikrotik.com/presentations/US12/tomas.pdf
Load_Balancing_workshop.pdf (658 KB)
Load_Balancing_workshop3.pdf (912 KB)