Home

RB750/750G - Dual WAN Load Balancing (PCC method)

 

Documentation & references, thanks & credits go to the following Smile:

 

 

 


PCC - Both Addresses & Ports

If I use this PCC method

 

Run SpeedTest noticed it can combine both bandwidth (5+5=10Mbps) for both Download/Upload

 

This method seem to have problem with remote https & ftp

 


PCC - Src Address & Port

If I use this PCC method

 

Noticed it combined Download only, Upload still stick to individual ISP's limit

UniFi-VIP5

 

P1-Biz5

 

This method seem to have problem with remote https & ftp

 

 


 

PCC - Src Address

If I use this PCC method

 

This method basically does not combine anything, each LAN PC/computer/device is assigned to a specific ISP, not sure how it assign though ....

 

 

This method no problem with remote https & ftp

 

 


Mangle Rule

This is my current Mangle Rule using PCC-Src Address method

<UniFi + P1 with PCC method>
add action=mark-connection chain=input comment=Multi-WAN disabled=no in-interface=P1 new-connection-mark=P1_conn passthrough=yes
add action=mark-connection chain=input disabled=no in-interface=UniFi new-connection-mark=UniFi_conn passthrough=yes
add action=mark-routing chain=output connection-mark=P1_conn disabled=no new-routing-mark=to_P1 passthrough=no
add action=mark-routing chain=output connection-mark=UniFi_conn disabled=no new-routing-mark=to_UniFi passthrough=no
add action=mark-connection chain=prerouting disabled=no dst-address-type=!local in-interface=ether2-LAN new-connection-mark=P1_conn passthrough=yes per-connection-classifier=src-address:2/0
add action=mark-connection chain=prerouting disabled=no dst-address-type=!local in-interface=ether2-LAN new-connection-mark=UniFi_conn passthrough=yes per-connection-classifier=src-address:2/1
add action=mark-routing chain=prerouting connection-mark=P1_conn disabled=no in-interface=ether2-LAN new-routing-mark=to_P1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=UniFi_conn disabled=no in-interface=ether2-LAN new-routing-mark=to_UniFi passthrough=yes

 

