Need DHCP Lease Script to limit agent-remote-id (CPE Mac) to 1 IP address

New to Mikrotik, learning as I go. Setting up a WISP, need a little guidance in DHCP Scripting.
As the Subject says, I need DHCP Lease Script to limit agent-remote-id (CPE Mac) to 1 IP address.
I have been studying the scripting, and have figured out some of the variables, and what is available.
I’d like it to work like this:

DHCP request, Check to see if active IP exists for agent-remote-id, if exist, deny DHCP, log denial, else issue IP.

Any help would be appreciated.
Thanks in advance.

so post what you figured out so far, and where your having problems.

The forums are here to help people, If your not looking for help, but instead looking for someone to do it for you then say so. I am sure there is plenty of people willing to do so for the right price.

The script is executed after a lease is assigned or de-assigned, you cannot use them to process options before a lease is assigned. You could use a third-party DHCP server.

Simply on DHCP Server set “Client MAC Limit” to 1

But if you require that, for sure something is wrong on how you configure your CPE…
Why more than one IP are requested from CPE???

The OP is likely using a bridged wireless CPE, and to avoid having to register the MAC addresses of the client router, wishes to use relay agent information to determine which client site is connecting.

If the client connected a switch in place of the router and connected multiple devices they could each request an IP, potentially exhausting available addresses, and likely to have more bandwidth available than contracted if shaped per IP.

There are other ways such as having the client wireless CPE in router mode (potential issues with double NAT, and if client wants forwarding rules), or using PPPoE with each set of credentials limited to one active session.