Page 1 of 1

Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 4:36 am
by anas777
I have 4 Internet lines on four ports
I want to automatically divide customers into 4 internet lines equally without distributing the load

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 9:37 am
by erlinden

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 2:36 pm
by anav
Your requirements are NOT clearly stated or accurate.
Your writing states four internet WANS, but your diagram only shows 3??

What do you mean NOT distribute the load?
How do you propose that the router share the load so to speak?

Do you mean you have four different subnets, OR perhaps 4 groups of users defined?
src-address-list=Group1
src-address-list=Group2
src-address-list=Group3
src-address-list=Group4

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 5:00 pm
by anas777

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 5:09 pm
by anas777
Your requirements are NOT clearly stated or accurate.
Your writing states four internet WANS, but your diagram only shows 3??

What do you mean NOT distribute the load?
How do you propose that the router share the load so to speak?

Do you mean you have four different subnets, OR perhaps 4 groups of users defined?
src-address-list=Group1
src-address-list=Group2
src-address-list=Group3
src-address-list=Group4
Example I have 40 in Active Hotspot
The division: every 10 is withdrawn from one line only, and thus 40 are automatically distributed among 4 internet lines

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 5:13 pm
by anas777
Your requirements are NOT clearly stated or accurate.
Your writing states four internet WANS, but your diagram only shows 3??

What do you mean NOT distribute the load?
How do you propose that the router share the load so to speak?

Do you mean you have four different subnets, OR perhaps 4 groups of users defined?
src-address-list=Group1
src-address-list=Group2
src-address-list=Group3
src-address-list=Group4
Drawing as an example only

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 5:51 pm
by Amm0
The high-level answer is if you just set the distance= the same in /ip/route for the 4 DSL lines (* in V6, add MULTIPLE gateway to same 0.0.0.0 /ip/route), you'll create an ECMP. Traffic is divided by hashes, so it's not quite "equal" (*in 7.16 ECMP can be "more even" with l4 hashes). A NAT rule and /ip/firewall/connection tracks the chosen WAN for the connection.

PCC approach is alternative, which has more options for load balancing than simple ECMP, Mikrotik has a video on it here: https://www.youtube.com/watch?v=nlb7XAv57tw

Neither are not quite that simple... since possible interface is up, but there is no internet upstream of DSL/routers. That where all load balancing schemes get more complicated. But if everything is up, and you want traffic divided "loosely evenly", ECMP is simplest IMO. The docs have all the schemes semi-documented to give you some ideas.

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 11:26 pm
by anas777
The high-level answer is if you just set the distance= the same in /ip/route for the 4 DSL lines (* in V6, add MULTIPLE gateway to same 0.0.0.0 /ip/route), you'll create an ECMP. Traffic is divided by hashes, so it's not quite "equal" (*in 7.16 ECMP can be "more even" with l4 hashes). A NAT rule and /ip/firewall/connection tracks the chosen WAN for the connection.

PCC approach is alternative, which has more options for load balancing than simple ECMP, Mikrotik has a video on it here: https://www.youtube.com/watch?v=nlb7XAv57tw

Neither are not quite that simple... since possible interface is up, but there is no internet upstream of DSL/routers. That where all load balancing schemes get more complicated. But if everything is up, and you want traffic divided "loosely evenly", ECMP is simplest IMO. The docs have all the schemes semi-documented to give you some ideas.
What about version v6?

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 11:28 pm
by anas777
The high-level answer is if you just set the distance= the same in /ip/route for the 4 DSL lines (* in V6, add MULTIPLE gateway to same 0.0.0.0 /ip/route), you'll create an ECMP. Traffic is divided by hashes, so it's not quite "equal" (*in 7.16 ECMP can be "more even" with l4 hashes). A NAT rule and /ip/firewall/connection tracks the chosen WAN for the connection.

PCC approach is alternative, which has more options for load balancing than simple ECMP, Mikrotik has a video on it here: https://www.youtube.com/watch?v=nlb7XAv57tw

Neither are not quite that simple... since possible interface is up, but there is no internet upstream of DSL/routers. That where all load balancing schemes get more complicated. But if everything is up, and you want traffic divided "loosely evenly", ECMP is simplest IMO. The docs have all the schemes semi-documented to give you some ideas.
What about version v6?
What about version v6?
Is there a video explaining this?

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 14, 2024 11:37 pm
by Amm0


What about version v6?
What about version v6?
Is there a video explaining this?
PCC has not changed. So video likely apply. It is ECMP that did between V6 and V7.

Re: Automatically divide customers into 4 internet lines equally

Posted: Tue Oct 15, 2024 2:38 am
by anav
PCC is but one part of the equation, all of the required user traffic needs to be identified before starting the config.

Re: Automatically divide customers into 4 internet lines equally

Posted: Tue Oct 22, 2024 5:37 pm
by anav
USER is now stating the switch is in reality a hOTSPOT and has moved ADSN wan links to Starlink links, problem is the same
The request is basically the same, the only thing that is different is that its clear you either dont know what you have for ISP, or were not being truthful on the first post, but in essence its the same issue of partial load balancing given 3 ISPs to varying groups of users........

You want
a. user1 and user4 should only access Starlink1
b. user2 should only access Starlink2
c. user3 should only access Starlink3
d. Switch or whatever users should be load balanced to all three starlinks.

