Page 1 of 1

Amount of rules

Posted: Mon Aug 02, 2010 5:47 pm
by Sirrin
Hi all!

Whether the quantity of rules in menu Firewall-Mangle and Queues on MikroTik influences? Problems with a speed at clients Recently have begun, speed is not stable and does not reach declared in the tariff

Re: Amount of rules

Posted: Mon Aug 02, 2010 5:56 pm
by fewi
Yes, the more rules the router has to process, the more resources it will use. Once you use all of your CPU resources the router will begin to drop traffic.

What's the CPU utilization like when you are dropping traffic?

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:12 pm
by Sirrin
The maximum loading of the processor for a week did not exceed 20 %, operative memory too suffices. Problems begin in the evening and not at all clients. If there is no restriction of speed on download/upload that problems it is not visible.

Filter Rules - 35.
Mangle - 128 rules.
Queues - 90.

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:24 pm
by Chupaka
what hardware platform? those numbers are not so big, in general...

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:27 pm
by Feklar
What kind of hardware are you using? If it's x86 Router OS 4.x doesn't support multi-core processors, it has however been added into 5.x (currently in beta). So if you have a quad core CPU, then 25% would actually be 100% of one of the one core being used.

If the Queues are starting to get overloaded you can try increasing the queue size. If you go to the queue type in WinBox you can select your Queue and increase the number of packets allowed to stay in the queue.

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:42 pm
by Sirrin
Here some information about hardware.
11.png
22.png
33.png

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:43 pm
by Sirrin
44.png

Re: Amount of rules

Posted: Mon Aug 02, 2010 6:55 pm
by Feklar
Yup, multi-core CPU, so one core is becoming over loaded and is dropping your extra traffic, as soon as your CPU usage shows as 25% that means one of your 4 cores is at 100%, and so it will stop being able to process new stuff efficiently. You can try upgrading to version 5 beta to use more of your cores.

If you are running other services on the box such as the Dude or User Manager, you can also try offloading that to another box to free up resources and CPU time.

Re: Amount of rules

Posted: Tue Aug 03, 2010 3:11 pm
by jorj
If you mainly have problems at times, do a snooper or do a traffic analysis at that time.
99% of the cases, you get interference from yourself or other networks.
Also see if the noise on the link has different levels when you have good and bad links.

Check that, just in case.

Re: Amount of rules

Posted: Wed Aug 04, 2010 5:46 am
by Sirrin
Ok. Has made upgrade RouterOS on test router RB1000, now CPU usage always 100 %, except for several minutes after reboot RB1000. Did not begin to risk and do upgdare RouterOS on a border router. And yes, on border router RouterOS 4.10 says that
/system hardware> print
multi-cpu: yes

And these sreenshots show that happens with CPU usage after upgrade RouterOS from 4.10 to 5.0beta5.
55.png
66.png

Re: Amount of rules

Posted: Wed Aug 04, 2010 6:17 am
by fewi
Post your filter and mangle rules, and queues.

If an 8 core machine is constantly sitting at 20% overall you can be virtually sure that some process bound to just one core is pegging that core at 100%.

Re: Amount of rules

Posted: Wed Aug 04, 2010 6:20 am
by Sirrin
Probably it will be better to show ip firewall mangle> export?
And completely menu Queues?

Re: Amount of rules

Posted: Wed Aug 04, 2010 6:47 am
by Sirrin
/ip firewall mangle
add action=mark-routing chain=prerouting comment="Routing 10.70.1.0/24" \
    disabled=no new-routing-mark="Routing 10.70.1.0/24" passthrough=yes \
    src-address-list="Routing 10.70.1.0/24"
add action=mark-routing chain=prerouting comment="Routing 10.70.2.0/24" \
    disabled=no new-routing-mark="Routing 10.70.2.0/24" passthrough=yes \
    src-address-list="Routing 10.70.2.0/24"
add action=mark-routing chain=prerouting comment="Routing 10.70.3.0/24" \
    disabled=no new-routing-mark="Routing 10.70.3.0/24" passthrough=yes \
    src-address-list="Routing 10.70.3.0/24"
add action=mark-routing chain=prerouting comment="Routing 10.70.4.0/24" \
    disabled=no new-routing-mark="Routing 10.70.4.0/24" passthrough=yes \
    src-address-list="Routing 10.70.4.0/24"
add action=mark-routing chain=prerouting comment="Routing 10.70.5.0/24" \
    disabled=no new-routing-mark="Routing 10.70.5.0/24" passthrough=yes \
    src-address-list="Routing 10.70.5.0/24"
add action=mark-connection chain=forward comment="Serfing(Download)" \
    disabled=no dst-address-list=Serfing new-connection-mark=\
    "Serfing(Download)-connection" out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment="Serfing(Upload)" disabled=\
    no in-interface=vlan51 new-connection-mark="Serfing(Upload)-connection" \
    passthrough=yes src-address-list=Serfing
add action=mark-packet chain=forward comment=\
    "Serfing(Download), mark first bytes 0-500000" connection-bytes=0-500000 \
    connection-mark="Serfing(Download)-connection" disabled=no \
    dst-address-list=Serfing new-packet-mark=tcp-browse-dl out-interface=\
    vlan51 passthrough=no protocol=tcp src-port=80,443
add action=mark-packet chain=forward comment="Serfing(Download) tcp-other-dl" \
    connection-mark="Serfing(Download)-connection" disabled=no \
    dst-address-list=Serfing new-packet-mark=tcp-other-dl out-interface=\
    vlan51 passthrough=no protocol=tcp src-address=0.0.0.0
add action=mark-packet chain=forward comment="Serfing(Download) icmp-dl" \
    connection-mark="Serfing(Download)-connection" disabled=no \
    dst-address-list=Serfing new-packet-mark=icmp-dl out-interface=vlan51 \
    passthrough=no protocol=icmp
