Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Has anyone been able to get CP working flawless on iOS and Mac devices?

    Scheduled Pinned Locked Moved Captive Portal
    30 Posts 7 Posters 5.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kabrutus
      last edited by

      I need to create a captive portal so that users agree to terms.  I am currently just testing the default log in page, but it seems like the iOS devices dont respond to the first press on the log in button.  I have to press it twice in order for it to get to the "success" page.

      Same with the Mac laptops, if i click it once i get a spinning wheel on the bottom of the CP assist page, and if i dont press "continue" a second time, it will give me an error "A problem occurred"

      After that i am able to get online.

      I feel this will give me much grief as the users will think the network is down.

      Any help is appreciated.

      I am currently using 2.3.1_1 Community ED
      WAN/LAN/opt1 for CP

      1 Reply Last reply Reply Quote 0
      • D
        deajan
        last edited by

        I have a lot of users with iphones / mac that seem happy with my CP.
        Have you tried changing the default login page by something more 2016ish ?

        NetPOWER.fr - some opensource stuff for IT people

        1 Reply Last reply Reply Quote 0
        • DerelictD
          Derelict LAYER 8 Netgate
          last edited by

          CP and flawless are antonyms. CP, by default, breaks the internet so it cannot be flawless.

          It really does sound like something wrong with your custom page.

          You can always put up a test "hidden" test SSID protected by WPA on a test VLAN with a test portal to test things on. Did I say test enough?

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

          1 Reply Last reply Reply Quote 0
          • K
            kabrutus
            last edited by

            I am in the testing stage.  This whole setup is just for testing before we deploy.

            I am just trying it out with the default page, because i didn't want to add another layer of complexity to the service until i know whats broken and what work.

            Have you guys seen any of the issues i described?

            1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan
              last edited by

              @kabrutus:

              I need to create a captive portal so that users agree to terms.  I am currently just testing the default log in page, but it seems like the iOS devices dont respond to the first press on the log in button.  I have to press it twice in order for it to get to the "success" page.

              Same with the Mac laptops, if i click it once i get a spinning wheel on the bottom of the CP assist page, and if i dont press "continue" a second time, it will give me an error "A problem occurred"

              After that i am able to get online. 
              ….

              This is exactly what I'm experimenting the last couple of days (weeks).
              As soon as I see this "can not connect to the network error" on my iPhone again, I'll make a screen copy.
              On  the pfSense, captbe portal side, the session is opened - the connection exists - the device (iPhone HAS a connection).

              I tend to say that something is going on related to a latest iOS update-how the iDevice tests if it has a connection (the test page at something like "portal.apple.com" page after logging that show "success" …. )
              No change or update at the pfSense side is explaining this behavior (also because lately no changes were made concerning the captive portal).

              This is new .... the iPhone always connected fine the last x years to our pfSense portal.

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 0
              • DerelictD
                Derelict LAYER 8 Netgate
                last edited by

                I guess a static DHCP mapping for a device exhibiting the (hopefully reliably repeatable) behavior followed by a packet capture of that IP address is probably in order.

                Chattanooga, Tennessee, USA
                A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                Do Not Chat For Help! NO_WAN_EGRESS(TM)

                1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan
                  last edited by

                  I checked with the captive portal web server logs.
                  Something is new.

                  I connect to the portal - the entire "DHCP" session goes well.
                  My iPhone obtains an Ipv4 : 192.168.2.167 (which is not a static lease, I do not have to on my portal)

                  The, the captive portal magic kicks in:
                  My device (iPhone) has established the wifi connection, an IP has been obtains.
                  iOS checks if it has a open to "http://captive.apple.com/hotspot-detect.html" :
                  05-29-2016 09:02:55 Local5.Info 192.168.1.1 May 29 09:03:01 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:01 +0200] "GET /hotspot-detect.html HTTP/1.0" 302 0 "-" "CaptiveNetworkSupport-325.10.1 wispr"

                  It's redirected to (302) to
                  05-29-2016 09:02:56 Local5.Info 192.168.1.1 May 29 09:03:02 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:02 +0200] "GET /index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html HTTP/1.0" 200 1504 "-" "CaptiveNetworkSupport-325.10.1 wispr"
                  [my pfSense Captive portal] : /index.php?zone=cpzone1&redirurl=http://captive.apple.com/hotspot-detect.html HTTP/1.0"

                  Now, the strange part - this is new : My device launches another GET to
                  http://captive.apple.com/hotspot-detect.html :
                  05-29-2016 09:02:56 Local5.Info 192.168.1.1 May 29 09:03:03 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:03 +0200] "GET /hotspot-detect.html HTTP/1.1" 302 5 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69"

                  and of course, pfSense replies with another instance of the login page :
                  05-29-2016 09:02:57 Local5.Info 192.168.1.1 May 29 09:03:03 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:03 +0200] "GET /index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html HTTP/1.1" 200 844 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69"

                  My style.css get loaded :
                  05-29-2016 09:02:57 Local5.Info 192.168.1.1 May 29 09:03:03 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:03 +0200] "GET /captiveportal-style.css HTTP/1.1" 200 836 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69"

                  My device tries another test to http://captive.apple.com/hotspot-detect.html :
                  05-29-2016 09:02:57 Local5.Info 192.168.1.1 May 29 09:03:03 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:03 +0200] "GET /hotspot-detect.html HTTP/1.0" 302 0 "-" "CaptiveNetworkSupport-325.10.1 wispr"

                  pfSense replies to it with another instance / login session :
                  05-29-2016 09:02:58 Local5.Info 192.168.1.1 May 29 09:03:04 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:04 +0200] "GET /index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html HTTP/1.0" 200 1504 "-" "CaptiveNetworkSupport-325.10.1 wispr"

                  I entered my login credentials, and validate (POST) :
                  05-29-2016 09:03:22 Local5.Info 192.168.1.1 May 29 09:03:28 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:28 +0200] "POST /index.php?zone=cpzone1 HTTP/1.1" 302 5 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69"

                  and I reclick on "Enter", which generates another POST :
                  05-29-2016 09:03:33 Local5.Info 192.168.1.1 May 29 09:03:40 pfsense.brit-hotel-fumel.net nginx: 192.168.2.176 - - [29/May/2016:09:03:40 +0200] "POST /index.php?zone=cpzone1 HTTP/1.1" 302 5 "https://portal.brit-hotel-fumel.net:8003/index.php?zone=cpzone1&redirurl=http%3A%2F%2Fcaptive.apple.com%2Fhotspot-detect.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13F69"

                  and I past the login procedure.

                  When I do not "double click" on the "Login button" on the captive portal login page, after the first time, it times out with
                  https://goo.gl/photos/vrhn6SU4xYf17tWn9

                  I tracked down the first occurrence in my pfSense captive portal sever logs : April 14, 2016.
                  That was the day I installed 2.3-RELEASE which came out the day before, April 12, 2016 ….. that was the day httpd was switched for ningx, right ?

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  1 Reply Last reply Reply Quote 0
                  • DerelictD
                    Derelict LAYER 8 Netgate
                    last edited by

                    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.

                    Chattanooga, Tennessee, USA
                    A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                    DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                    Do Not Chat For Help! NO_WAN_EGRESS(TM)

                    1 Reply Last reply Reply Quote 0
                    • S
                      sbb
                      last edited by

                      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

                      1 Reply Last reply Reply Quote 0
                      • DerelictD
                        Derelict LAYER 8 Netgate
                        last edited by

                        Still need a packet capture.

                        Chattanooga, Tennessee, USA
                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

                        1 Reply Last reply Reply Quote 0
                        • S
                          sbb
                          last edited by

                          I can't upload .cap files. The results of "packets captured" I put into a txt file.

                          packetcapture_device.txt
                          packetcapture_pfsense.txt

                          1 Reply Last reply Reply Quote 0
                          • DerelictD
                            Derelict LAYER 8 Netgate
                            last edited by

                            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.

                            Chattanooga, Tennessee, USA
                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

                            1 Reply Last reply Reply Quote 0
                            • DerelictD
                              Derelict LAYER 8 Netgate
                              last edited by

                              @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.

                              Chattanooga, Tennessee, USA
                              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                              Do Not Chat For Help! NO_WAN_EGRESS(TM)

                              1 Reply Last reply Reply Quote 0
                              • S
                                sbb
                                last edited by

                                Thanks for your fast reply.

                                Device with IP 192.168.2.76:
                                http://www.file-upload.net/download-11627596/packetcapture_device_192168276.cap.html

                                Pfsense machine with IP 192.168.2.254:
                                http://www.file-upload.net/download-11627597/packetcapture_pfsense_1921682254.cap.html

                                1 Reply Last reply Reply Quote 0
                                • ?
                                  Guest
                                  last edited by

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • DerelictD
                                    Derelict LAYER 8 Netgate
                                    last edited by

                                    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.

                                    Chattanooga, Tennessee, USA
                                    A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                    DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                    Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                    1 Reply Last reply Reply Quote 0
                                    • DerelictD
                                      Derelict LAYER 8 Netgate
                                      last edited by

                                      I wonder what keepalive_timeout 0 in he portal's nginx.conf file would do here.

                                      Chattanooga, Tennessee, USA
                                      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                      Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                      1 Reply Last reply Reply Quote 0
                                      • GertjanG
                                        Gertjan
                                        last edited by

                                        @Derelict:

                                        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.

                                        No "help me" PM's please. Use the forum, the community will thank you.
                                        Edit : and where are the logs ??

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          sbb
                                          last edited by

                                          @Derelict:

                                          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.

                                          @Derelict:

                                          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.

                                          @Derelict:

                                          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

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            skron
                                            last edited by

                                            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=111964

                                            Because 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).

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.