Community discussions

MikroTik App
 
Hussein64
just joined
Topic Author
Posts: 4
Joined: Fri Sep 24, 2021 10:49 pm

Setting Up 10 PPPoE Connections with PCC Load Balancing on MikroTik, All Sharing the Same Gateway?

Tue Jul 23, 2024 10:49 pm

Hello everyone,
I am currently using a MikroTik hEX S router with 10 PPPoE connections, each offering 5Mbps. My goal is to implement load balancing using the PCC (Per Connection Classifier) method. However, all these PPPoE connections are provided by the same ISP, hence they share a single gateway.
Here's my current configuration:
/interface bridge
add name=LAN
/interface macvlan
add interface=ether1 mac-address=EA:5D:2A:81:F4:01 mode=private name=ISP1
add interface=ether1 mac-address=EA:5D:2A:81:F4:02 mode=private name=ISP2
add interface=ether1 mac-address=EA:5D:2A:81:F4:03 mode=private name=ISP3
add interface=ether1 mac-address=EA:5D:2A:81:F4:04 mode=private name=ISP4
add interface=ether1 mac-address=EA:5D:2A:81:F4:05 mode=private name=ISP5
add interface=ether1 mac-address=EA:5D:2A:81:F4:06 mode=private name=ISP6
add interface=ether1 mac-address=EA:5D:2A:81:F4:07 mode=private name=ISP7
add interface=ether1 mac-address=EA:5D:2A:81:F4:08 mode=private name=ISP8
add interface=ether1 mac-address=EA:5D:2A:81:F4:09 mode=private name=ISP9
add interface=ether1 mac-address=EA:5D:2A:81:F4:10 mode=private name=ISP10
/interface pppoe-client
add disabled=no interface=ISP1 name=pppoe-out1 password=* user=\
    *
add disabled=no interface=ISP2 name=pppoe-out2 password=* user=\
    *
add disabled=no interface=ISP3 name=pppoe-out3 password=* user=\
    *
add disabled=no interface=ISP4 name=pppoe-out4 password=* user=\
    *
add disabled=no interface=ISP5 name=pppoe-out5 password=* user=\
    *
add disabled=no interface=ISP6 name=pppoe-out6 password=* user=\
    *
add disabled=no interface=ISP7 name=pppoe-out7 password=* user=\
    *
add disabled=no interface=ISP8 name=pppoe-out8 password=* user=\
    *
add disabled=no interface=ISP9 name=pppoe-out9 password=* user=\
    *
add disabled=no interface=ISP10 name=pppoe-out10 password=* user=\
    *
/interface list
add name="ALL ISP"
/ip pool
add name=DHCP_POOL ranges=192.168.10.1-192.168.100.254
/ip dhcp-server
add address-pool=DHCP_POOL interface=LAN name=DHCP_SERVER
/routing table
add disabled=no fib name=ISP2
add disabled=no fib name=ISP3
add disabled=no fib name=ISP4
add disabled=no fib name=ISP5
add disabled=no fib name=ISP6
add disabled=no fib name=ISP7
add disabled=no fib name=ISP8
add disabled=no fib name=ISP9
add disabled=no fib name=ISP10
add disabled=no fib name=ISP1
/interface bridge port
add bridge=LAN interface=ether2
add bridge=LAN interface=ether3
add bridge=LAN interface=ether4
add bridge=LAN interface=ether5
/ipv6 settings
set disable-ipv6=yes
/interface list member
add interface=pppoe-out1 list="ALL ISP"
add interface=pppoe-out2 list="ALL ISP"
add interface=pppoe-out3 list="ALL ISP"
add interface=pppoe-out4 list="ALL ISP"
add interface=pppoe-out5 list="ALL ISP"
add interface=pppoe-out6 list="ALL ISP"
add interface=pppoe-out7 list="ALL ISP"
add interface=pppoe-out8 list="ALL ISP"
add interface=pppoe-out9 list="ALL ISP"
add interface=pppoe-out10 list="ALL ISP"
/ip address
add address=192.168.0.254/16 interface=LAN network=192.168.0.0
/ip dhcp-server network
add address=192.168.0.0/16 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.0.254
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out1 new-connection-mark=\
    ISP1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out2 new-connection-mark=\
    ISP2_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out3 new-connection-mark=\
    ISP3_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out4 new-connection-mark=\
    ISP4_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out5 new-connection-mark=\
    ISP5_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out6 new-connection-mark=\
    ISP6_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out7 new-connection-mark=\
    ISP7_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out8 new-connection-mark=\
    ISP8_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out9 new-connection-mark=\
    ISP9_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new in-interface=pppoe-out10 new-connection-mark=\
    ISP10_conn passthrough=yes
add action=mark-routing chain=output connection-mark=ISP1_conn \
    new-routing-mark=ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP2_conn \
    new-routing-mark=ISP2 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP3_conn \
    new-routing-mark=ISP3 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP4_conn \
    new-routing-mark=ISP4 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP5_conn \
    new-routing-mark=ISP5 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP6_conn \
    new-routing-mark=ISP6 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP7_conn \
    new-routing-mark=ISP7 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP8_conn \
    new-routing-mark=ISP8 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP9_conn \
    new-routing-mark=ISP9 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP10_conn \
    new-routing-mark=ISP10 passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP1_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/0 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP2_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/1 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP3_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/2 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP4_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/3 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP5_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/4 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP6_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/5 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP7_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/6 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP8_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/7 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP9_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/8 psd=21,3s,3,1