add action=mark-packet chain=forward comment="Serfing(Download) udp-dl" \
    connection-mark="Serfing(Download)-connection" disabled=no \
    dst-address-list=Serfing new-packet-mark=udp-dl out-interface=vlan51 \
    passthrough=no protocol=udp
add action=mark-packet chain=forward comment="Serfing(Download) other-dl" \
    connection-mark="Serfing(Download)-connection" disabled=no \
    dst-address-list=Serfing new-packet-mark=other-dl out-interface=vlan51 \
    passthrough=no
add action=mark-packet chain=forward comment="Serfing(Upload) tcp-other-ul" \
    connection-mark="Serfing(Upload)-connection" disabled=no in-interface=\
    vlan51 new-packet-mark=tcp-other-ul passthrough=no protocol=tcp \
    src-address-list=Serfing
add action=mark-packet chain=forward comment="Serfing(Upload) icmp-ul" \
    connection-mark="Serfing(Upload)-connection" disabled=no in-interface=\
    vlan51 new-packet-mark=icmp-ul passthrough=no protocol=icmp \
    src-address-list=Serfing
add action=mark-packet chain=forward comment="Serfing(Upload) udp-ul" \
    connection-mark="Serfing(Upload)-connection" disabled=no in-interface=\
    vlan51 new-packet-mark=udp-ul passthrough=no protocol=udp \
    src-address-list=Serfing
add action=mark-packet chain=forward comment="Serfing(Upload) other-ul" \
    connection-mark="Serfing(Upload)-connection" disabled=no in-interface=\
    vlan51 new-packet-mark=other-ul passthrough=no src-address-list=Serfing
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_256(Download)" disabled=no dst-address-list=\
    Speed_Limit_256 new-connection-mark="Connmark-Speed_Limit_256(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_256(Upload)" disabled=no in-interface=vlan51 \
    new-connection-mark="Connmark-Speed_Limit_256(Upload)" passthrough=yes \
    src-address-list=Speed_Limit_256
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Download)-DAY" connection-mark=\
    "Connmark-Speed_Limit_256(Download)" disabled=no dst-address-list=\
    Speed_Limit_256 new-packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Upload)-DAY" connection-mark=\
    "Connmark-Speed_Limit_256(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_256(Upload)-DAY" passthrough=no \
    src-address-list=Speed_Limit_256 time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Download)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_256(Download)" disabled=no dst-address-list=\
    Speed_Limit_256 new-packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Upload)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_256(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_256(Upload)-DAY2" passthrough=no \
    src-address-list=Speed_Limit_256 time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Download)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_256(Download)" disabled=no dst-address-list=\
    Speed_Limit_256 new-packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_256(Upload)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_256(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_256(Upload)-NIGHT" passthrough=no \
    src-address-list=Speed_Limit_256 time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_384(Download)" disabled=no dst-address-list=\
    Speed_Limit_384 new-connection-mark="Connmark-Speed_Limit_384(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_384(Upload)" disabled=no in-interface=vlan51 \
    new-connection-mark="Connmark-Speed_Limit_384(Upload)" passthrough=yes \
    src-address-list=Speed_Limit_384
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Download)-DAY" connection-mark=\
    "Connmark-Speed_Limit_384(Download)" disabled=no dst-address-list=\
    Speed_Limit_384 new-packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Upload)-DAY" connection-mark=\
    "Connmark-Speed_Limit_384(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_384(Upload)-DAY" passthrough=no \
    src-address-list=Speed_Limit_384 time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Download)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_384(Download)" disabled=no dst-address-list=\
    Speed_Limit_384 new-packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Upload)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_384(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_384(Upload)-DAY2" passthrough=no \
    src-address-list=Speed_Limit_384 time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Download)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_384(Download)" disabled=no dst-address-list=\
    Speed_Limit_384 new-packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_384(Upload)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_384(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_384(Upload)-NIGHT" passthrough=no \
    src-address-list=Speed_Limit_384 time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_768(Download)" disabled=no dst-address-list=\
    Speed_Limit_768 new-connection-mark="Connmark-Speed_Limit_768(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_768(Upload)" disabled=no in-interface=vlan51 \
    new-connection-mark="Connmark-Speed_Limit_768(Upload)" passthrough=yes \
    src-address-list=Speed_Limit_768
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Download)-DAY" connection-mark=\
    "Connmark-Speed_Limit_768(Download)" disabled=no dst-address-list=\
    Speed_Limit_768 new-packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Upload)-DAY" connection-mark=\
    "Connmark-Speed_Limit_768(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_768(Upload)-DAY" passthrough=no \
    src-address-list=Speed_Limit_768 time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Download)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_768(Download)" disabled=no dst-address-list=\
    Speed_Limit_768 new-packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Upload)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_768(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_768(Upload)-DAY2" passthrough=no \
    src-address-list=Speed_Limit_768 time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Download)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_768(Download)" disabled=no dst-address-list=\
    Speed_Limit_768 new-packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_768(Upload)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_768(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_768(Upload)-NIGHT" passthrough=no \
    src-address-list=Speed_Limit_768 time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_1536(Download)" disabled=no dst-address-list=\
    Speed_Limit_1536 new-connection-mark=\
    "Connmark-Speed_Limit_1536(Download)" out-interface=vlan51 passthrough=\
    yes
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_1536(Upload)" disabled=no in-interface=vlan51 \
    new-connection-mark="Connmark-Speed_Limit_1536(Upload)" passthrough=yes \
    src-address-list=Speed_Limit_1536
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Download)-DAY" connection-mark=\
    "Connmark-Speed_Limit_1536(Download)" disabled=no dst-address-list=\
    Speed_Limit_1536 new-packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Upload)-DAY" connection-mark=\
    "Connmark-Speed_Limit_1536(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_1536(Upload)-DAY" passthrough=no \
    src-address-list=Speed_Limit_1536 time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Download)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_1536(Download)" disabled=no dst-address-list=\
    Speed_Limit_1536 new-packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Upload)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_1536(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_1536(Upload)-DAY2" passthrough=no \
    src-address-list=Speed_Limit_1536 time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Download)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_1536(Download)" disabled=no dst-address-list=\
    Speed_Limit_1536 new-packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_1536(Upload)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_1536(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_1536(Upload)-NIGHT" passthrough=\
    no src-address-list=Speed_Limit_1536 time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_3072(Download)" disabled=no dst-address-list=\
    Speed_Limit_3072 new-connection-mark=\
    "Connmark-Speed_Limit_3072(Download)" out-interface=vlan51 passthrough=\
    yes
