Re-enter a voucher in captive portal when client get new IPaddress
-
I'm using pfsense version 2.6.0
My issue is: when I have a voucher and I get connected with the first ip address from pfsense dhcp. The voucher expires in a month, then next day I get a new ip address from the dhcp it is open the captive portal again thus I have to re-enter my voucher to have connection even my voucher still valid.Can some one know to fix this?
Thanks a lot -
it means, the client is not auto re-connect even the voucher still valid, I have to re-enter my voucher in captiveportal again. is there anyway to auto re-connect without re-enter voucher?
-
@trungnguyen said in Re-enter a voucher in captive portal when client get new IPaddress:
even my voucher still valid.
This needs some thoughts.
First : what is a captive portal session ?
It's the collection of device's IP, MAC, voucher code, initial time stamp, and a firewall rule number, and some more stuff.
When a voucher is valid (not expired), a session is created, the firewall rule (with IP and MAC) is entered = the device can pass through.Now comes the soft time out, if you use it, the hard time out, if you use it. When any of these two becomes 'true', the session is deleted, the firewall rule is removed. The user has to login again using the voucher code.
But also : the user goes away for the day, comes back next day, recognizes your network, will ask for the same IP as yesterday If that IP isn't aviable, he'll be getting another one, so even if the session still exited from yesterday, the user will have to enter again the voucher code because his IP changed.
Thus : if you use very long voucher times, then it might be advisable to use longer DHCP leases. And with that comes also : big DHCP IP pool.So :
@trungnguyen said in Re-enter a voucher in captive portal when client get new IPaddress:
the client is not auto re-connect even the voucher still valid
that's not how it works.
The voucher user connect right through the portal if the session :is still visible == exists.
It will get removed when idle time out hard time out.
Or voucher time out.
And, as said, DHCP obtained IP should be the same. -
@gertjan
Yes, you are right, in this case we need a big DHCP pool and then set the DHCP lease time to match the voucher expire time.thanks a lot
-
@gertjan
btw, I change mode to "last login" in the captive portal setting then it work fine for me, clients should re-enter the code at the time DHCP lease.