Community discussions

MikroTik App
 
S8T8
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 81
Joined: Thu Sep 15, 2022 7:15 pm

How to apply Queue to specific ports?

Sun Oct 22, 2023 12:16 am

Hello, trying to apply FQ Codel to all ports except WAN,
previously I was using:
/queue interface set [find where default-queue~"hardware"] queue="NewQueue"


now, to exclude WAN ports that are not in the Bridge:
:foreach i in=[/interface bridge port find where interface~"sfp|ether"] do={/queue interface set [find where interface=[/interface bridge port get $i interface]] queue="NewQueue"}
is this correct?
Thanks!
 
KushnomGhatak
just joined
Posts: 2
Joined: Tue Aug 08, 2023 8:32 am

Re: How to apply Queue to specific ports?

Wed Oct 25, 2023 2:20 pm

Yes, your code to exclude WAN ports that are not in the Bridge is correct.

Here is a breakdown of your code:

:foreach i in=[/interface bridge port find where interface~"sfp|ether"] do={/queue interface set [find where interface=[/interface bridge port get $i interface]] queue="NewQueue"}

The :foreach loop iterates over each interface in the Bridge.
The find where interface~"sfp|ether" expression finds all interfaces that are SFP or Ethernet interfaces.
The [/interface bridge port get $i interface] expression gets the interface name of the current interface in the loop.
The find where interface=[/interface bridge port get $i interface] expression finds the queue configuration for the current interface in the loop.
The /queue interface set [find where interface=[/interface bridge port get $i interface]] queue="NewQueue" expression sets the queue for the current interface in the loop to NewQueue.
This code will exclude all WAN ports that are not in the Bridge from being assigned the NewQueue queue.

Here is an example of how to use your code:

/queue interface set [find where default-queue~"hardware"] queue="NewQueue"

:foreach i in=[/interface bridge port find where interface~"sfp|ether"] do={/queue interface set [find where interface=[/interface bridge port get $i interface]] queue="NewQueue"}

This code will set the queue for all interfaces in the Bridge, except for WAN ports, to NewQueue.

I hope this helps!

Who is online

Users browsing this forum: alixviral, almdandi and 1 guest