add action=mark-connection chain=forward comment=\
    "Connmark-Speed_Limit_3072(Upload)" disabled=no in-interface=vlan51 \
    new-connection-mark="Connmark-Speed_Limit_3072(Upload)" passthrough=yes \
    src-address-list=Speed_Limit_3072
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Download)-DAY" connection-mark=\
    "Connmark-Speed_Limit_3072(Download)" disabled=no dst-address-list=\
    Speed_Limit_3072 new-packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Upload)-DAY" connection-mark=\
    "Connmark-Speed_Limit_3072(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_3072(Upload)-DAY" passthrough=no \
    src-address-list=Speed_Limit_3072 time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Download)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_3072(Download)" disabled=no dst-address-list=\
    Speed_Limit_3072 new-packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Upload)-DAY2" connection-mark=\
    "Connmark-Speed_Limit_3072(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_3072(Upload)-DAY2" passthrough=no \
    src-address-list=Speed_Limit_3072 time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Download)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_3072(Download)" disabled=no dst-address-list=\
    Speed_Limit_3072 new-packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Packetmark-Speed_Limit_3072(Upload)-NIGHT" connection-mark=\
    "Connmark-Speed_Limit_3072(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Packetmark-Speed_Limit_3072(Upload)-NIGHT" passthrough=\
    no src-address-list=Speed_Limit_3072 time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment="Polosa_1024(Download)" \
    disabled=no dst-address-list=Polosa_1024 new-connection-mark=\
    "Polosa_1024(Download)" out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment="Polosa_1024(Upload)" \
    disabled=no in-interface=vlan51 new-connection-mark="Polosa_1024(Upload)" \
    passthrough=yes src-address-list=Polosa_1024
add action=mark-packet chain=forward comment="Polosa_1024(Download)" \
    connection-mark="Polosa_1024(Download)" disabled=no dst-address-list=\
    Polosa_1024 new-packet-mark="Polosa_1024(Download)" out-interface=vlan51 \
    passthrough=no
add action=mark-packet chain=forward comment="Polosa_1024(Upload)" \
    connection-mark="Polosa_1024(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Polosa_1024(Upload)" passthrough=no src-address-list=\
    Polosa_1024
add action=mark-connection chain=forward comment="Mix-1(Download)" disabled=\
    no dst-address-list=Mix-1 new-connection-mark="Mix-1(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment="Mix-1(Upload)" disabled=no \
    in-interface=vlan51 new-connection-mark="Mix-1(Upload)" passthrough=yes \
    src-address-list=Mix-1
