Community discussions

MikroTik App
 
kschaef65
just joined
Topic Author
Posts: 2
Joined: Mon Jun 04, 2018 1:41 am

Simple single-line script to schedule

Fri Mar 08, 2019 1:44 am

I simply want to create a single script that does this.
/queue simple set 11 1M/4M

But instead of using the '11' I would like to use something like [find target=192.168.88.25]

I don't know what it is but I've tried a variety of variations on replacing the "11" with the phrase I have in brackets and I'm not sure why it doesn't run.

I'm sure someone will know right away. Thank you in advance.
Kevin
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Simple single-line script to schedule

Fri Mar 08, 2019 7:59 am

This is how you do it:
/queue simple set max-limit=1M/4M [find where target=192.168.88.25/32]
PS you need to specify subnet mask /32 for the IP, even if WinBox does not show it on single IP.
You can see what IP are used when typing
/queue simple export
add max-limit=1M/4M name=test parent="Bandwidth Control" target=192.168.88.25/32
If IP does come from a variable:
[
:local IP "192.168.88.25/32"
/queue simple set max-limit=1M/4M [find where target=$IP]
]
or
[
:local IP "192.168.88.25"
/queue simple set max-limit=1M/4M [find where target=$IP."/32"]
]

Who is online

Users browsing this forum: No registered users and 68 guests