add action=mark-connection chain=prerouting connection-mark=no-mark \
    connection-state=new dst-address-type=!local new-connection-mark=\
    ISP10_conn passthrough=yes per-connection-classifier=\
    src-address-and-port:10/9 psd=21,3s,3,1
add action=mark-routing chain=prerouting connection-mark=ISP1_conn \
    in-interface=LAN new-routing-mark=ISP1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP2_conn \
    in-interface=LAN new-routing-mark=ISP2 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP3_conn \
    in-interface=LAN new-routing-mark=ISP3 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP4_conn \
    in-interface=LAN new-routing-mark=ISP4 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP5_conn \
    in-interface=LAN new-routing-mark=ISP5 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP6_conn \
    in-interface=LAN new-routing-mark=ISP6 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP7_conn \
    in-interface=LAN new-routing-mark=ISP7 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP8_conn \
    in-interface=LAN new-routing-mark=ISP8 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP9_conn \
    in-interface=LAN new-routing-mark=ISP9 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP10_conn \
    in-interface=LAN new-routing-mark=ISP10 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list="ALL ISP"
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out1 routing-table=ISP1 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out2 routing-table=ISP2 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out3 routing-table=ISP3 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out4 routing-table=ISP4 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out5 routing-table=ISP5 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out6 routing-table=ISP6 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out7 routing-table=ISP7 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out8 routing-table=ISP8 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out9 routing-table=ISP9 scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out10 routing-table=ISP10 scope=30 suppress-hw-offload=\
    no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out1 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out2 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=3 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out3 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=4 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out4 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=5 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out5 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=6 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out6 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=7 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out7 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=8 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out8 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=9 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out9 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=\
    10.10.10.1%pppoe-out10 routing-table=main scope=30 suppress-hw-offload=no \
    target-scope=10
/system identity
set name=PCC
/system note
set show-at-login=no
The issue I'm facing is that during speed tests, only one PPPoE connection, specifically PPPoE1, appears to be active. I expected load balancing to distribute traffic across all available connections, but this doesn't seem to be happening.

Any insights or advice on adjusting my configuration to achieve effective load balancing would be greatly appreciated.

Thank you!
 
User avatar
loloski
Member
Member
Posts: 420
Joined: Mon Mar 15, 2021 9:10 pm

Re: Setting Up 10 PPPoE Connections with PCC Load Balancing on MikroTik, All Sharing the Same Gateway?

Tue Jul 23, 2024 11:03 pm

what you are asking for this little device is unreasonable, even if you made it to work this will surely crawl and grinding to halt
 
Hussein64
just joined
Topic Author
Posts: 4
Joined: Fri Sep 24, 2021 10:49 pm

Re: Setting Up 10 PPPoE Connections with PCC Load Balancing on MikroTik, All Sharing the Same Gateway?

Tue Jul 23, 2024 11:16 pm

what you are asking for this little device is unreasonable, even if you made it to work this will surely crawl and grinding to halt
What I really have is CCR2116-12G-4S+ and 10 PPPoE connections, each one is 100 Mbps, but I am testing it on HEX S before deploying it to my real environment.
 
User avatar
loloski
Member
Member
Posts: 420
Joined: Mon Mar 15, 2021 9:10 pm

Re: Setting Up 10 PPPoE Connections with PCC Load Balancing on MikroTik, All Sharing the Same Gateway?

Wed Jul 24, 2024 4:58 am

I have a lot of deployment with more than 10 (1G individual connection) on a single CCR2116 with policy based routing but not with PCC since I don't have a use case for it and I hate that i can't predict where the customer traffic is being routed / natted from. In my opinion this PCC won't scale in ISP or similar setups/settings because mangles burns so much CPU with diminishing return.

If your purpose is to aggregate bandwidth e.g you combine 10 x 1g connection and hoping it will become 10G just like with others here please rethink your strategy because that's not how internet works you can't do that stop watching youtube and learn proper networking concepts, I'm sorry this is not a rant I'm just tired of seeing this use case over and over again since you have CCR2116 you have much better chances on scaling your network if you do policy based route instead of PCC hacks.

You can scale your network and make it more predictable with KISS approach for ease of troubleshooting, let say for instance you were able to combine this 10's of connection into giant pipe how will you know if one of your connection is exhibiting issues since the connection is random as per PCC design? and not to mentioned PCC is not bandwidth aware it's just break and distribute the connections and you will find it that some link is under utilized, been there done that :)

But if you really want this to test and feel this for yourself then used this video directly from the source (Mikrotik) https://www.youtube.com/watch?v=nlb7XAv57tw the critical part for you on this is building the routing tables and more importantly disable fasttrack because mangle won't work properly when fasttracked is turned on since you omit the firewall filter from your config I assumed it's on

another side note please let your upstream give you multiple physical connection since you have a lot of interface on your CCR2116, if your single connection goes down everything is down you use macvlan because you have single circuit with multiple accounts and worth mentioning macvlan and PPPoE overhead another part of the equation, well it's another problem for another day :)

Who is online

Users browsing this forum: No registered users and 15 guests