<For Simple Queue - basically duplicate for both ISPs>
add action=mark-packet chain=prerouting comment="P1 : QoS_1" disabled=no in-interface=P1 new-packet-mark=P1_Q1 passthrough=no protocol=icmp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=P1_Q1 out-interface=P1 passthrough=no protocol=icmp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q1 passthrough=no protocol=tcp src-port=53,3074
add action=mark-packet chain=postrouting disabled=no dst-port=53,3074 new-packet-mark=P1_Q1 out-interface=P1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q1 passthrough=no protocol=udp src-port=53,88,3074
add action=mark-packet chain=postrouting disabled=no dst-port=53,88,3074 new-packet-mark=P1_Q1 out-interface=P1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="SIP -by Port" disabled=no in-interface=P1 new-packet-mark=P1_Q1 passthrough=no protocol=udp src-port=5060-5062
add action=mark-packet chain=postrouting disabled=no dst-port=5060-5062 new-packet-mark=P1_Q1 out-interface=P1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=QoS_2 disabled=no in-interface=P1 new-packet-mark=P1_Q2 passthrough=no protocol=tcp src-port=80,8080,443
add action=mark-packet chain=postrouting disabled=no dst-port=80,8080,443 new-packet-mark=P1_Q2 out-interface=P1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=QoS_3 disabled=no in-interface=P1 new-packet-mark=P1_Q3 passthrough=no protocol=tcp src-port=110,25,995,465,587,21,113
add action=mark-packet chain=postrouting disabled=no dst-port=110,25,995,465,587,21,113 new-packet-mark=P1_Q3 out-interface=P1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q3 passthrough=no protocol=udp src-port=123,113
add action=mark-packet chain=postrouting disabled=no dst-port=123,113 new-packet-mark=P1_Q3 out-interface=P1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=QoS_8 disabled=no in-interface=P1 new-packet-mark=P1_Q8 passthrough=no protocol=tcp src-port=30000-63999
add action=mark-packet chain=postrouting disabled=no dst-port=30000-63999 new-packet-mark=P1_Q8 out-interface=P1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q8 passthrough=no protocol=udp src-port=30000-63999
add action=mark-packet chain=postrouting disabled=no dst-port=30000-63999 new-packet-mark=P1_Q8 out-interface=P1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q8 p2p=all-p2p passthrough=no
add action=mark-packet chain=postrouting disabled=no new-packet-mark=P1_Q8 out-interface=P1 p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting comment=QoS_7 disabled=no in-interface=P1 new-packet-mark=P1_Q7 passthrough=no protocol=tcp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=P1_Q7 out-interface=P1 passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q7 passthrough=no protocol=udp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=P1_Q7 out-interface=P1 passthrough=no protocol=udp
add action=mark-packet chain=prerouting disabled=no in-interface=P1 new-packet-mark=P1_Q7 passthrough=no
add action=mark-packet chain=postrouting disabled=no new-packet-mark=P1_Q7 out-interface=P1 passthrough=no
add action=mark-packet chain=prerouting comment="UniFi : QoS_1" disabled=no in-interface=UniFi new-packet-mark=UniFi_Q1 passthrough=no protocol=icmp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=UniFi_Q1 out-interface=UniFi passthrough=no protocol=icmp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q1 passthrough=no protocol=tcp src-port=53,3074
add action=mark-packet chain=postrouting disabled=no dst-port=53,3074 new-packet-mark=UniFi_Q1 out-interface=UniFi passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q1 passthrough=no protocol=udp src-port=53,88,3074
add action=mark-packet chain=postrouting disabled=no dst-port=53,88,3074 new-packet-mark=UniFi_Q1 out-interface=UniFi passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment="SIP -by Port" disabled=no in-interface=UniFi new-packet-mark=UniFi_Q1 passthrough=no protocol=udp src-port=5060-5062
add action=mark-packet chain=postrouting disabled=no dst-port=5060-5062 new-packet-mark=UniFi_Q1 out-interface=UniFi passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=QoS_2 disabled=no in-interface=UniFi new-packet-mark=UniFi_Q2 passthrough=no protocol=tcp src-port=80,8080,443
add action=mark-packet chain=postrouting disabled=no dst-port=80,8080,443 new-packet-mark=UniFi_Q2 out-interface=UniFi passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment=QoS_3 disabled=no in-interface=UniFi new-packet-mark=UniFi_Q3 passthrough=no protocol=tcp src-port=110,25,995,465,587,21,113
add action=mark-packet chain=postrouting disabled=no dst-port=110,25,995,465,587,21,113 new-packet-mark=UniFi_Q3 out-interface=UniFi passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q3 passthrough=no protocol=udp src-port=123,113
add action=mark-packet chain=postrouting disabled=no dst-port=123,113 new-packet-mark=UniFi_Q3 out-interface=UniFi passthrough=no protocol=udp
add action=mark-packet chain=prerouting comment=QoS_8 disabled=no in-interface=UniFi new-packet-mark=UniFi_Q8 passthrough=no protocol=tcp src-port=30000-63999
add action=mark-packet chain=postrouting disabled=no dst-port=30000-63999 new-packet-mark=UniFi_Q8 out-interface=UniFi passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q8 passthrough=no protocol=udp src-port=30000-63999
add action=mark-packet chain=postrouting disabled=no dst-port=30000-63999 new-packet-mark=UniFi_Q8 out-interface=UniFi passthrough=no protocol=udp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q8 p2p=all-p2p passthrough=no
add action=mark-packet chain=postrouting disabled=no new-packet-mark=UniFi_Q8 out-interface=UniFi p2p=all-p2p passthrough=no
add action=mark-packet chain=prerouting comment=QoS_7 disabled=no in-interface=UniFi new-packet-mark=UniFi_Q7 passthrough=no protocol=tcp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=UniFi_Q7 out-interface=UniFi passthrough=no protocol=tcp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q7 passthrough=no protocol=udp
add action=mark-packet chain=postrouting disabled=no new-packet-mark=UniFi_Q7 out-interface=UniFi passthrough=no protocol=udp
add action=mark-packet chain=prerouting disabled=no in-interface=UniFi new-packet-mark=UniFi_Q7 passthrough=no
add action=mark-packet chain=postrouting disabled=no new-packet-mark=UniFi_Q7 out-interface=UniFi passthrough=no


Simple Queue

Simple queue for both UniFi & P1

 

add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=5300k/5300k name=P1 packet-marks="" parent=none priority=1 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=0/0 name=P1-Q1 packet-marks=P1_Q1 parent=P1 priority=1 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=0/0 name=P1-Q2 packet-marks=P1_Q2 parent=P1 priority=2 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=0/0 name=P1-Q3 packet-marks=P1_Q3 parent=P1 priority=3 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=0/0 name=P1-Q7 packet-marks=P1_Q7 parent=P1 priority=7 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=P1 limit-at=0/0 max-limit=0/0 name=P1-Q8 packet-marks=P1_Q8 parent=P1 priority=8 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=5300k/5300k name=UniFi packet-marks="" parent=none priority=1 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=0/0 name=UniFi-Q1 packet-marks=UniFi_Q1 parent=UniFi priority=1 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=0/0 name=UniFi-Q2 packet-marks=UniFi_Q2 parent=UniFi priority=2 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=0/0 name=UniFi-Q3 packet-marks=UniFi_Q3 parent=UniFi priority=3 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=0/0 name=UniFi-Q7 packet-marks=UniFi_Q7 parent=UniFi priority=7 queue=default/default target-addresses="" total-queue=default
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=both disabled=no interface=UniFi limit-at=0/0 max-limit=0/0 name=UniFi-Q8 packet-marks=UniFi_Q8 parent=UniFi priority=8 queue=default/default target-addresses="" total-queue=default


.