Can anyone advise on the correct way to handle this situation:
DHCP lease is set to say 1 hour.
User gets and IP, logs in to hotspot and is assigned by radius a 24 hour Idle-Timeout. The hotspot create a rule with IP and MAC in HOTSPOT ACTIVE view.
However, even though the hotspot knows the user is ‘active’ , the DHCP server reassigns the IP address to another user, resulting in neither user being able to use the sytem. Ive increased the DHCP server lease time to 24 hours, however, as the client (hotel) can change the radius attributes to meet their requirements, they could in theory create an 26 hour Idle-Timeout solution. We cant keep adjusting the DHCP servers.
SO to re-iterate - how do we stop the DHCP server re-assigning IP addresses that are showing as active on the hotspot?
I can’t get mine to do that. It has a pretty good way of checking previously assigned or static ips. Besides the “/ip dhcp-server lease” and “/ip pool used” lists, it checks to see if that ip responds to a ping. If it gets a response, it marks that ip as “busy” and tries the next ip in the list until it gets one that does not answer a ping.
You can see the lease data in
/ip dhcp-server lease
print detail
Are you sure there is only one dhcp server on that network? Are you sure the dhcp server and the hotspot are using the same ip pool?
THe problem is the user is on Idle-Timeout, no longer attached to the network, so DHCP reassigns the lease as it can no longer ping the client.
But the IP/MAC combination doesn’t get removed from the /IP HotSpot Active as I want the user to be able to come back into the hotel at the end of the day and reconnect and still be authorised - effectively, DHCP should not reassign an IP that is already active on the hotspot, but it does.
A quick fix was to write a script that scans /ip hotspot active and marks the IP as static in dhcp lease, whilst setting all other as non static. This ensures that once an IP is on the active list, its not reassigned, but I feel this should not be required as is a bug in the way DHCP/Hotspot interact.
THe problem is the user is on Idle-Timeout, no longer attached to the network, so DHCP reassigns the lease as it can no longer ping the client.
Not true. It matters not if the client is connected or not. If the lease is for 24 hours, that client has that lease reserved for 24 hours. The dhcp server should not reassign that ip to any other device for the entire lease time. The client should renew the lease at 12 hours. Plenty of time to prevent the dhcp server from releasing that ip.
But the IP/MAC combination doesn’t get removed from the /IP HotSpot Active as I want the user to be able to come back into the hotel at the end of the day and reconnect and still be authorised - effectively, DHCP should not reassign an IP that is already active on the hotspot, but it does.
Use cookies.
The dhcp server shouldn’t reassign that ip.
Log into hotspot. Hotspot will keep you idle for 24 hours before logging out. (for example)
After 1 hour, if you are no longer active on the network, the DHCP server will re-assign the IP address to a new user, despite it already knowing its assigned (and active) on the hotspot.
You then end up with 2 MACs assigned to one IP (one in DHCP Lease, one in IP HotSpot Active). I just dont think it should work like that. If the hotspot has grabbed and assigned an IP, it should not be available to the IP POOL again until after its removed from the hotspot.
Thank you for taking the time to discuss this with me though, its useful to see how other people use it - i’ll look into cookies.
After 1 hour, if you are no longer active on the network, the DHCP server will re-assign the IP address to a new user, despite it already knowing its assigned (and active) on the hotspot.
Am I doing this on ethernet or wireless?
edit: Never mind, I’ll try both. I’m on a third computer watching all this via ssh.
On the ethernet computer, it is sitting inactive logged in to the hotspot. It isn’t going to lose its ip because it has already been renewed at 30 minutes for another hour.
On the wifi computer, it won’t lose its ip either. It just renewed its lease for another hour.
This is what I used on the third computer to watch.
/ip dhcp-server lease
print detail interval=1m
And I have dhcp set for verbose logging in case something weird happened, but it didn’t..
How is the Wireless computer renewing its IP address when its no longer physically connected to the wireless network? My example is :
Keepalives turned off (I dont care if you are not physically connected to the network)
Idle-Timehout (HotSpot) 24 hours.
DHCP lease time: lets say two hours. ( purposefully less than the idle-timeout)
So, you use the wifi in the evening after logging in through the hotspot.
You turn off your computer and go to bed.
In the morning, you turn it on. You should get the same IP address as you hast night, and already be logged in as you are sitting in /ip hotspot active still. Nice and easy.
However, what happens is this:
Disconnect from the network for 8 hours.
Hotspot keeps you active as you would expect.
DHCP lease , if set lower than 24 hours is lost.
When you reconnect tin the morning, its entirely possible you will be given a new IP address.
I’ve got plenty of screen shots (and support call tickets) to show this happens. Maybe im mad to expect the Hotspot service to reserve leases of users it nows still have an active (albeit, idle and physically disconnected device).
So, you use the wifi in the evening after logging in through the hotspot.
You turn off your computer and go to bed.
In the morning, you turn it on. You should get the same IP address as you hast night, and already be logged in as you are sitting in /ip hotspot active still. Nice and easy.
Not mine. About 2 minutes after disconnecting from the wireless, I’m already logged out. Nice and easy.
Is there something about your wireless device that is staying connected when your computer is shut down? Mine disconnects from the AP as soon as I shut down.
BTW, my normal settings are backwards from yours. My idle timeout is 1 hour, and my dhcp lease time is 2 days.