MT as a SHAPER

Hi there,

I need to know the possibility of having a microtik machine act as a port shaper. I have around 5Mbps of downlink which i would like to shape based on port policy. For example i want to give priority to DNS and HTTP and than MSN and voice and cam than P2P and other ports.

Best regards,

Mangle is the way to go… http://www.mikrotik.com/testdocs/ros/2.9/ip/mangle.php

Mt is AMAZING at this! shaping, QOS..ect..

look no further.. if ~5mbit of total traffic a RB 532 should be almost over-kil for just shapingl…

HI

i Am facing the same needs

i made pakcet mark in mangle for http prerouting
and mark connection for http packetts
and in queue tree i added a global total queue for http priority 2
and dns priority 1

and then i can add in simple queue if i want the total bandwith needed for http packets for example
anything else should be done ?

jowi007, sounds like you got the hang of it and got what you needed to do done.

If you want to see more examples of how its done checkout http://wiki.mikrotik.com/wiki/TransparentTrafficShaper for a few more hints.

better do not mix queue tree and simple queues.

for very effective shaping use queue tree as you can attach leaves to root node, prioritize them, then add leaves to them etc etc. that way you can create very extensive configurations.

[admin@MikroTik] ip firewall mangle> pr
Flags: X - disabled, I - invalid, D - dynamic
0 chain=prerouting protocol=tcp dst-port=80 action=mark-packet new-packet-mark=Http passthrough=yes

1 chain=prerouting protocol=udp dst-port=53 action=mark-packet new-packet-mark=Dns passthrough=yes

2 chain=prerouting protocol=tcp dst-port=1863 action=mark-packet new-packet-mark=Msn passthrough=yes

3 chain=prerouting p2p=all-p2p action=mark-packet new-packet-mark=P2P passthrough=yes

4 chain=prerouting protocol=tcp dst-port=25 action=mark-packet new-packet-mark=SMTP passthrough=yes

5 chain=prerouting protocol=tcp dst-port=80 action=mark-connection new-connection-mark=Http passthrough=yes

6 chain=prerouting protocol=udp dst-port=53 action=mark-connection new-connection-mark=Dns passthrough=yes

7 chain=prerouting protocol=tcp dst-port=1863 action=mark-connection new-connection-mark=Msn passthrough=yes

8 chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=P2P passthrough=yes

9 chain=prerouting protocol=tcp dst-port=25 action=mark-connection new-connection-mark=SMTP passthrough=yes


[admin@MikroTik] queue tree> pr
Flags: X - disabled, I - invalid
0 name=“Http” parent=global-out packet-mark=Http limit-at=0 queue=default priority=2 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

1 name=“Dns” parent=global-total packet-mark=Dns limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

2 name=“Msn” parent=global-total packet-mark=Msn limit-at=0 queue=default priority=3 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

3 name=“P2P” parent=global-total packet-mark=P2P limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s

4 name=“Smtp” parent=global-total packet-mark=SMTP limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s


did i did something wrong in this ?

You need to do connection-mark first, and use it while you do packet-mark.

1 chain=prerouting protocol=tcp dst-port=80 action=mark-connection new-connection-mark=http-conn passthrough=yes

2 chain=prerouting protocol=tcp dst-port=80 connection-mark=http-conn action=mark-packet new-packet-mark=Http passthrough=no

Ok thanks a lot,

I tried this while trying to have the queues on a downlink router but when i tried using it on the uplink it didn’t work. What should i use instead of PREROUTING? I am selecting ports going out of ether1.

Regards,

It should work. You can use prerouting for limiting downlink and uplink, just specify different interface.
For uplink, use interface gateway, and for downlink, use interface local.

Ok here’s what i have:

I have one MT router with 3 ethernets. 2 of them are receving requests and the third one goes directly to the cisco router which serves as an uplink router. What i need to do is all the traffic going from the MT to the Cisco to be shaped with priority. Maybe you can help with this.

Regards,