Community discussions

MikroTik App
 
eldoncito2019
Member
Member
Topic Author
Posts: 332
Joined: Fri Jun 14, 2019 1:07 pm

IP HOTSPOT HOST

Thu Sep 01, 2022 7:59 pm

Friend, if I put this:
:put  [/ip hotspot host print as value]

I only want to print the "MAC ADDRESS", how do I do it?



EL DONCITO.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: IP HOTSPOT HOST

Thu Sep 01, 2022 10:49 pm

Do you want to make an effort to write in more detail?

As usually, is not understandable.

Provide EXAMPLE and a BETTER DESCRIPTION
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: IP HOTSPOT HOST

Thu Sep 01, 2022 10:52 pm

...
/ip hotspot host; :foreach item in=[find] do={:put [get $item mac-address]}
 
eldoncito2019
Member
Member
Topic Author
Posts: 332
Joined: Fri Jun 14, 2019 1:07 pm

Re: IP HOTSPOT HOST

Fri Sep 02, 2022 12:02 am

Thanks friend REX; How do I copy the mac address in IP BINDING?




EL DONCITO.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: IP HOTSPOT HOST  [SOLVED]

Fri Sep 02, 2022 12:08 pm

First EXPLAIN what you want to achieve in the end, without doing it one piece at a time.
/ip hotspot
:foreach item in=[host find] do={
    :local mac [host get $item mac-address]
    :local svr [host get $item server]
    ip-binding
    :if ([:len [find where mac-address=$mac and server=$svr]] = 0) do={
        add mac-address=$mac server=$svr type=blocked disabled=yes
    }
}

Who is online

Users browsing this forum: JDF and 22 guests