Can anybody help me out for advance scripting? the problem that im facing is through dhcp server i am getting the same ip each time. i have dhcp pool in my internal network of real ip and i want the dhcp server to allocate ip each time a different one.
change the “SonciWall” comment to match that of the one you want to target - case sensative i believe… and is this on 2.9 or 3.x ? This was only testing on 2.9 branch.
If I have my DHCP knowledge correct, when the workstation requests a DHCP lease it includes the last IP address, subnet mask, gateway and other options it had. If the workstation is on a subnet that matches all those properties then the DHCP server will acknowkedge the request and the workstation uses the same address and options. If the workstation has been turned off and you turn it on, it’s up to the DHCP server to give out the address. If the DHCP server still has a copy of the lease the workstation had then it will likely issue the same address. Setting the lease time shorter might work so some other workstation can get the address after the lease times out but if the next available address happenes to be the same one, you will get the same one again.
I tried to check the same but there is no any option named “comment” kindly help with the same. I have one doubt that isnt it be configured on other variables like hostname or with the existing dchp client ip address.
When you either create a lease manually or if there is an existing lease created, you need to hit the ‘comment’ button and type something there that describes that lease. I think this is MAC based, not IP based. So that comment will stay with the MAC address. Someone else correct me if I’m wrong please.
But I would also upgrade to 2.9.51, it’s very stable.
got with the solution.. first you have to make that dhcp client showing in the lease to a static.. then right click and add a comment to that lease. then have to try with the script..
Fine let me try with it ill post it after i check the same.
:global a ;
:set a [/ip dhcp-server lease get [find comment=“an”] address ]
:if ([:toip $a] >10.200.200.254) do={:set a 10.200.200.100} else={:set a ($a+1)}
/ip dhcp-server lease set [find comment=“an”] address=$a
heya this script seems to be working but when i renew and release the ip address in pc after that i need to re enter the below command..
:if ([:toip $a] >10.200.200.254) do={:set a 10.200.200.100} else={:set a ($a+1)}
/ip dhcp-server lease set [find comment=“an”] address=$a
Then n then the ip get + 1
so, now can somebody help to make the script on event when someone login to hotspot user ? for example hotspot user “an”