Hello everyone,
I want to load balancing 2 WAN but it’s very hard because a lot of tutorials found googling were old and they didn’t work. Now with this code I don’t know what do I have to put in prerouting “in-interface=” (see below). At the moment in ethef2-3-4 there aren’t PC attached, I want that wlan clients use the “2 WAN in load balancing” but also laptops connected in 2-3-4. How can I do? This is my situation:
If you have your LAN interfaces bridged, then in-interface=bridge in your prerouting rules is ok. The only thing that does not look right is ether5 (WAN2) being slave to something (either bridge, of switch master port), it should be independent interface.
Inactive route. The one with lower distance is better, so it wins. But when you mark routing for all outgoing connections, they use routes from given routing tables to_WANx. These two in main routing table will be used only by router itself.
Is there anything different between how PC and iphone/ipad are connected? From what I’ve seen so far, it look like you have only one LAN with all interfaces bridged together, so no matter if you connect device to wired LAN or to wireless, it should work the same.
Thank you for your help.. Unfortunately not… They are connected to the same wifi… I don’t know..
I put “per-connection-classifier=both-addresses-and-ports” but I read googling that could be problems with banks or something like that.. What do you think? It is better to use “per-connection-classifier=both-addresses”?
You need to understand what those options do. In both cases, they take connections based on given criteria and split them in different groups (in your case two). And it’s predictable, same input means same result.
“both-addresses” only works with addresses, so connection from client A to server X will always use same WAN.
“both-addresses-and-ports” also includes port, which means that results will look random, because even though client A still has same address, so does server X and target port does not change either, source port does change for each connection. So it might as well happen that each connection to target server will use different WAN, which means completely different source address and some servers might not like it.
But it does not explain what happens with your iphone/ipad. If you had “both-addresses”, it could just mean that you did not test with enough remote servers. Because while it should be close to 50/50 split for many connections, with just few ones it could happen that all will fall to only one WAN. But the same is very unlikely with “both-addresses-and-ports”.
I retested now from my iphone 2-3 times and now it works.. I don’t know why, I just disabled/enabled the two interface.
I’ll remove “-ports” as you explained, servers might not like it.
Thank you Sob! Your help is much appreciated, I didn’t find the button to give you reputation
Now seems to not work on all devices… Very streange.. At the moment my gateway’s name are ether1 and ether5 as you can see from my screenshot.. Maybe do I must rename my interface according to firewall mangle (WAN1 and WAN2)? or it doesn’t matter? “new-connection-mark=WAN1_conn”
No, that’s two completely different things. You first mark connections, then based on that mark routing and it causes router to use routes with same routing mark.