Do you have two IP addresses on the same physical interface at your router or do you have each uplink on a separate interface? Is there PPPoE, DHCP, manually configured IP? Without knowledge of the physical and logical topology, no useful suggestion can be made. If you have two modems/routers from the ISP which both use the same LAN subnet and you cannot change their configuration, the setup may be much simpler than if you have two IPs in the same subnet on some FTTH connection and there is a bandwidth enforcement per IP at the ISP side.
Wait, the IP addresses are assigned directly to wlan1 and wlan2, so PPPoE is not related to the IP address assignment (unless you’ve renamed PPPoE interfaces to wlan1 and wlan2). Can post an export of the whole configuration (see my automatic signature below for hints), and if the PPPoE is on some other router, can you draw the whole network setup (a photo of a handmade drawing is sufficient, no need to spend hours on it).
Well, so I suppose that the router with PPPoE uplink either links each PPPoE uplink to another SSID or it restricts the bandwidth per connected wireless client, but that’s not important for the setup at your end.
The key is that you can use an IP address along with an interface name as a gateway of a route, using the ip.add.re.ss**%**interfacename notation.
So you can create two routing tables with a single defaut route in each (modify the actual gateway IP to the real one): /ip route
add routing-mark=via-wlan1 gateway=10.227.0.1%wlan1
add routing-mark=via-wlan2 gateway=10.227.0.1%wlan2
Then, use any policy routing strategy to assign the two routing-mark values (per-connection-classifier rules directly assigning the routing-mark or nth rules assigning a connection-mark and other rules translating connection-mark into routing-mark). These are explained in both the Mikrotik manual as well as countless times here on the forum. The first strategy (per-connection-classifier) is simpler but always spreads the load 1:1 between the two WANs, the second one allows to distribute the connections among the two WANs in a ratio you choose (1:1,1:3,3:5, whatever). But bear in mind that both distribute connections, not bandwidth, so on a low number of connections, you may see a different outcome than you expect. Also, bear in mind that one connection always uses only one uplink, so you cannot use the aggregated bandwidth of both WANs for a single connection.
if 20 is the download limit and 4 is the upload limit, and you mostly download, then it’s best to use nth rules to spread the connections in a 5:2 ratio (or, in another words, 2 of each 7 to be sent via wlan2 with the 20M bandwidth, and the rest via wlan1):
As I can see, you have another dhcp client attached to ether1, with add-default-route=yes, so you have to adjust the suggestion above to your setup as a whole.
On the off chance that you have two modems/switches from the lsp which both utilize a similar LAN subnet and you can’t change their arrangement, the arrangement might be a lot less complex than if you have two IPs in the equivalent subnet on some ftth association and there is a data transfer capacity requirement per IP at the ISP side.
What I can see is that you use underscore (via**_wan1) in the routing-mark values set on the routes, but in the mangle rules, you assign values with a dash (via-**wan1).
It means that all the routing-mark values assigned by mangle are unknown to the routing, so it falls back to routing table main (consisting of routes with no routing-mark value assigned).
Nice pickup but I got queasy when you typed nth…
I havent seen anyone recommend nth before.
WHy not use pcc classifier method (both addresses) and for different loading use something like.
(3 Wan example where one loads connections onto WAN3 at a greater ratio than the other wans 1:1:2)
You are right that PCC can be used for any ratio, I must have had a brain eclipse when writing it can only be used for 1:1 distribution.
However, 6/6 won’t work with PCC - for 5:2 distribution, you have to use 7/0 to 7/6 (the number to the left of the slash is the divider, the number to the right is the remainder, and the remainder is always between zero included and the divider not included.
As for nth, it was a mere illustration that other methods to spread the traffic exist than just per-connection-classifier. To be sure that you won’t get hard to explain issues with connections to some picky sites, not only that you have to use per-connection-classifier, but you even have to use only the source address to compute the hash to be divided by the divider - those picky servers refuse incoming sessions that are logically bound to already existing ones if the new ones don’t come from the same source address.
However, 6/6 won’t work with PCC - for 5:2 distribution, you have to use 7/0 to 7/6 (the number to the left of the slash is the divider, the number to the right is the remainder, and the remainder is always between zero included and the divider not included.
This Thread is interesting as it talks about (near the end) a combo approach that may be optimal in that it uses
PCC where required HTTPS type connections and then Nth for the rest…
Would love Sindys comments on that approach!!!
That’s too vague a description, so I’d exclude one of the WANs at a time and see whether the other one is not unstable on its own.
Regarding “what’s the best”, I gave my opinion in the topic which @anav has referred above. None of the approaches can affect connection losses and jumping speed, it must be something else.