add action=mark-packet chain=forward comment="Mix-1(Download)-DAY" \
    connection-mark="Mix-1(Download)" disabled=no dst-address-list=Mix-1 \
    new-packet-mark="Mix-1(Download)-DAY" out-interface=vlan51 passthrough=no \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-1(Upload)-DAY" \
    connection-mark="Mix-1(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-1(Upload)-DAY" passthrough=no src-address-list=Mix-1 \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-1(Download)-DAY2" \
    connection-mark="Mix-1(Download)" disabled=no dst-address-list=Mix-1 \
    new-packet-mark="Mix-1(Download)-DAY2" out-interface=vlan51 passthrough=\
    no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-1(Upload)-DAY2" \
    connection-mark="Mix-1(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-1(Upload)-DAY2" passthrough=no src-address-list=\
    Mix-1 time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-1(Download)-NIGHT" \
    connection-mark="Mix-1(Download)" disabled=no dst-address-list=Mix-1 \
    new-packet-mark="Mix-1(Download)-NIGHT" out-interface=vlan51 passthrough=\
    no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-1(Upload)-NIGHT" \
    connection-mark="Mix-1(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-1(Upload)-NIGHT" passthrough=no src-address-list=\
    Mix-1 time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment="Mix-2(Download)" disabled=\
    no dst-address-list=Mix-2 new-connection-mark="Mix-2(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment="Mix-2(Upload)" disabled=no \
    in-interface=vlan51 new-connection-mark="Mix-2(Upload)" passthrough=yes \
    src-address-list=Mix-2
add action=mark-packet chain=forward comment="Mix-2(Download)-DAY" \
    connection-mark="Mix-2(Download)" disabled=no dst-address-list=Mix-2 \
    new-packet-mark="Mix-2(Download)-DAY" out-interface=vlan51 passthrough=no \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-2(Upload)-DAY" \
    connection-mark="Mix-2(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-2(Upload)-DAY" passthrough=no src-address-list=Mix-2 \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-2(Download)-DAY2" \
    connection-mark="Mix-2(Download)" disabled=no dst-address-list=Mix-2 \
    new-packet-mark="Mix-2(Download)-DAY2" out-interface=vlan51 passthrough=\
    no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-2(Upload)-DAY2" \
    connection-mark="Mix-2(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-2(Upload)-DAY2" passthrough=no src-address-list=\
    Mix-2 time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-2(Download)-NIGHT" \
    connection-mark="Mix-2(Download)" disabled=no dst-address-list=Mix-2 \
    new-packet-mark="Mix-2(Download)-NIGHT" out-interface=vlan51 passthrough=\
    no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-2(Upload)-NIGHT" \
    connection-mark="Mix-2(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-2(Upload)-NIGHT" passthrough=no src-address-list=\
    Mix-2 time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment="Mix-3(Download)" disabled=\
    no dst-address-list=Mix-3 new-connection-mark="Mix-3(Download)" \
    out-interface=vlan51 passthrough=yes
add action=mark-connection chain=forward comment="Mix-3(Upload)" disabled=no \
    in-interface=vlan51 new-connection-mark="Mix-3(Upload)" passthrough=yes \
    src-address-list=Mix-3
add action=mark-packet chain=forward comment="Mix-3(Download)-DAY" \
    connection-mark="Mix-3(Download)" disabled=no dst-address-list=Mix-3 \
    new-packet-mark="Mix-3(Download)-DAY" out-interface=vlan51 passthrough=no \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-3(Upload)-DAY" \
    connection-mark="Mix-3(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-3(Upload)-DAY" passthrough=no src-address-list=Mix-3 \
    time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-3(Download)-DAY2" \
    connection-mark="Mix-3(Download)" disabled=no dst-address-list=Mix-3 \
    new-packet-mark="Mix-3(Download)-DAY2" out-interface=vlan51 passthrough=\
    no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-3(Upload)-DAY2" \
    connection-mark="Mix-3(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-3(Upload)-DAY2" passthrough=no src-address-list=\
    Mix-3 time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-3(Download)-NIGHT" \
    connection-mark="Mix-3(Download)" disabled=no dst-address-list=Mix-3 \
    new-packet-mark="Mix-3(Download)-NIGHT" out-interface=vlan51 passthrough=\
    no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Mix-3(Upload)-NIGHT" \
    connection-mark="Mix-3(Upload)" disabled=no in-interface=vlan51 \
    new-packet-mark="Mix-3(Upload)-NIGHT" passthrough=no src-address-list=\
    Mix-3 time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Bezlimitniy-1(Download)-Connection" disabled=no dst-address-list=\
    Bezlimitniy-1 new-connection-mark="Bezlimitniy-1(Download)-Connection" \
    out-interface=vlan51 passthrough=yes
add action=mark-packet chain=forward comment=\
    "Bezlimitniy-1(Download)-Packets" disabled=no dst-address-list=\
    Bezlimitniy-1 new-packet-mark="Bezlimitniy-1(Download)-Packets" \
    out-interface=vlan51 passthrough=no
add action=mark-connection chain=forward comment=\
    "Bezlimitniy-1(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-connection-mark="Bezlimitniy-1(Upload)-Connection" passthrough=yes \
    src-address-list=Bezlimitniy-1
add action=mark-packet chain=forward comment="Bezlimitniy-1(Upload)-Packets" \
    disabled=no in-interface=vlan51 new-packet-mark=\
    "Bezlimitniy-1(Upload)-Packets" passthrough=no src-address-list=\
    Bezlimitniy-1
add action=mark-connection chain=forward comment=\
    "Bronza(Download)-Connection" disabled=no dst-address-list=Bronza \
    new-connection-mark="Bronza(Download)-Connection" out-interface=vlan51 \
    passthrough=yes
add action=mark-connection chain=forward comment="Bronza(Upload)-Connection" \
    disabled=no in-interface=vlan51 new-connection-mark=\
    "Bronza(Upload)-Connection" passthrough=yes src-address-list=Bronza
add action=mark-packet chain=forward comment="Bronza(Download)-Packets-DAY" \
    connection-mark="Bronza(Download)-Connection" disabled=no \
    dst-address-list=Bronza new-packet-mark="Bronza(Download)-Packets-DAY" \
    out-interface=vlan51 passthrough=no time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Bronza(Upload)-Packets-DAY" \
    connection-mark="Bronza(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Bronza(Upload)-Packets-DAY" passthrough=no \
    src-address-list=Bronza time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Bronza(Download)-Packets-DAY2" \
    connection-mark="Bronza(Download)-Connection" disabled=no \
    dst-address-list=Bronza new-packet-mark="Bronza(Download)-Packets-DAY2" \
    out-interface=vlan51 passthrough=no time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Bronza(Upload)-Packets-DAY2" \
    connection-mark="Bronza(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Bronza(Upload)-Packets-DAY2" passthrough=no \
    src-address-list=Bronza time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Bronza(Download)-Packets-NIGHT" \
    connection-mark="Bronza(Download)-Connection" disabled=no \
    dst-address-list=Bronza new-packet-mark="Bronza(Download)-Packets-NIGHT" \
    out-interface=vlan51 passthrough=no time=\
    2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Bronza(Upload)-Packets-NIGHT" \
    connection-mark="Bronza(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Bronza(Upload)-Packets-NIGHT" passthrough=no \
    src-address-list=Bronza time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment=\
    "Serebro(Download)-Connection" disabled=no dst-address-list=Serebro \
    new-connection-mark="Serebro(Download)-Connection" out-interface=vlan51 \
    passthrough=yes
add action=mark-connection chain=forward comment="Serebro(Upload)-Connection" \
    disabled=no in-interface=vlan51 new-connection-mark=\
    "Serebro(Upload)-Connection" passthrough=yes src-address-list=Serebro
add action=mark-packet chain=forward comment="Serebro(Download)-Packets-DAY" \
    connection-mark="Serebro(Download)-Connection" disabled=no \
    dst-address-list=Serebro new-packet-mark="Serebro(Download)-Packets-DAY" \
    out-interface=vlan51 passthrough=no time=\
    12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Serebro(Upload)-Packets-DAY" \
    connection-mark="Serebro(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Serebro(Upload)-Packets-DAY" passthrough=no \
    src-address-list=Serebro time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Serebro(Download)-Packets-DAY2" \
    connection-mark="Serebro(Download)-Connection" disabled=no \
    dst-address-list=Serebro new-packet-mark="Serebro(Download)-Packets-DAY2" \
    out-interface=vlan51 passthrough=no time=\
    0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Serebro(Upload)-Packets-DAY2" \
    connection-mark="Serebro(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Serebro(Upload)-Packets-DAY2" passthrough=no \
    src-address-list=Serebro time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment=\
    "Serebro(Download)-Packets-NIGHT" connection-mark=\
    "Serebro(Download)-Connection" disabled=no dst-address-list=Serebro \
    new-packet-mark="Serebro(Download)-Packets-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=forward comment="Serebro(Upload)-Packets-NIGHT" \
    connection-mark="Serebro(Upload)-Connection" disabled=no in-interface=\
    vlan51 new-packet-mark="Serebro(Upload)-Packets-NIGHT" passthrough=no \
    src-address-list=Serebro time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=postrouting comment=\
    "Zoloto(Download)-Connection" disabled=no dst-address-list=Zoloto \
    new-connection-mark="Zoloto(Download)-Connection" out-interface=vlan51 \
    passthrough=yes
add action=mark-packet chain=postrouting comment=\
    "Zoloto(Download)-Packets-DAY" connection-mark=\
    "Zoloto(Download)-Connection" disabled=no dst-address-list=Zoloto \
    new-packet-mark="Zoloto(Download)-Packets-DAY" out-interface=vlan51 \
    passthrough=no time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=postrouting comment=\
    "Zoloto(Download)-Packets-DAY2" connection-mark=\
    "Zoloto(Download)-Connection" disabled=no dst-address-list=Zoloto \
    new-packet-mark="Zoloto(Download)-Packets-DAY2" out-interface=vlan51 \
    passthrough=no time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=postrouting comment=\
    "Zoloto(Download)-Packets-NIGHT" connection-mark=\
    "Zoloto(Download)-Connection" disabled=no dst-address-list=Zoloto \
    new-packet-mark="Zoloto(Download)-Packets-NIGHT" out-interface=vlan51 \
    passthrough=no time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=prerouting comment=\
    "Zoloto(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-connection-mark="Zoloto(Upload)-Connection" passthrough=yes \
    src-address-list=Zoloto
add action=mark-packet chain=prerouting comment=\
    "Zoloto(Upload)-Packets-DAILY" connection-mark=\
    "Zoloto(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Zoloto(Upload)-Packets-DAILY" passthrough=no \
    src-address-list=Zoloto time=12h-23h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=prerouting comment=\
    "Zoloto(Upload)-Packets-DAYLY2" connection-mark=\
    "Zoloto(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Zoloto(Upload)-Packets-DAILY2" passthrough=no \
    src-address-list=Zoloto time=0s-1h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=prerouting comment=\
    "Zoloto(Upload)-Packets-NIGHTLY" connection-mark=\
    "Zoloto(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Zoloto(Upload)-Packets-NIGHTLY" passthrough=no \
    src-address-list=Zoloto time=2h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=mark-connection chain=forward comment="24(Download)-Connection" \
    disabled=no dst-address-list=24 new-connection-mark=\
    "24(Download)-Connection" out-interface=vlan51 passthrough=yes
add action=mark-packet chain=forward comment="24(Download)-Packets" \
    connection-mark="24(Download)-Connection" disabled=no dst-address-list=24 \
    new-packet-mark="24(Download)-Packets" out-interface=vlan51 passthrough=\
    no
add action=mark-connection chain=forward comment="24(Upload)-Connection" \
    disabled=no in-interface=vlan51 new-connection-mark=\
    "24(Upload)-Connection" passthrough=yes src-address-list=24
add action=mark-packet chain=forward comment="24(Upload)-Packets" \
    connection-mark="24(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="24(Upload)-Packets" passthrough=no src-address-list=24
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_1(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_1 new-connection-mark=\
    "Vse_vklyucheno_1(Download)-Connection" out-interface=vlan51 passthrough=\
    yes
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_1(Download)-Packets" connection-mark=\
    "Vse_vklyucheno_1(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_1 new-packet-mark="Vse_vklyucheno_1(Download)-Packets" \
    out-interface=vlan51 passthrough=no
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_1(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-connection-mark="Vse_vklyucheno_1(Upload)-Connection" passthrough=yes \
    src-address-list=Vse_vklyucheno_1
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_1(Upload)-Packet" connection-mark=\
    "Vse_vklyucheno_1(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Vse_vklyucheno_1(Upload)-Packets" passthrough=no \
    src-address-list=Vse_vklyucheno_1
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_2(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_2 new-connection-mark=\
    "Vse_vklyucheno_2(Download)-Connection" out-interface=vlan51 passthrough=\
    yes
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_2(Download)-Packets" connection-mark=\
    "Vse_vklyucheno_2(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_2 new-packet-mark="Vse_vklyucheno_2(Download)-Packets" \
    out-interface=vlan51 passthrough=no
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_2(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-connection-mark="Vse_vklyucheno_2(Upload)-Connection" passthrough=yes \
    src-address-list=Vse_vklyucheno_2
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_2(Upload)-Packets" connection-mark=\
    "Vse_vklyucheno_2(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Vse_vklyucheno_2(Upload)-Packets" passthrough=no \
    src-address-list=Vse_vklyucheno_2
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_3(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_3 new-connection-mark=\
    "Vse_vklyucheno_3(Download)-Connection" out-interface=vlan51 passthrough=\
    yes
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_3(Download)-Packets" connection-mark=\
    "Vse_vklyucheno_3(Download)-Connection" disabled=no dst-address-list=\
    Vse_vklyucheno_3 new-packet-mark="Vse_vklyucheno_3(Download)-Packets" \
    out-interface=vlan51 passthrough=no
add action=mark-connection chain=forward comment=\
    "Vse_vklyucheno_3(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-connection-mark="Vse_vklyucheno_3(Upload)-Connection" passthrough=yes \
    src-address-list=Vse_vklyucheno_3
add action=mark-packet chain=forward comment=\
    "Vse_vklyucheno_3(Upload)-Packets" connection-mark=\
    "Vse_vklyucheno_3(Upload)-Connection" disabled=no in-interface=vlan51 \
    new-packet-mark="Vse_vklyucheno_3(Upload)-Packets" passthrough=no \
    src-address-list=Vse_vklyucheno_3
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serfing(Download)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serfing(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-512(Download)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Download)" parent=global-out priority=\
    8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-2048(Download)" parent=global-out priority=\
    8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-512(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-2048(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-4096(Download)" parent=global-out priority=\
    8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit-4096(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Download)" parent=global-out priority=\
    8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Upload)" parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bezlimitniy-1(Download)-Global" parent=global-out \
    priority=7
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bezlimitniy-1(Upload)-Global" parent=global-out \
    priority=7
/queue type
set default kind=pfifo name=default pfifo-limit=50
set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50
set wireless-default kind=sfq name=wireless-default sfq-allot=1514 \
    sfq-perturb=5
set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \
    red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10
set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=\
    5
add kind=pcq name=PCQ_download-128k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=128000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-128k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=128000 pcq-total-limit=3000
add kind=pcq name=PCQ-Download pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=128000 pcq-total-limit=3000
add kind=pcq name=PCQ-Upload pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=128000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-256k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=256000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-256k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=256000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-1024k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=1024000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-2048k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=2048000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-2048k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=2048000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-4096k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=4096000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-4096k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=4096000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-8192k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=8192000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-8192k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=8192000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-8192 pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=8192000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-1024k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=1024000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-16M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=16000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-16M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=16000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-3072k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=3072000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-3072k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=3072000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-5120k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=5120000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-5120k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=5120000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-6M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=6000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-6M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=6000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-2M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=2000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-2M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=2000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-4M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=4000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-4M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=4000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-3M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=3000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-3M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=3000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-5M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=5000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-5M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=5000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-10M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=10000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-10M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=10000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-1M pcq-classifier=dst-address pcq-limit=300 \
    pcq-rate=1000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-1M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=1000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-20M pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=20000000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-20M pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=20000000 pcq-total-limit=3000
add kind=pcq name=PCQ_download-512k pcq-classifier=dst-address pcq-limit=200 \
    pcq-rate=512000 pcq-total-limit=3000
add kind=pcq name=PCQ_upload-512k pcq-classifier=src-address pcq-limit=200 \
    pcq-rate=512000 pcq-total-limit=3000
set default-small kind=pfifo name=default-small pfifo-limit=10
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=tcp-browse-dl packet-mark=tcp-browse-dl parent=\
    "Serfing(Download)" priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=tcp-other-dl packet-mark=tcp-other-dl parent=\
    "Serfing(Download)" priority=6 queue=PCQ_download-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=icmp-dl packet-mark=icmp-dl parent="Serfing(Download)" \
    priority=1 queue=PCQ_download-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=udp-dl packet-mark=udp-dl parent="Serfing(Download)" \
    priority=4 queue=PCQ_download-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=other-dl packet-mark=other-dl parent="Serfing(Download)" \
    priority=8 queue=PCQ_download-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=tcp-browse-ul packet-mark=tcp-browse-ul parent=\
    "Serfing(Upload)" priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=tcp-other-ul packet-mark=tcp-other-ul parent=\
    "Serfing(Upload)" priority=6 queue=PCQ_upload-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=icmp-ul packet-mark=icmp-ul parent="Serfing(Upload)" \
    priority=1 queue=PCQ_upload-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=udp-ul packet-mark=udp-ul parent="Serfing(Upload)" \
    priority=4 queue=PCQ_upload-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=other-ul packet-mark=other-ul parent="Serfing(Upload)" \
    priority=8 queue=PCQ_upload-128k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Download)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-DAY" parent=\
    "Speed_Limit-512(Download)" priority=4 queue=PCQ_download-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Upload)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_256(Upload)-DAY" parent="Speed_Limit-512(Upload)" \
    priority=4 queue=PCQ_upload-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Download)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-DAY" parent=\
    "Speed_Limit_1024(Download)" priority=4 queue=PCQ_download-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Download)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-DAY" parent=\
    "Speed_Limit-2048(Download)" priority=4 queue=PCQ_download-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Download)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-DAY" parent=\
    "Speed_Limit-4096(Download)" priority=4 queue=PCQ_download-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Download)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-DAY" parent=\
    "Speed_Limit_8192(Download)" priority=4 queue=PCQ_download-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Upload)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_384(Upload)-DAY" parent=\
    "Speed_Limit_1024(Upload)" priority=4 queue=PCQ_upload-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Upload)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_768(Upload)-DAY" parent=\
    "Speed_Limit-2048(Upload)" priority=4 queue=PCQ_upload-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Upload)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_1536(Upload)-DAY" parent=\
    "Speed_Limit-4096(Upload)" priority=4 queue=PCQ_upload-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Upload)-DAY" packet-mark=\
    "Packetmark-Speed_Limit_3072(Upload)-DAY" parent=\
    "Speed_Limit_8192(Upload)" priority=4 queue=PCQ_upload-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Download)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-NIGHT" parent=\
    "Speed_Limit_1024(Download)" priority=4 queue=PCQ_download-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Download)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-NIGHT" parent=\
    "Speed_Limit-2048(Download)" priority=4 queue=PCQ_download-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Download)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-NIGHT" parent=\
    "Speed_Limit-4096(Download)" priority=4 queue=PCQ_download-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Download)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-NIGHT" parent=\
    "Speed_Limit_8192(Download)" priority=4 queue=PCQ_download-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Upload)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_384(Upload)-NIGHT" parent=\
    "Speed_Limit_1024(Upload)" priority=4 queue=PCQ_upload-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Upload)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_768(Upload)-NIGHT" parent=\
    "Speed_Limit-2048(Upload)" priority=4 queue=PCQ_upload-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Upload)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_1536(Upload)-NIGHT" parent=\
    "Speed_Limit-4096(Upload)" priority=4 queue=PCQ_upload-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Download)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-NIGHT" parent=\
    "Speed_Limit-512(Download)" priority=4 queue=PCQ_download-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Upload)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_256(Upload)-NIGHT" parent=\
    "Speed_Limit-512(Upload)" priority=4 queue=PCQ_upload-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Upload)-NIGHT" packet-mark=\
    "Packetmark-Speed_Limit_3072(Upload)-NIGHT" parent=\
    "Speed_Limit_8192(Upload)" priority=4 queue=PCQ_upload-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Download)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_768(Download)-DAY2" parent=\
    "Speed_Limit-2048(Download)" priority=4 queue=PCQ_download-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_2048(Upload)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_768(Upload)-DAY2" parent=\
    "Speed_Limit-2048(Upload)" priority=4 queue=PCQ_upload-4096k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Download)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_1536(Download)-DAY2" parent=\
    "Speed_Limit-4096(Download)" priority=4 queue=PCQ_download-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_4096(Upload)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_1536(Upload)-DAY2" parent=\
    "Speed_Limit-4096(Upload)" priority=4 queue=PCQ_upload-8192k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Download)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_256(Download)-DAY2" parent=\
    "Speed_Limit-512(Download)" priority=4 queue=PCQ_download-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_512(Upload)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_256(Upload)-DAY2" parent=\
    "Speed_Limit-512(Upload)" priority=4 queue=PCQ_upload-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Download)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_384(Download)-DAY2" parent=\
    "Speed_Limit_1024(Download)" priority=4 queue=PCQ_download-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_1024(Upload)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_384(Upload)-DAY2" parent=\
    "Speed_Limit_1024(Upload)" priority=4 queue=PCQ_upload-2048k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Download)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_3072(Download)-DAY2" parent=\
    "Speed_Limit_8192(Download)" priority=4 queue=PCQ_download-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Speed_Limit_8192(Upload)-DAY2" packet-mark=\
    "Packetmark-Speed_Limit_3072(Upload)-DAY2" parent=\
    "Speed_Limit_8192(Upload)" priority=4 queue=PCQ_upload-16M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Polosa_1024(Download)" packet-mark=\
    "Polosa_1024(Download)" parent=global-out priority=7 queue=\
    PCQ_download-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Polosa_1024(Upload)" packet-mark="Polosa_1024(Upload)" \
    parent=global-out priority=7 queue=PCQ_upload-1024k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-1(Download)-DAY" packet-mark=\
    "Mix-1(Download)-DAY,Mix-1(Download)-DAY2" parent=global-out priority=8 \
    queue=PCQ_download-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-1(Upload)-DAY" packet-mark=\
    "Mix-1(Upload)-DAY,Mix-1(Upload)-DAY2" parent=global-out priority=8 \
    queue=PCQ_upload-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-2(Download)-DAY" packet-mark=\
    "Mix-2(Download)-DAY,Mix-2(Download)-DAY2" parent=global-out priority=8 \
    queue=PCQ_download-5M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-2(Upload)-DAY" packet-mark=\
    "Mix-2(Upload)-DAY,Mix-2(Upload)-DAY2" parent=global-out priority=8 \
    queue=PCQ_upload-5M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-3(Download)-DAY" packet-mark=\
    "Mix-3(Download)-DAY,Mix-3(Download)-DAY2" parent=global-out priority=8 \
    queue=PCQ_download-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-3(Upload)-DAY" packet-mark=\
    "Mix-3(Upload)-DAY,Mix-3(Upload)-DAY2" parent=global-out priority=8 \
    queue=PCQ_upload-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-1(Download)-NIGHT" packet-mark=\
    "Mix-1(Download)-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-4M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-1(Upload)-NIGHT" packet-mark="Mix-1(Upload)-NIGHT" \
    parent=global-out priority=8 queue=PCQ_upload-4M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-2(Download)-NIGHT" packet-mark=\
    "Mix-2(Download)-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-2(Upload)-NIGHT" packet-mark="Mix-2(Upload)-NIGHT" \
    parent=global-out priority=8 queue=PCQ_upload-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-3(Download)-NIGHT" packet-mark=\
    "Mix-3(Download)-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-20M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Mix-3(Upload)-NIGHT" packet-mark="Mix-3(Upload)-NIGHT" \
    parent=global-out priority=8 queue=PCQ_upload-20M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bezlimitniy-1(Download)" packet-mark=\
    "Bezlimitniy-1(Download)-Packets" parent="Bezlimitniy-1(Download)-Global" \
    priority=8 queue=PCQ_download-1M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bezlimitniy-1(Upload)" packet-mark=\
    "Bezlimitniy-1(Upload)-Packets" parent="Bezlimitniy-1(Upload)-Global" \
    priority=8 queue=PCQ_upload-1M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bronza(Download)-DAY" packet-mark=\
    "Bronza(Download)-Packets-DAY,Bronza(Download)-Packets-DAY2" parent=\
    global-out priority=8 queue=PCQ_download-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bronza(Upload)-DAY" packet-mark=\
    "Bronza(Upload)-Packets-DAY,Bronza(Upload)-Packets-DAY2" parent=\
    global-out priority=8 queue=PCQ_upload-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bronza(Download)-NIGHT" packet-mark=\
    "Bronza(Download)-Packets-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-4M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Bronza(Upload)-NIGHT" packet-mark=\
    "Bronza(Upload)-Packets-NIGHT" parent=global-out priority=8 queue=\
    PCQ_upload-4M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serebro(Download)-DAY" packet-mark=\
    "Serebro(Download)-Packets-DAY,Serebro(Download)-Packets-DAY2" parent=\
    global-out priority=8 queue=PCQ_download-5M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serebro(Download)-NIGHT" packet-mark=\
    "Serebro(Download)-Packets-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serebro(Upload)-DAY" packet-mark=\
    "Serebro(Upload)-Packets-DAY,Serebro(Upload)-Packets-DAY2" parent=\
    global-out priority=8 queue=PCQ_upload-5M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Serebro(Upload)-NIGHT" packet-mark=\
    "Serebro(Upload)-Packets-NIGHT" parent=global-out priority=8 queue=\
    PCQ_upload-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Zoloto(Download)-DAY" packet-mark=\
    "Zoloto(Download)-Packets-DAY,Zoloto(Download)-Packets-DAY2" parent=\
    global-out priority=8 queue=PCQ_download-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Zoloto(Download)-NIGHT" packet-mark=\
    "Zoloto(Download)-Packets-NIGHT" parent=global-out priority=8 queue=\
    PCQ_download-20M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Zoloto(Upload)-NIGHTLY" packet-mark=\
    "Zoloto(Upload)-Packets-NIGHTLY" parent=global-out priority=8 queue=\
    PCQ_upload-20M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="24(Download)" packet-mark="24(Download)-Packets" \
    parent=global-out priority=8 queue=PCQ_download-1M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="24(Upload)" packet-mark="24(Upload)-Packets" parent=\
    global-out priority=8 queue=PCQ_upload-1M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Zoloto(Upload)-DAYLY" packet-mark=\
    "Zoloto(Upload)-Packets-DAILY,Zoloto(Upload)-Packets-DAILY2" parent=\
    global-out priority=8 queue=PCQ_upload-10M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_1(Download)" packet-mark=\
    "Vse_vklyucheno_1(Download)-Packets" parent=global-out priority=8 queue=\
    PCQ_download-512k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_1(Upload)" packet-mark=\
    "Vse_vklyucheno_1(Upload)-Packets" parent=global-out priority=8 queue=\
    PCQ_upload-512k
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_2(Download)" packet-mark=\
    "Vse_vklyucheno_2(Download)-Packets" parent=global-out priority=8 queue=\
    PCQ_download-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_2(Upload)" packet-mark=\
    "Vse_vklyucheno_2(Upload)-Packets" parent=global-out priority=8 queue=\
    PCQ_upload-2M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_3(Download)" packet-mark=\
    "Vse_vklyucheno_3(Download)-Packets" parent=global-out priority=8 queue=\
    PCQ_download-5M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name="Vse_vklyucheno_3(Upload)" packet-mark=\
    "Vse_vklyucheno_3(Upload)-Packets" parent=global-out priority=8 queue=\
    PCQ_upload-5M

Re: Amount of rules

Posted: Wed Aug 04, 2010 7:06 am
by fewi
Too late in the day to look in detail today - if no one has posted a large amount of details by tomorrow morning my time I will - but the most obvious optimization you can do is to quit stuffing everything into the same chains.

At a quick glance everything you do is based on the vlan51 interface either in or out, and then on address lists. In the prerouting and forward chains jump to custom chains based on in-interface=vlan51 and out-interface=vlan51 to save downstream traffic passing through upstream rules it will never match, and vice versa. Within those two custom chains for upstream and downstream traffic jump into further custom chains based on the address lists so that somebody on the mix1 list doesn't have to traverse all those other rules it will never match. You'll end up with one custom chain for each upstream and downstream for each address list. That way you can reduce the number of rules processed for each packet probably by one order of magnitude on average. Then watch packet counters on the rules and within the chain move rules hit more often as far to the top as you can while still keeping the processing logic intact.

Re: Amount of rules

Posted: Wed Aug 04, 2010 8:12 am
by jorj
/system check-installation
/system check-disk

Re: Amount of rules

Posted: Wed Aug 04, 2010 8:26 am
by Sirrin
/system check-installation
/system check-disk
Later. Because of users...

Re: Amount of rules

Posted: Wed Aug 04, 2010 8:53 am
by jorj
/system check-installation
/system check-disk
Later. Because of users...
yes, for check-disk you are disconecting everybody for a few minutes.

Re: Amount of rules

Posted: Thu Aug 05, 2010 8:48 am
by normis
Also don't look at CPU usage in Winbox, displaying real time information about all your rules also takes CPU resources. Close winbox and see the CPU usage in SSH

Re: Amount of rules

Posted: Thu Aug 05, 2010 10:13 am
by jorj
Also don't look at CPU usage in Winbox, displaying real time information about all your rules also takes CPU resources. Close winbox and see the CPU usage in SSH
We got that. :)

Wanted to ask you a long-time ago.
How much resources on rb4xx series, for example ? 1% - 2% ? or a more significant amount ?
And how "real-time" is the cpu usage in winbox ?

Re: Amount of rules

Posted: Thu Aug 05, 2010 10:16 am
by normis
Depends on the data you look at. If you open your firewall rules and look at the counters, you will get 100% cpu usage. Not sure about "how real time"