Community discussions

MikroTik App
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 4:36 am

I have 4 Internet lines on four ports
I want to automatically divide customers into 4 internet lines equally without distributing the load
You do not have the required permissions to view the files attached to this post.
 
erlinden
Forum Guru
Forum Guru
Posts: 2732
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 9:37 am

 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 2:36 pm

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
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 5:00 pm

 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 5:09 pm

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
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 5:13 pm

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
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4441
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 5:51 pm

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.
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 11:26 pm

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?
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 11:28 pm

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?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4441
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 14, 2024 11:37 pm



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.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Tue Oct 15, 2024 2:38 am

PCC is but one part of the equation, all of the required user traffic needs to be identified before starting the config.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Tue Oct 22, 2024 5:37 pm

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
You do not have the required permissions to view the files attached to this post.
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 28, 2024 2:19 pm

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
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Mon Oct 28, 2024 5:36 pm

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
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Thu Oct 31, 2024 2:17 am

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
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Thu Oct 31, 2024 2:25 am

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
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Thu Oct 31, 2024 2:50 am

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.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Thu Oct 31, 2024 9:50 pm

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.
 
anas777
just joined
Topic Author
Posts: 15
Joined: Mon Oct 14, 2024 4:12 am

Re: Automatically divide customers into 4 internet lines equally

Wed Nov 13, 2024 11:09 pm

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
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22199
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Automatically divide customers into 4 internet lines equally

Thu Nov 14, 2024 12:10 am

Post your config for review!