Community discussions

MikroTik App
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Script for remove inactive mac address on ip dhcp lease.

Thu Jul 14, 2011 11:50 am

Hi all,

Please help, i need some help regarding to autoremove inactive mac address on ip dhcp lease.
I think it's possible if i use script to autoremove it. But i confuse how to make for the script.

My assumtion is active or not active mac address on ip - dhcp - lease will be check on ip - hotspot - active, If there is no active mac address on ip - dhcp - lease than it should be remove.

Thanks you for your help.
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Fri Jul 15, 2011 4:10 am

Hi all,

Please help, i need some help regarding to autoremove inactive mac address on ip dhcp lease.
I think it's possible if i use script to autoremove it. But i confuse how to make for the script.

My assumtion is active or not active mac address on ip - dhcp - lease will be check on ip - hotspot - active, If there is no active mac address on ip - dhcp - lease than it should be remove.

Thanks you for your help.

Hi guys, any suggestion.
Tks before.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Script for remove inactive mac address on ip dhcp lease.

Fri Jul 15, 2011 4:15 am

Why would there not be a lease just because the host isn't active? The lease is there until it is no longer valid and the host doesn't claim it back. If you want the DHCP leases to expire sooner decrease the lease period.
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Fri Jul 15, 2011 6:28 am

Thank you for your reply

Yes correct, it's because the user is no longer active for the those ip segment.

For information, we use authentication system : radius manager
Ip segment was divided into three diffrent segments, so if user active again in other segment before old lease time priode ended and log in with a different segment, then the mac address will be double in dhcp lease with diffrent ip.

This will resulted errors in log mikrotik : limit address per-mac address.
And if the user is logged back into the old segments then the login priode will be continue old lease time which store in the dhcp lease.

We would like if the user is log in back into old ip segment and it should be count for new lease
time priode according lease time setting on the server.

We set our shared users on server is 2.

Because of that reason, we think to create a script to remove inactive mac addresses and use the active one mac address.

Thanks
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Mon Jul 18, 2011 4:09 am

Thank you for your reply

Yes correct, it's because the user is no longer active for the those ip segment.

For information, we use authentication system : radius manager
Ip segment was divided into three diffrent segments, so if user active again in other segment before old lease time priode ended and log in with a different segment, then the mac address will be double in dhcp lease with diffrent ip.

This will resulted errors in log mikrotik : limit address per-mac address.
And if the user is logged back into the old segments then the login priode will be continue old lease time which store in the dhcp lease.

We would like if the user is log in back into old ip segment and it should be count for new lease
time priode according lease time setting on the server.

We set our shared users on server is 2.

Because of that reason, we think to create a script to remove inactive mac addresses and use the active one mac address.

Thanks
Any suggestion please.
Thanks
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Tue Jul 19, 2011 4:35 am

Hi all,

Any solution please..

Thanks
 
reinerotto
Long time Member
Long time Member
Posts: 523
Joined: Thu Dec 04, 2008 2:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Sun Jul 24, 2011 6:34 pm

I have the same question, because of a similar reason.
http://forum.mikrotik.com/viewtopic.php?f=2&t=53670
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Tue Jul 26, 2011 10:10 am

I have the same question, because of a similar reason.
http://forum.mikrotik.com/viewtopic.php?f=2&t=53670
I think if you reduced the lease-time to the small time, this will make autentificated user logout suddenly. correct ?
 
morpheous22138
just joined
Topic Author
Posts: 7
Joined: Fri Nov 19, 2010 6:35 am

Re: Script for remove inactive mac address on ip dhcp lease.

Wed Jul 27, 2011 4:31 pm

hi guys,

any idea??


Thanks before.
 
hngjared
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Thu Dec 01, 2011 8:36 pm
Location: NYC USA

Re: Script for remove inactive mac address on ip dhcp lease.

Fri Mar 15, 2013 8:35 pm

Morpheus,

I have the same issue. Were you able to find a resolution?

Thanks!
 
hackb0x
just joined
Posts: 15
Joined: Sun Jul 27, 2008 12:23 pm

Re: Script for remove inactive mac address on ip dhcp lease.

Sun Mar 24, 2013 11:24 pm

hi guys .. here migh be a solution for ya... it`ll remove every 5 minutes ... just paste it on your new terminal ;) -- team_beruang @ makassar - indonesia - hehehe

add comment="" disabled=yes interval=5m name=schedule2 on-event="/ip hotspot host remove [find where !authorized and !bypassed]" policy=\
reboot,read,write,policy,test,password,sniff,sensitive start-time=startup

Who is online

Users browsing this forum: No registered users and 6 guests