Hi all
I’m brand new to Mikrotik and now very little about it so please excuse any dump questions - and assistance will be greatly appreciated!
What I need to get done:
Basically what I need to achieve is, to run a script on my DHCP Server (MikroTIk) and if it detects android or iphone in the hostname, it should assign an IP in a network pool that I created.
What I have at this stage:
:foreach i in=[/ip dhcp-server lease find] do={
:local hostname [/ip dhcp-server lease get $i host-name]
:if ($hostname~“ipad|iPad|android|Android|iphone|iPhone”) do={
:local ipaddr [/ip dhcp-server lease get $i address] I NEED THE CORRECT COMMAND HERE, AS FAR AS I KNOW
}
}
Yes it’s in my network, just make ip pool that you want, name it and set that pool for hp.if you have more brand name let says memephone,oppo etc just add the name into list as $DVCHOST.