Has anyone been able to get CP working flawless on iOS and Mac devices?
-
Still impossible to tell what is going on.
Do a Diagnostics > Packet Capture while executing the exact same procedure. In the previous case you would filter on 192.168.2.176 in Host Address.
-
I have the same problem. On all devices - not exclusively on an apple device - you need to press the "submit" button two times to get redirected. It wasn't a problem previous to version 2.3
-
Still need a packet capture.
-
I can't upload .cap files. The results of "packets captured" I put into a txt file.
-
Not enough detail and what are we looking at? What IP address is the specific client in question?
Identifying the specific times you were taking the various steps would help too.
Uploading pcaps would be better. If this site won't take them put them somewhere else.
-
@sbb:
I can't upload .cap files. The results of "packets captured" I put into a txt file.
Please at least put level of detail to full.
-
Thanks for your fast reply.
Device with IP 192.168.2.76:
http://www.file-upload.net/download-11627596/packetcapture_device_192168276.cap.htmlPfsense machine with IP 192.168.2.254:
http://www.file-upload.net/download-11627597/packetcapture_pfsense_1921682254.cap.html -
Have you tried changing the default login page by something more 2016ish ?
Since version 2.3 in the code of the login page must be placed a string of code that is there in the
default login page!!!! Otherwise you all will be getting problems with;- pfSense updates/upgrades (particularly)
- Login of some CP guests
I was reading this in another german speaking forum I´ll try to find it back for more assistance
and/or the code string that is needed. I am not really sure if this helps you out here, but it can
be, so please don´t bother with me if this is not really 100% matching. -
Test it again.
But this time, before pressing login a second time, check the captive portal sessions and see if the session was actually logged on. It looks to me like it will be. So instead of just pressing login a second time, bring up a web browser and try a site instead.
This is not a fix, but will confirm you're not dealing with a captive portal login problem but a site redirection problem instead.
The device capture you sent shows a redirect to htv-tennis.de.
The pfSense capture you sent shows a redirect to spiegel.de
Why are they different?
This is sent to the client after each login page POST.
HTTP/1.1 302 Moved Temporarily (text/html)
Looking at the client capture, after the first redirect is sent the client just sends a "GET / HTTP/1.1" to 212.223.29.33 without establishing the TCP connection first (packet has PSH,ACK flags) so it either thinks it already has a session established or the client is broken. As far as the firewall is concerned, this is out-of-state traffic, will be blocked, and will probably show up in the firewall logs with TCP:PA flags. This connection attempt is retransmitted three times then reset a couple seconds later.
Then the client does the second login POST. The same HTTP 302 is sent by the portal. This time the client establishes a TCP session to the destination by issuing a SYN. This time it looks like it works.
There is not enough detail to see exactly what is happening but it initially looks to be a client problem. Maybe nginx is doing something different enough to make it fail but the same redirect is being sent to the client both times - I wonder if there is some sort of HTTP streaming mode that should be disabled on the portal server instance that forces clients to issue new TCP SYNs for every page request or something. A more complete packet capture will show whether the initial HTTP GET by the client after login is part of the pre-login TCP session that was initially intercepted by the portal.
I think the device capture is the only one necessary. Set the count to zero and capture the entire session. Turn off wi-fi on the device, delete the portal session if any, turn on capture, then turn on the device wi-fi. Don't stop the capture until the actual destination page at least starts to load.
-
I wonder what keepalive_timeout 0 in he portal's nginx.conf file would do here.
-
But this time, before pressing login a second time, check the captive portal sessions and see if the session was actually logged on. It looks to me like it will be. So instead of just pressing login a second time, bring up a web browser and try a site instead.
This, I checked - and you're right.
After the first click (using capturing) I saw the POST from /index.html coming by, and pfSense confirmed me at the "Status -> Captive portal" page that the device WAS connected (or : the needed firewall rules were inject, all communication was possible to the net, etc).
Still, the "cripled-browser" that the iPhone uses (I don't recall the exact name of these kind of special login-browser) keeps spinning around.
And finally it times out with some completely non-related error about the AP.
Before, it showed pretty instantly the word "Succes" which is the result of GETting a page at portal.apple.com.Btw : My AP's (Linksys WRT54xx séries, among others), are all working flawlessly the last 5 ? 6 or 7 years.
Anyway, I know now how to capture. I'll make some captures tomorrow.
I also bring my iPad (very old so no latest iOS) to see if this one connects fine (which could indicate : recent iOS issue).
@BlueKobold:
Have you tried changing the default login page by something more 2016ish ?
Since version 2.3 in the code of the login page must be placed a string of code that is there in the
default login page!!!! Otherwise you all will be getting problems with;- pfSense updates/upgrades (particularly)
- Login of some CP guests
…
You mean this :
I confirm this is what I use in my own page - but, I'll be using the default pages for testing.
-
Test it again.
But this time, before pressing login a second time, check the captive portal sessions and see if the session was actually logged on. It looks to me like it will be. So instead of just pressing login a second time, bring up a web browser and try a site instead.
This is not a fix, but will confirm you're not dealing with a captive portal login problem but a site redirection problem instead.
Yeah same like Gertjan said. I am logged in after the first time cklicking the submit button. I can visit other sites, so it's a redirect problem.
The device capture you sent shows a redirect to htv-tennis.de.
The pfSense capture you sent shows a redirect to spiegel.de
Why are they different?
I visited different sites when capturing the IP adress of the device and the ip adress of the pfsense machine.
I think the device capture is the only one necessary. Set the count to zero and capture the entire session. Turn off wi-fi on the device, delete the portal session if any, turn on capture, then turn on the device wi-fi. Don't stop the capture until the actual destination page at least starts to load.
Here is a new caputure: http://www.file-upload.net/download-11630451/packetcapture.cap.html
-
Please excuse if this is way off, but: do you see blocked packets in the firewall log (dropped by the default rule)?
Then it might be somehow the same as this: https://forum.pfsense.org/index.php?topic=111964Because it would match the general setup - first opened page (that will get redirected) is same as after auth (that should go through), because it is both times the captive portal detection from Apple. If the connection is dropped, it seems like you have not authenticated - the second click on the login button builds a new connection, which will go through (as will any other new connection).
-
Please excuse if this is way off, but: do you see blocked packets in the firewall log (dropped by the default rule)?
Then it might be somehow the same as this: https://forum.pfsense.org/index.php?topic=111964Because it would match the general setup - first opened page (that will get redirected) is same as after auth (that should go through), because it is both times the captive portal detection from Apple. If the connection is dropped, it seems like you have not authenticated - the second click on the login button builds a new connection, which will go through (as will any other new connection).
yeah you could be right. I dunno how to export the firewall log. I tried to wait a longer time after clicking the submit button and I did get redirected. So exactly what you described in the other thread. The problem is users don't wait such a long time. A work around could be that I also define a "After authentication Redirection URL".
-
Derelict nailed it.
https://forum.pfsense.org/index.php?topic=112594.msg627568#msg627568 is the solution.
No more "double click", after hitting the logging button, the "Succces" from captive.apple.com will show right away :DBtw : It's NOT a firewall, issue - mine didn't change the last several years - its a web server (nginx) setup issue, in combination with iDevices.
Derelict will post more info soon.
-
Derelict nailed it.
https://forum.pfsense.org/index.php?topic=112594.msg627568#msg627568 is the solution.
No more "double click", after hitting the logging button, the "Succces" from captive.apple.com will show right away :DBtw : It's NOT a firewall, issue - mine didn't change the last several years - its a web server (nginx) setup issue, in combination with iDevices.
Derelict will post more info soon.
I did change keepalive_timeout to 0 also but it didn't work for me. Maybe I am doing something wrong
edit: works now! I killed the captiveportal.pid again and that did it. But I am afraid every time you edit the captive portal page keepalive_timeout resets to "65". I think Derelict will clarify and write an instruction how to solve it (he pmed me that instruction)
-
I'm pretty sure this will only happen if the initial URL attempted is the same as the redirect URL after authentication. Else a new TCP session will be established and the keepalive will be irrelevant.
https://redmine.pfsense.org/issues/6421
-
I'm pretty sure this will only happen if the initial URL attempted is the same as the redirect URL after authentication….
I do not redirect, leaving it up to the initial http request where the visitor goes after authentication.
-
I'm pretty sure this will only happen if the initial URL attempted is the same as the redirect URL after authentication. Else a new TCP session will be established and the keepalive will be irrelevant.
https://redmine.pfsense.org/issues/6421
Yes, that would explain both issues - the one here, and the one in the linked thread.
In case of the iOS/mac devices, it is the device itself opening the the same URL before/after auth (for CP detection) with the initial request.
Thanks for looking into and opening a new bug on this!
-
Wow this page had grown some legs since Friday. Can someone send me the info on how to fix the issue? Where would i make this edit?
I wonder what keepalive_timeout 0 in he portal's nginx.conf file would do here.
Thanks for all your help. :)