05.01.2015 Views

MikroTik RouterOS™ v2.9

MikroTik RouterOS™ v2.9

MikroTik RouterOS™ v2.9

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

prefix :<br />

action<br />

unnamed parameter<br />

pname[=value]<br />

/interface monitor-traffic ether1,ether2,ipip1<br />

for<br />

i<br />

from=1 to=10 do={:put $i}<br />

prefix /<br />

path<br />

action<br />

unnamed parameter<br />

Expression Grouping<br />

Description<br />

interface<br />

monitor-traffic<br />

ether1,ether2,ipip1<br />

This feature provides an easy way to execute commands from within one command level, by<br />

enclosing them in braces '{ }'.<br />

Notes<br />

Subsequent script commands are executed from the same menu level as the entire script. Consider<br />

the following example:<br />

[admin@<strong>MikroTik</strong>] ip route> /user {<br />

{... /ip route<br />

{... print}<br />

Flags: X - disabled<br />

# NAME GROUP ADDRESS<br />

0 ;;; system default user<br />

admin full 0.0.0.0/0<br />

1 uuu full 0.0.0.0/0<br />

[admin@<strong>MikroTik</strong>] ip route><br />

Although the current command level is changed to /ip route, it has no effect on next commands<br />

entered from prompt, therefore print command is still considered to be /user print.<br />

Example<br />

The example below demonstrates how to add two users to the user menu.<br />

[admin@<strong>MikroTik</strong>] ip route> /user {<br />

{... add name=x password=y group=write<br />

{... add name=y password=z group=read<br />

{... print}<br />

Flags: X - disabled<br />

# NAME GROUP ADDRESS<br />

0 ;;; system default user<br />

admin full 0.0.0.0/0<br />

1 x write 0.0.0.0/0<br />

2 y read 0.0.0.0/0<br />

[admin@<strong>MikroTik</strong>] ip route><br />

Page 553 of 615<br />

Copyright 1999-2005, <strong>MikroTik</strong>. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.<br />

Other trademarks and registred trademarks mentioned herein are properties of their respective owners.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!