Community discussions

MikroTik App
 
ggarcia
just joined
Topic Author
Posts: 1
Joined: Fri Sep 03, 2021 12:25 am

Traffic Shaping Using Mangle Firewall Rules & Queue Trees (Mangle Queue)

Fri Sep 03, 2021 1:00 am

We have two internet speed plans that need shaping on a MikroTik Router (100 Mbps & 200 Mbps). The plan is to set the users in the 200 Mbps plan to static IPs, and the rest of the 100 Mbps plan into a pool of dynamic IPs possibly using an address list, or, sorting them by MAC addresses, whichever is the better option. An address list was set up for testing using one computer connected to ether2 and receiving the IP of 192.168.88.253 on DHCP with the default gateway of 192.168.88.1, the address list is called "Me". Two pcq queue types were set up (Down/Up) and a queue tree to sort the amount of packets thus speed going in each direction. The following script was used to set the traffic shaping rules on another MikroTik router for testing purposes, a 50 Mbps/25Mbps plan was tested using Mangle rules that mark incoming and outgoing packets, ether1 is the WAN port:

--------------------------------------------------------
/ip firewall mangle
add action=mark-connection chain=forward dst-address-list=Me new-connection-mark=Me_traffic_down out-interface=bridge passthrough=yes
add action=mark-connection chain=forward src-address-list=Me new-connection-mark=Me_traffic_up in-interface=bridge passthrough=yes
add action=mark-packet connection-mark=Me_traffic_down chain=forward new-packet-mark=Me_traffic_down out-interface=bridge passthrough=yes
add action=mark-packet connection-mark=Me_traffic_up chain=forward new-packet-mark=Me_traffic_up in-interface=bridge passthrough=yes
/queue type
add kind=pcq name=Me_download pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=50M pcq-src-address6-mask=64 pcq-total-limit=250000
add kind=pcq name=Me_upload pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=25M pcq-src-address6-mask=64 pcq-total-limit=250000
/queue tree
add name=Me_download packet-mark=Me_traffic_down parent=bridge queue=Me_download
add name=Me_upload packet-mark=Me_traffic_up parent=ether1 queue=Me_upload

--------------------------------------------------------
Packets were starting to get queued up but when running a speed test, nothing much was being reported by the router besides a few kilobits when 80-100 Mbps of data was being pushed through it on download and upload, despite it being set to 50 down, 25 up. Are we missing something? Thanks.

Who is online

Users browsing this forum: mkx and 89 guests