Community discussions

MikroTik App
 
blueknight529
just joined
Topic Author
Posts: 3
Joined: Wed Feb 23, 2022 2:04 pm

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

Tue Mar 08, 2022 1:31 pm

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.
 
User avatar
smyers119
Member Candidate
Member Candidate
Posts: 232
Joined: Sat Feb 27, 2021 8:16 pm
Location: USA

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

Fri Mar 11, 2022 7:25 am

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.
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

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

Fri Mar 11, 2022 2:47 pm

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

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

Fri Mar 11, 2022 4:55 pm

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???
 
tdw
Forum Guru
Forum Guru
Posts: 1843
Joined: Sat May 05, 2018 11:55 am

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

Fri Mar 11, 2022 5:52 pm

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.

Who is online

Users browsing this forum: Semrush [Bot] and 15 guests