What about failover situations, if any ??? Describe what you wish to happen for each case.
3wan.jpg

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 28, 2024 2:19 pm
by anas777
USER is now stating the switch is in reality a hOTSPOT and has moved ADSN wan links to Starlink links, problem is the same
The request is basically the same, the only thing that is different is that its clear you either dont know what you have for ISP, or were not being truthful on the first post, but in essence its the same issue of partial load balancing given 3 ISPs to varying groups of users........

You want
a. user1 and user4 should only access Starlink1
b. user2 should only access Starlink2
c. user3 should only access Starlink3
d. Switch or whatever users should be load balanced to all three starlinks.

What about failover situations, if any ??? Describe what you wish to happen for each case.

3wan.jpg
I changed my internet sources from ADSL to Starlink
All users on the hotspot
I want an expert in this field to give me the best way to distribute the load among 3 Internet providers

Re: Automatically divide customers into 4 internet lines equally

Posted: Mon Oct 28, 2024 5:36 pm
by anav
Cannot until you decide which requirements are valid,
a. per the diagram and the list I provided which was very clear 1u to w1, 2u to w2, 3u to w3, and hotspot users LB between WAN 1,2,3
OR
b. the ambiguous --> best way to distribute the load among 3 Internet providers, aka you dont care ( 1,2,3 and hotspots ALL balanced to wans 1-3 )

If you insist on a solution without providing necessary information and only require an expert, then suggest highly this route: https://mikrotik.com/consultants

Re: Automatically divide customers into 4 internet lines equally

Posted: Thu Oct 31, 2024 2:17 am
by anas777
Cannot until you decide which requirements are valid,
a. per the diagram and the list I provided which was very clear 1u to w1, 2u to w2, 3u to w3, and hotspot users LB between WAN 1,2,3
OR
b. the ambiguous --> best way to distribute the load among 3 Internet providers, aka you dont care ( 1,2,3 and hotspots ALL balanced to wans 1-3 )

If you insist on a solution without providing necessary information and only require an expert, then suggest highly this route: https://mikrotik.com/consultants
I don't speak English. I translated it using Google, so I apologize for the clarification
What I mean is if there is a way according to the diagram and list you provided
Or another better way to distribute the load between 3 Internet providers

Re: Automatically divide customers into 4 internet lines equally

Posted: Thu Oct 31, 2024 2:25 am
by anas777
Cannot until you decide which requirements are valid,
a. per the diagram and the list I provided which was very clear 1u to w1, 2u to w2, 3u to w3, and hotspot users LB between WAN 1,2,3
OR
b. the ambiguous --> best way to distribute the load among 3 Internet providers, aka you dont care ( 1,2,3 and hotspots ALL balanced to wans 1-3 )

If you insist on a solution without providing necessary information and only require an expert, then suggest highly this route: https://mikrotik.com/consultants

Re: Automatically divide customers into 4 internet lines equally

Posted: Thu Oct 31, 2024 2:50 am
by anav
I will think about the best way to approach this.
Either 6 mangles rules ( connection mark and routing mark ) sub1 to wan1 sub2 to wan2 sub3 to wan3
and then
6 PCC rules Sub4 connectiion mark and routing marks for wans 1,2,3

OR

6 PCC rules
and
3 Routing Rules.

With required ip routes and firewall rules of course.

Re: Automatically divide customers into 4 internet lines equally

Posted: Thu Oct 31, 2024 9:50 pm
by anav
What I would do is
/mangle
connection marks for pcc WAN1 for user4
connection marks for pcc WAN2 for user4
connection marks for pcc WAN3 for user4
routing marks for pcc WAN1 for user4
routing marks for pcc WAN2 for user4
routing marks for pcc WAN3 for user4
/routing rules
direct user1 to routing mark for WAN1
direct user2 to routing mark for WAN2
direct user3 to routing mark for WAN3

Firewall rules and IP routes necessary .....
Give it a shot and see what you come up with.

Re: Automatically divide customers into 4 internet lines equally

Posted: Wed Nov 13, 2024 11:09 pm
by anas777
The high-level answer is if you just set the distance= the same in /ip/route for the 4 DSL lines (* in V6, add MULTIPLE gateway to same 0.0.0.0 /ip/route), you'll create an ECMP. Traffic is divided by hashes, so it's not quite "equal" (*in 7.16 ECMP can be "more even" with l4 hashes). A NAT rule and /ip/firewall/connection tracks the chosen WAN for the connection.

PCC approach is alternative, which has more options for load balancing than simple ECMP, Mikrotik has a video on it here: https://www.youtube.com/watch?v=nlb7XAv57tw

Neither are not quite that simple... since possible interface is up, but there is no internet upstream of DSL/routers. That where all load balancing schemes get more complicated. But if everything is up, and you want traffic divided "loosely evenly", ECMP is simplest IMO. The docs have all the schemes semi-documented to give you some ideas.
A wonderful and very useful video. I was looking for it for two months. I applied all the steps. It is the best way to distribute loads
But I faced a problem
When the hotspot server is activated on the LAN port, the Internet does not work and the login page does not appear

Re: Automatically divide customers into 4 internet lines equally

Posted: Thu Nov 14, 2024 12:10 am
by anav
Post your config for review!