In winbox, I have set of IP and mac address in IP---->Hotspot----------> IP bindings.
I want a script to add these IPs and MAC addresses to DHCP server.
:foreach ITEM in [/ip hotspot ip-binding find] do={
:local MAC [/ip hotspot ip-binding get $ITEM mac-address;
:local IP [/ip hotspot ip-binding get $ITEM address;
/ip dhcp-server lease add address="$IP" mac-address="$MAC" disabled=no;
}
Untested, but it would be something like that.Code: Select all:foreach ITEM in [/ip hotspot ip-binding find] do={ :local MAC [/ip hotspot ip-binding get $ITEM mac-address; :local IP [/ip hotspot ip-binding get $ITEM address; /ip dhcp-server lease add address="$IP" mac-address="$MAC" disabled=no; }
:foreach ITEM in=[/ip hotspot ip-binding find] do={
:local MAC [/ip hotspot ip-binding get $ITEM mac-address];
:local IP [/ip hotspot ip-binding get $ITEM address];
/ip dhcp-server lease add address="$IP" mac-address="$MAC" disabled=no
}