[ask] queue tree with 3 interfaces (2 public and 1 local)

dear all, i’m confused how to set my bandwidth management right with pcq for equal bandwidth.

i’m using two ISPs. indosat (isp 1) is on dedicated bandwidth (512/512kbps), while speedy (isp 2) is on sharing bandwidth (64/384kbps).

interfaces:

  1. local (192.168.0.1/24)
  2. indosat (10.0.0.254/24)
  3. speedy (10.0.1.254/24)

route:

  1. default gateway goes to indosat (10.0.0.1/24)
  2. another gateway with routing-mark=indosat goes to indosat (10.0.0.1/24)
  3. another gateway with routing-mark=speedy goes to speedy (10.0.1.1)/24)

dns:

  1. indosat’s dns
  2. opendns’ dns

nat:

  1. src-nat, out interface indosat, masquerade.
  2. src-nat, out interface speedy, masquerade.

mangle:

10   chain=prerouting src-address=192.168.0.253 action=mark-routing 
     new-routing-mark=indosat passthrough=no 

11   ;;; indosat marking
     chain=forward routing-mark=indosat action=mark-connection 
     new-connection-mark=indosat-connection passthrough=yes 

12   chain=forward connection-mark=indosat-connection action=mark-packet 
     new-packet-mark=indosat passthrough=no 

25   chain=prerouting src-address=192.168.1.254 action=mark-routing 
     new-routing-mark=speedy passthrough=no 

26   ;;; speedy marking
     chain=forward routing-mark=speedy action=mark-connection 
     new-connection-mark=speedy-connection passthrough=yes 

27   chain=forward connection-mark=speedy-connection action=mark-packet 
     new-packet-mark=speedy passthrough=no

queue type:

 5 name="pcq-download" kind=pcq pcq-rate=0 pcq-limit=50 
   pcq-classifier=dst-address pcq-total-limit=2000 

 6 name="pcq-upload" kind=pcq pcq-rate=0 pcq-limit=50 
   pcq-classifier=src-address pcq-total-limit=2000

queue tree:

 0   name="download" parent=global-out packet-mark="" limit-at=0 queue=default 
     priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s 

 1   name="indosat-download" parent=download packet-mark=indosat limit-at=0 
     queue=pcq-download priority=8 max-limit=512000 burst-limit=0 
     burst-threshold=0 burst-time=0s 

 2   name="speedy-download" parent=download packet-mark=speedy limit-at=0 
     queue=pcq-download priority=8 max-limit=0 burst-limit=0 
     burst-threshold=0 burst-time=0s 

 3   name="indosat-upload" parent=indosat packet-mark=indosat limit-at=0 
     queue=pcq-upload priority=8 max-limit=512000 burst-limit=0 
     burst-threshold=0 burst-time=0s 

 4   name="speedy-upload" parent=speedy packet-mark=speedy limit-at=0 
     queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0 
     burst-time=0s

is my setting above right?

please help me since i can’t get the equal bandwidth runs on speedy (my 2nd isp), while the bandwidth equalizer runs excellent on indosat.

speedy is not guaranteed to have all the time 64/384kbps bandwidth, sometimes it can get 384kbps download, sometimes not. while indosat is guaranteed to have all the time 512/512kbps bandwidth.

my assumption is that pcq equal bandwidth don’t work very good with sharing bandwidth such as speedy (my isp).

can anyone help me with my configuration? please.. :slight_smile:

sorry for my bad english… configuration is good .. but in the “mangle” are misplaced the “marks” ..
First: put the “mark connection” with the ip you want to make routing (activate passthrough)
Second: put the “mark routing” that you like make routing with the previous “mark connection” (activate passthrough)
Third: put the “mark packet” that you like make queue tree with the previous “mark connection” (disable passthrough)

Good Luck.. Crashpunk

thanks for the help. somehow i already did it by reducing the max limit by 8kbps and the PCQ works flawless. The limitation here is we have to use fixed bandwidth in order to make the PCQ works, thus the ISP should guarantee we will have the max-limit we’ve set for all the time.

