Page 1 of 1

Can you help me with this script?

Posted: Thu Sep 05, 2019 10:24 pm
by arielf
Hi, do I need if someone has a script to list and export blocked mac-addres from leases dhcp mikrotik?

Re: Can you help me with this script?

Posted: Fri Sep 06, 2019 1:11 am
by SiB
Hi, do I need
Hello, We don't know what you need and if you need or not.
if someone has a script
SomeOne have a script, not one, not two.
to list and export blocked mac-addres from leases dhcp mikrotik?
Re write this question.
"to list" maybe to print to file like by: ip dhcp-server lease print file=list.txt
"export blocked mac-addres" Where dhcp-server block a mac-address? He can assign IP details to client or not.

Be more specific.

EDIT:
Sorry, for writing in Spanish, but I don't speak English and the translators are not good.
I have configured the mikrotik, dhcp-server, with about 500 users. with static ip all.
There are many that I have blocked, in the configuration of the leases, where is the option "block Access"
well I want to export the leases to a TXT, but only with those users that I have blocked. If someone can happen to me how to do it

Thank you

Re: Can you help me with this script?

Posted: Fri Sep 06, 2019 3:30 am
by arielf
Perdon, por escribir en espaƱol, pero no hablo ingles y los traductores no son buenos.
Tengo configurado en el mikrotik , dhcp-server, con alrrededor de 500 usuarios. con ip estaticas todos.
Hay muchos que los tengo bloqueados, en la configuracion del leases, donde esta la opcion " block Access"
bueno quiero exportar el leases a un TXT , pero solamente con esos usuarios que tengo bloqueados. Si alguien me puede pasar como hacerlo

gracias

Re: Can you help me with this script?

Posted: Fri Sep 06, 2019 4:16 am
by chechito
/ip dhcp-server lease print file=leases where block-access=yes

Re: Can you help me with this script?

Posted: Fri Sep 06, 2019 9:12 am
by Jotne
To get only the mac of the blocked users:
{
foreach logline in=[/ip dhcp-server lease find where block-access=yes] do={
  :put [/ip dhcp-server lease get $logline mac-address]
}
}

Re: Can you help me with this script?

Posted: Fri Sep 06, 2019 1:05 pm
by arielf
Thank you, everyone, good solution.