Hi,
I need to configure Mikrotik to share equal bandwidth using PCQ , but my router is configured with load-balancing (4 WAN or more), as far as I know, Mikrotik is not able to do Link aggregation, so my question is : does the PCQ will work fine with Load-balancing ,how it will work in this case and how the router will know the available bandwidth?
Do not have crystal ball
please post current config
/export hide-sensitive file=yourconfigapr25
Thank you for your reply ,
I don’t have a config ready right now, my question was just to know first if it’s possible to configure PCQ with load-balancing and if it work fine or not.because as far as I know Mikrotik does not support link aggregation. and I need to know how mikrotik will know the available bandwidth and share it equally?
Yes, PCQ works fine with load balancing, but the MikroTik won’t know the available bandwitdh, you will have to set that manually.
When the actual available bandwidth is not constant, you are out of luck.
I use load balancing combined with /queue tree, I mark the incoming traffic from each internet connection (that is already required as part of the load balancing configuration)
and use the marks to select the proper queue which is then subdivided by PCQ.
Of course it is not really load balancing. it is distributing the clients over the available connections. Each client is tied to a single connection until it fails.
(using per-connection-classifier=src-address:4/x)
@pe1chl : thank you for your reply .
to be honest i didn't see how can I manually specify the bandwidth.
below the configuration that I made for router Configured with Hotspot+Load-balancing(4Lines of 100Mo)+ PCQ
jan/02/1970 01:27:38 by RouterOS 6.43.8
/interface ethernet
set [ find default-name=ether1 ] comment=Ether1 name=LAN
set [ find default-name=ether2 ] comment=Ether2 name=WAN1
set [ find default-name=ether3 ] comment=Ether3 name=WAN2
set [ find default-name=ether4 ] comment=Ether4 name=WAN3
set [ find default-name=ether5 ] comment=Ether5 name=WAN4
/interface pppoe-client
add add-default-route=yes disabled=no interface=WAN1 name=pppoe-out1 user=111111
add add-default-route=yes disabled=no interface=WAN2 name=pppoe-out2 user=222222
add add-default-route=yes disabled=no interface=WAN3 name=pppoe-out3 user=333333
add add-default-route=yes disabled=no interface=WAN4 name=pppoe-out4 user=444444
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
add dns-name=hotspot.local hotspot-address=192.168.30.1 login-by=http-chap,mac-cookie name=hsprof1
/ip pool
add name=hs-pool-1 ranges=192.168.30.2-192.168.30.249
/ip dhcp-server
add address-pool=hs-pool-1 disabled=no interface=LAN lease-time=1h name=dhcp1
/ip hotspot
add address-pool=hs-pool-1 addresses-per-mac=1 disabled=no interface=LAN name=hotspot1 profile=hsprof1
/ip hotspot user profile
add address-pool=hs-pool-1 name=1Day-3Devices shared-users=3 transparent-proxy=yes
/queue type
add kind=pcq name=pcq-upload-hotspot pcq-classifier=src-address
add kind=pcq name=pcq-download-hotspot pcq-classifier=dst-address
/queue tree
add name=Download packet-mark=Download_Packets parent=global queue=pcq-download-hotspot
add name=Upload packet-mark=Upload_Packets parent=global queue=pcq-upload-hotspot
/ip address
add address=192.168.30.1/24 interface=LAN network=192.168.30.0
/ip dhcp-server network
add address=192.168.30.0/24 comment="hotspot network" gateway=192.168.30.1
/ip dns
set servers=192.168.30.1
/ip firewall address-list
add address=192.168.30.0/24 list=Local
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
/ip firewall mangle
add action=accept chain=prerouting dst-address-list=Local src-address-list=Local
add action=mark-connection chain=forward connection-mark=no-mark in-interface=pppoe-out1 new-connection-mark=WAN1_Conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark in-interface=pppoe-out2 new-connection-mark=WAN2_Conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark in-interface=pppoe-out3 new-connection-mark=WAN3_Conn passthrough=no
add action=mark-connection chain=forward connection-mark=no-mark in-interface=pppoe-out4 new-connection-mark=WAN4_Conn passthrough=no
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe-out1 new-connection-mark=WAN1_Conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe-out2 new-connection-mark=WAN2_Conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe-out3 new-connection-mark=WAN3_Conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=pppoe-out4 new-connection-mark=WAN4_Conn passthrough=yes
add action=jump chain=prerouting connection-mark=no-mark in-interface=LAN jump-target=policy_routing
add action=mark-connection chain=policy_routing dst-address-type=!local new-connection-mark=WAN1_Conn passthrough=yes per-connection-classifier=src-address:4/0
add action=mark-connection chain=policy_routing dst-address-type=!local new-connection-mark=WAN2_Conn passthrough=yes per-connection-classifier=src-address:4/1
add action=mark-connection chain=policy_routing dst-address-type=!local new-connection-mark=WAN3_Conn passthrough=yes per-connection-classifier=src-address:4/2
add action=mark-connection chain=policy_routing dst-address-type=!local new-connection-mark=WAN4_Conn passthrough=yes per-connection-classifier=src-address:4/3
add action=mark-routing chain=prerouting connection-mark=WAN1_Conn new-routing-mark=to_WAN1 passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting connection-mark=WAN2_Conn new-routing-mark=to_WAN2 passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting connection-mark=WAN3_Conn new-routing-mark=to_WAN3 passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting connection-mark=WAN4_Conn new-routing-mark=to_WAN4 passthrough=yes src-address-list=Local
add action=mark-routing chain=output connection-mark=WAN1_Conn new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_Conn new-routing-mark=to_WAN2 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN3_Conn new-routing-mark=to_WAN3 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN4_Conn new-routing-mark=to_WAN4 passthrough=yes
add action=mark-connection chain=prerouting new-connection-mark=Upload_conn passthrough=yes src-address=192.168.30.0/24
add action=mark-packet chain=prerouting connection-mark=Upload_conn new-packet-mark=Upload_Packets passthrough=yes
add action=mark-connection chain=postrouting dst-address=192.168.30.0/24 new-connection-mark=Download_conn passthrough=yes
add action=mark-packet chain=postrouting connection-mark=Download_conn new-packet-mark=Download_Packets passthrough=yes
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat out-interface=pppoe-out1
add action=masquerade chain=srcnat out-interface=pppoe-out2
add action=masquerade chain=srcnat out-interface=pppoe-out3
add action=masquerade chain=srcnat out-interface=pppoe-out4
/ip hotspot user
add name=admin
add name=user1 profile=1Day-3Devices server=hotspot1
/ip route
add check-gateway=arp distance=1 gateway=pppoe-out1 routing-mark=to_WAN1
add check-gateway=arp distance=2 gateway=pppoe-out2 routing-mark=to_WAN1
add check-gateway=arp distance=3 gateway=pppoe-out3 routing-mark=to_WAN1
add check-gateway=arp distance=4 gateway=pppoe-out4 routing-mark=to_WAN1
add check-gateway=arp distance=1 gateway=pppoe-out2 routing-mark=to_WAN2
add check-gateway=arp distance=2 gateway=pppoe-out3 routing-mark=to_WAN2
add check-gateway=arp distance=3 gateway=pppoe-out4 routing-mark=to_WAN2
add check-gateway=arp distance=4 gateway=pppoe-out1 routing-mark=to_WAN2
add check-gateway=arp distance=1 gateway=pppoe-out3 routing-mark=to_WAN3
add check-gateway=arp distance=2 gateway=pppoe-out4 routing-mark=to_WAN3
add check-gateway=arp distance=3 gateway=pppoe-out1 routing-mark=to_WAN3
add check-gateway=arp distance=4 gateway=pppoe-out2 routing-mark=to_WAN3
add check-gateway=arp distance=1 gateway=pppoe-out4 routing-mark=to_WAN4
add check-gateway=arp distance=2 gateway=pppoe-out1 routing-mark=to_WAN4
add check-gateway=arp distance=3 gateway=pppoe-out2 routing-mark=to_WAN4
add check-gateway=arp distance=4 gateway=pppoe-out3 routing-mark=to_WAN4
You should make 4 separate queue tree entries for upload, each with parent of the corresponding uplink interface, and there
you can set the limit-at and max-limit to your line capacity (minus a little, e.g. set 98 Mbps).
This will limit the upload for each of the links separately, to avoid buffer bloat.
For download this is not required (or better: this should be done by the other side)
Thank you very much for your reply.
for the bandwidth for the upload, do I need to set it with the Download bandwidth or the upload one ( My Intenet lines are 100d/20u)?
for the download what do you mean by better configure it from other side.there is no other side,as you can see on the config my lines are configured en pppoe?
below the modified queue, can you plz confirm that it’s like what you said?
/queue tree
add limit-at=90M max-limit=90M name=Upload-WAN1 packet-mark=Upload_Packets
parent=pppoe-out1 queue=pcq-upload-hotspot
add limit-at=90M max-limit=90M name=Upload-WAN2 packet-mark=Upload_Packets
parent=pppoe-out2 queue=pcq-upload-hotspot
add limit-at=90M max-limit=90M name=Upload-WAN3 packet-mark=Upload_Packets
parent=pppoe-out3 queue=pcq-upload-hotspot
add limit-at=90M max-limit=90M name=Upload-WAN4 packet-mark=Upload_Packets
parent=pppoe-out4 queue=pcq-upload-hotspot
Of course you should configure the upload bandwidth, because you can shape only the OUTPUT side of the interface.
With the other side I mean the router at the ISP side. That is where the downward shaping should happen.
When the ISP does not want to do that you can shape on global queue with appropriate markings of incoming traffic
from each interface (so again 4 queues and 4 marks) but it is not the same: it will help to divide
the bandwidth amongst the users but it will not help against jitter of e.g. VoIP packets.