i guess the key here is if we have 1024kbps fixed bandwidth, the max-limit we set must be less than 1024kbps for the router still has enough bandwidth to check the gateway with ping otherwise it will assume the connection is broken due to ping timed out (limited by isp bandwidth management) when the traffic is fully loaded.

here’s my configuration with these following ISPs using routerboard RB450 and routeros 3.20:
indosat: 1024/1024kbps (dedicated bandwidth)
speedy: 128/1024kbps (shared bandwidth with mixed bandwidth of international 64/384kbps and national 128/1024kbps)

/ip firewall mangle print

8 ;;; indosat bandwidth management
chain=prerouting action=mark-routing new-routing-mark=indosat
passthrough=yes src-address-list=indosat

9 chain=prerouting action=mark-packet new-packet-mark=indosat-upload
passthrough=no routing-mark=indosat in-interface=local

10 chain=forward action=mark-connection
new-connection-mark=indosat-connection passthrough=yes
routing-mark=indosat

11 chain=forward action=mark-packet new-packet-mark=indosat-download
passthrough=no in-interface=indosat connection-mark=indosat-connection

12 ;;; speedy bandwidth management
chain=prerouting action=mark-routing new-routing-mark=speedy
passthrough=yes src-address-list=speedy

13 ;;; speedy indonesia ix
chain=prerouting action=mark-packet new-packet-mark=speedy-upload-iix
passthrough=no routing-mark=speedy dst-address-list=nice
in-interface=local

14 chain=forward action=mark-connection
new-connection-mark=speedy-connection-iix passthrough=yes
routing-mark=speedy dst-address-list=nice

15 chain=forward action=mark-packet new-packet-mark=speedy-download-iix
passthrough=no in-interface=speedy connection-mark=speedy-connection-iix

16 ;;; speedy international ix
chain=prerouting action=mark-packet new-packet-mark=speedy-upload
passthrough=no routing-mark=speedy dst-address-list=!nice
in-interface=local

17 chain=forward action=mark-connection new-connection-mark=speedy-connectio>
passthrough=yes routing-mark=speedy dst-address-list=!nice

18 chain=forward action=mark-packet new-packet-mark=speedy-download
passthrough=no in-interface=speedy connection-mark=speedy-connection

/queue type print

5 name=“pcq-download” kind=pcq pcq-rate=0 pcq-limit=50
pcq-classifier=dst-address pcq-total-limit=2000

6 name=“pcq-upload” kind=pcq pcq-rate=0 pcq-limit=50
pcq-classifier=src-address pcq-total-limit=2000

/queue tree print

0 name=“indosat-upload” parent=indosat-up packet-mark=indosat-upload
limit-at=0 queue=pcq-upload priority=8 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

1 name=“indosat-download” parent=indosat-down packet-mark=indosat-download
limit-at=0 queue=pcq-download priority=8 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

2 name=“indosat-down” parent=local packet-mark=“” limit-at=0 queue=default
priority=8 max-limit=1000000 burst-limit=0 burst-threshold=0
burst-time=0s

3 name=“indosat-up” parent=indosat packet-mark=“” limit-at=0 queue=default
priority=8 max-limit=1000000 burst-limit=0 burst-threshold=0
burst-time=0s

4 name=“speedy-down” parent=local packet-mark=“” limit-at=0 queue=default
priority=8 max-limit=800000 burst-limit=0 burst-threshold=0
burst-time=0s

5 name=“speedy-download” parent=speedy-down packet-mark=speedy-download
limit-at=0 queue=pcq-download priority=8 max-limit=384000 burst-limit=0
burst-threshold=0 burst-time=0s

6 name=“speedy-up” parent=speedy packet-mark=“” limit-at=0 queue=default
priority=8 max-limit=96000 burst-limit=0 burst-threshold=0 burst-time=0s

7 name=“speedy-upload” parent=speedy-up packet-mark=speedy-upload limit-at=>
queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0
burst-time=0s

8 name=“speedy-download-iix” parent=speedy-down
packet-mark=speedy-download-iix limit-at=0 queue=pcq-download priority=8
max-limit=640000 burst-limit=0 burst-threshold=0 burst-time=0s

9 name=“speedy-upload-iix” parent=speedy-up packet-mark=speedy-upload-iix
limit-at=0 queue=pcq-upload priority=8 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s