Community discussions

MikroTik App
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Help with HTB please

Sat Apr 15, 2017 12:56 pm

Dear gurus!

There is something wrong with my understanding of HTB. So I used https://wiki.mikrotik.com/wiki/Manual:HTB as example. I want to build next tree:

-- q_down (parent global, no limits)
---- q_down_local (parent q_down, no limits)
---- q_down_user1 (parent q_down, 10Mbit limit)

So I configured:
 0   name="q_tagnet_down" parent=global packet-mark=pm_tagnet_down limit-at=0 
     queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 
     burst-time=0s bucket-size=0.1 
At firewall mangle:
chain=prerouting action=mark-connection new-connection-mark=cm_tagnet_down passthrough=no
      dst-address=X.X.29.123 connection-mark=no-mark log=no log-prefix="" 
      connection-mark=cm_tagnet_down log=no log-prefix="" 
chain=forward action=mark-packet new-packet-mark=pm_tagnet_down passthrough=no 
      connection-mark=cm_tagnet_down log=no log-prefix="" 
Ok, this is nice and I see traffic in queue q_tagnet_down when my client is downloading something.
Next, I want to realize "local queue". But if I only add
name="q_tagnet_down_local" parent=q_tagnet_down packet-mark=pm_tagnet_down_local limit-at=0 
     queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s bucket-size=0.1 
no other mangle rules, just add queue!! I see no traffic on queue q_tagnet_down! ROS v 6.38.5. What is this? BUG in ROS or in my mind? :) Please, help.

Regards,
Boris
 
sash7
Frequent Visitor
Frequent Visitor
Posts: 68
Joined: Sun Mar 20, 2016 10:39 pm

Re: Help with HTB please

Sat Apr 15, 2017 2:31 pm

well it's strange use of queue tree, no limits, parent with one child...

and where you mark packets for child queue "... local" ? when you have child's you need to drive traffic to them. all traffic
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Help with HTB please

Sat Apr 15, 2017 3:02 pm

well it's strange use of queue tree, no limits, parent with one child...
There will be many childs. One child is in my example. Limits are set on users queues. You asked about traffic. Yes, there is no mangle rule for pm_tagnet_down_local for the present, but... what if there will be no "local" traffic at all? All tree will not work?

Regards,
Boris
 
Arnolis
just joined
Posts: 10
Joined: Wed Apr 12, 2017 9:01 pm

Re: Help with HTB please

Sat Apr 15, 2017 5:01 pm

Why do you want to limit local and a client. Are the clients co nected via CPE will need to know what your setup is. CPE Directly connected or do you want to control wifi

Sent from my SM-G900F using Tapatalk
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Help with HTB please

Sun Apr 16, 2017 5:05 am

Why do you want to limit local and a client.
Dear Arnolis! I want to limit "internet" traffic and not to limit "local" traffic. Mikrotik is the "core" router where some client are connected directly (VLANs) and other via CPEs (routed).
Yes, I know that common practice is to do shaping on CPEs, but too different models and some of them is not under my administrative control.

Regards,
Boris
 
sash7
Frequent Visitor
Frequent Visitor
Posts: 68
Joined: Sun Mar 20, 2016 10:39 pm

Re: Help with HTB please

Sun Apr 16, 2017 10:14 am

borisk try to use simple queue. it's much easy to understand and configure and work well in most cases. draw some diagram of network to see it
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Help with HTB please

Sun Apr 16, 2017 8:36 pm

sash7, I already trying. But I can't fully understand how to distinguish "local" traffic. I have read https://wiki.mikrotik.com/wiki/How_to_a ... as_traffic, but Wiki for Queue is outdated and does not fully explain what packet-marks do in this case. Would You explain please?

Regards,
Boris
 
sash7
Frequent Visitor
Frequent Visitor
Posts: 68
Joined: Sun Mar 20, 2016 10:39 pm

Re: Help with HTB please

Sun Apr 16, 2017 10:28 pm

without network map this is waste of time but...
i dont know how many interfaces you have, but if you set simple queue(s) with target=wan interface (internet), then local traffic (between local interfaces) cannot be affected in any way. in simple queue you can also add dst=xxx where xxx=any local interface and set internet speed limits in/out for any of local interfaces.
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: Help with HTB please

Mon Apr 17, 2017 9:28 am

sash7, for the present topology is:

CCR-1016 (CR1 core router)
-- eth0 - link to BR1 (border router 1)
-- eth1 - planned for BR2
-- eth2 - link to DSW1 (distribution switch 1)
-- eth3 - link to DSW2 (distribution switch 2)
-- eth4 - link to CSW1 (customer switch 1)

Each of DSW accumulates links from ARs (area routers, Cisco 3750G), where VLANs of remote users are terminated
CSW accumulates VLANs of nearby users, which are terminated directly on CCR-1016.
Due the specific legislation I can not link DSWs directly, traffic must go through CR1

I clearly explained the topology? If not - I'll try to explain more

Regards,
Boris