Community discussions

MikroTik App
 
arielf
newbie
Topic Author
Posts: 34
Joined: Fri May 09, 2008 4:58 pm

Can you help me with this script?

Thu Sep 05, 2019 10:24 pm

Hi, do I need if someone has a script to list and export blocked mac-addres from leases dhcp mikrotik?
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Can you help me with this script?

Fri Sep 06, 2019 1:11 am

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
Last edited by SiB on Fri Sep 06, 2019 10:20 am, edited 1 time in total.
 
arielf
newbie
Topic Author
Posts: 34
Joined: Fri May 09, 2008 4:58 pm

Re: Can you help me with this script?

Fri Sep 06, 2019 3:30 am

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
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 3007
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: Can you help me with this script?

Fri Sep 06, 2019 4:16 am

/ip dhcp-server lease print file=leases where block-access=yes
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3300
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Can you help me with this script?

Fri Sep 06, 2019 9:12 am

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]
}
}
Last edited by Jotne on Fri Sep 06, 2019 5:55 pm, edited 2 times in total.
 
arielf
newbie
Topic Author
Posts: 34
Joined: Fri May 09, 2008 4:58 pm

Re: Can you help me with this script?

Fri Sep 06, 2019 1:05 pm

Thank you, everyone, good solution.

Who is online

Users browsing this forum: No registered users and 30 guests