[HELP] How to set http traffic with highest priority ?

I got a WAN link (WAN1) with a speed 6M/512k

I wish to set all the http traffic with higher priority than others.
(both in and out cause I got a web server inside my LAN)

Is the following code correct?



/ ip firewall mangle 
add chain=prerouting protocol=tcp dst-port=80 action=mark-packet \
    new-packet-mark=high passthrough=yes comment="" disabled=no 
add chain=prerouting protocol=tcp packet-mark=!high action=mark-packet \
    new-packet-mark=normal passthrough=yes comment="" disabled=no 

/ queue simple 
add name="Main" dst-address=0.0.0.0/0 interface=WAN1 parent=none \
    direction=both priority=8 queue=default-small/default-small limit-at=0/0 \
    max-limit=0/0 total-queue=default-small disabled=no 
add name="High" dst-address=0.0.0.0/0 interface=WAN1 parent=Main \
    packet-marks=high direction=both priority=1 \
    queue=default-small/default-small limit-at=0/0 max-limit=0/0 \
    total-queue=default-small disabled=no 
add name="Normal" dst-address=0.0.0.0/0 interface=WAN1 parent=Main \
    packet-marks=normal direction=both priority=8 \
    queue=default-small/default-small limit-at=6000000/512000 \
    max-limit=6000000/512000 total-queue=default-small disabled=no

Anyone have any idea?

to prioritize your traffic in your first rule change passthrough=yes to no and then mark all the rest of traffic

in queues, better use queue tree.

add ine queue that holds ALL THE TRAFFIC and thena add child queues for high priority (in your case HTTP) traffic and then queue for the rest,

and set correct priorities.

here is the link to the manual:
http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php

Thanks a lot!

Some more questions.

  1. Should I mangle the packets in “pre-routing” chain or “forward” chain

  2. Should I user WAN1 as the parent field in the queue tree (WAN1 is the interface to internet)

The code now (“local-address” is the address list for all workstation & server inside)

/ ip firewall mangle 
add chain=prerouting protocol=tcp dst-port=80 src-address-list=local-addr \
    action=mark-packet new-packet-mark=high passthrough=yes comment="" \
    disabled=no 
add chain=prerouting protocol=tcp packet-mark=!high action=mark-packet \
    new-packet-mark=normal passthrough=yes comment="" disabled=no 

/ queue tree 
add name="High" parent="WAN1 Queue" packet-mark=high limit-at=0 \
    queue=ethernet-default priority=1 max-limit=0 burst-limit=0 \
    burst-threshold=0 burst-time=0s disabled=no 
add name="Normal" parent="WAN1 Queue" packet-mark=normal limit-at=0 \
    queue=ethernet-default priority=8 max-limit=0 burst-limit=0 \
    burst-threshold=0 burst-time=0s disabled=no 
add name="WAN1 Queue" parent=WAN1 packet-mark="" limit-at=0 \
    queue=ethernet-default priority=1 max-limit=0 burst-limit=0 \
    burst-threshold=0 burst-time=0s disabled=no

Is is correct?

In winbox, now I found that the Rate shown for the queue “WAN1 Queue” (sum of “High” queue and “Normal” queue) is much smaller than the Rate shown in the interface windows.

Is that normal?