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:
Code: Select all
/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
Any insights or advice on adjusting my configuration to achieve effective load balancing would be greatly appreciated.
Thank you!