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

    Pfsense, No internet when it is said "You are connected".

    Scheduled Pinned Locked Moved Captive Portal
    168 Posts 34 Posters 54.7k 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.
    • GertjanG
      Gertjan @michaeleino
      last edited by

      @michaeleino said in Pfsense, No internet when it is said "You are connected".:

      as after each reboot, I still hit the "You are connected" :(

      The patch enforces that the database with connected users is deleted at boot time.
      The related pipe-rule list is also deleted.
      See /etc/inc/system.inc - lines 21345-2137 after the patch is applied.

      The GUI Status > Captive Portal > YOURZONE should be empty after a pfSense rebooting.
      Right ?

      Now, you enter a user on the portal.
      You are connected - right ? The user shows up in the GUI Status > Captive Portal > YOURZONE, right ?
      Is that the moment you see You are connected", right after identification ?

      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
      • michaeleinoM
        michaeleino
        last edited by

        Hello, i was just unable to reboot the firewall since last time :)
        the issue has been magically gone, the captive portal status page is empty after reboot, so the users is able to re-authenticate again.

        Hope this patch be included in the next release!
        Thanks all

        1 Reply Last reply Reply Quote 0
        • michaeleinoM
          michaeleino
          last edited by

          Hi All!
          got the magic...
          reboot/halt from pfsense GUI is OK,
          The GUI Status > Captive Portal > ZONE is empty after a pfSense rebooting.

          but reboot/shutdown from acpi is NOT OK
          The GUI Status > Captive Portal > Old auth sessions are still there... very weird, as acpi should trigger the same runtime cycle!

          VM hosted on bhyve/freenas 11.3U2.1
          Virtual CPUs:8
          Memory Size:8.00 GiB
          Boot Loader Type:UEFI
          System Clock:UTC

          the issue originally, when we suffer a power outage and the UPS will not survive anymore, the Host OS is doing a clean shutdown for VMs then to itself, and after power return everything should come back again...
          except this captive portal :(

          any help ? Does it clean sessions on startup or shutoff ?

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

            @michaeleino said in Pfsense, No internet when it is said "You are connected".:

            the Host OS is doing a clean shutdown for VMs then to itself,

            The question is : is it halting ?

            See /etc/inc/system.inc - aroujd lin e2094 : on system_halt() system_reboot_cleanup() is called.
            An that function, a couple of line further bellow, will delete the portal session database(s).

            It plays also the shutdown notification sound

            	mwexec("/usr/local/bin/beep.sh stop");
            

            If the host puts the VM in some sort of suspended or sleep mode, all this might no happen.
            Check the logs if it really shuts down.

            Put a log line in the function system_reboot_cleanup() so you can check if it is reached, if the database is wiped, etc.

            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
            • michaeleinoM
              michaeleino
              last edited by

              Hi all!
              I have tried to add echo message inside each function, to see it while execution .. but i can't see them on any shutdown procedure neither "acpi" nor "pfsense halt"
              for ex:

              function system_halt() {
                      global $g;
                      echo "Hey, This is a system halting process";
                      system_reboot_cleanup();
               
                      mwexec("/usr/bin/nohup /etc/rc.halt > /dev/null 2>&1 &");
              }
              

              should I redirect it to console like this or what?

              >/dev/console

              something to note, "acpi" or "pfsense halt" is showing this on the console:
              Screenshot from 2020-05-02 19-35-29.png

              and pfsense is starting cleanly after both shutdowns ... can we execute this cleanup during Bootup ? is it better idea ?

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

                The several shutdown functions that exist in /etc/system.inc have to be called for pfSense maintenance purposes.

                I tend to say : redo your ACPI (bios ?) settings.

                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
                • michaeleinoM
                  michaeleino
                  last edited by michaeleino

                  Can't get your message :(
                  I'm using the UEFI boot loader, what BIOS should I check ?

                  I have other virtual machines like ubuntu/windows, they are going to perform soft shutdown normally.

                  1 Reply Last reply Reply Quote 0
                  • C
                    chanrio13 @andresense
                    last edited by

                    @andresense

                    can you share a script on how to do this on boot time? been seeing this issue in the past 4 releases of pf and it seems its not gonna be included in the next release at all but a patch.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      andresense @chanrio13
                      last edited by

                      @chanrio13

                      dude i don't know if the solution i made will work for you

                      What I did was check if the user's mac address is in the database and on the firewall, if it is only in the database, I remove it from the database
                      and the captive is shown to him again

                      this is for you?

                      1 Reply Last reply Reply Quote 0
                      • NovacomN
                        Novacom
                        last edited by

                        Hello !

                        I'm trying to understand this issue I have with captive portal users being left stuck in "you're connected" after a pfSense reboot. Clearly this have been an issue for which patches have been made until 2.5 arrives (master).

                        @stephenw10 said in Pfsense, No internet when it is said "You are connected".:

                        https://github.com/pfsense/pfsense/compare/RELENG_2_4_5...Augustin-FL:fix-reconfig-for-2-4-4.diff

                        The patch does not seems to download anymore.

                        Here are some info and what I tried :

                        • I'm on 2.4.5-RELEASE-p1
                        • I did not change the Captive Portal config after initial reboot.
                        • Log into Portal, browse fine, all OK, reboot pfSense, "you're connected" but in fact firewalled.
                        • https://github.com/pfsense/pfsense/pull/4042.diff Fetches but do not apply (fails at line 1954)
                        • https://github.com/pfsense/pfsense/compare/RELENG_2_4_4...Augustin-FL:fix-reconfig-for-2-4-4.diff does not fetch
                        • https://github.com/pfsense/pfsense/compare/RELENG_2_4_5...Augustin-FL:fix-reconfig-for-2-4-4.diff does not fetch
                        • @andresense's script could fix it quickly for me, as I could live with removing connected users at reboot but as I digged through the rabbit hole of this thread, the patch does this.

                        Thank you for any pointers for me...

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

                          Hummmm.

                          I'm using 2.4.5-RELEASE-p1 myself, and I guess w"re back at the beginning.

                          When editing the Services > Captive Portal, the ipfw tables that contain the authorized users is reset / emptied.
                          The connected user database isn't purge.
                          Where back where we started last year.

                          https://github.com/pfsense/pfsense/compare/RELENG_2_4_4...Augustin-FL:fix-reconfig-for-2-4-4.diff might have been useful - again, but is probably not 'clean' to patch automatically (code base changed).

                          Well ... what about the initial solution :

                          1. If you have users connected, do not edit the portal settings.
                          2. If you have to edit, disconnect connected users right after you hit the blue Save button.

                          It's probably time to re open the (a) bug report at pfSense-redmine.

                          edit : a reboot : same scenario : no firewall rules, and the connected users data base stays intact. Great.

                          edit 2 : I get it. @Novacom 👍 - patches were applied ... against 2.50.

                          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
                          • F
                            free4 Rebel Alliance @Novacom
                            last edited by

                            @Novacom hi,

                            I am the one who made this patch. I deleted it but I guess I can restore it

                            Would you like me to restore it?

                            1 Reply Last reply Reply Quote 0
                            • T
                              Tenshou
                              last edited by

                              Can you restore this patch?
                              This bug still exists in 2.4.5 -p1.

                              The same "You Are Connected" message. The only way to fix this is to disconnect all users and they need to sign in again.

                              This issue is marked as resolved but it is definitely not resolved.

                              "Here are some info and what I tried :

                              I'm on 2.4.5-RELEASE-p1
                              I did not change the Captive Portal config after initial reboot.
                              Log into Portal, browse fine, all OK, reboot pfSense, "you're connected" but in fact firewalled.
                              https://github.com/pfsense/pfsense/pull/4042.diff Fetches but do not apply (fails at line 1954)
                              https://github.com/pfsense/pfsense/compare/RELENG_2_4_4...Augustin-FL:fix-reconfig-for-2-4-4.diff does not fetch
                              https://github.com/pfsense/pfsense/compare/RELENG_2_4_5...Augustin-FL:fix-reconfig-for-2-4-4.diff does not fetch
                              @andresense's script could fix it quickly for me, as I could live with removing connected users at reboot but as I digged through the rabbit hole of this thread, the patch does this."

                              Same thing is happening to me. This is definitely not resolved.

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

                                @Tenshou said in Pfsense, No internet when it is said "You are connected".:

                                This bug still exists in 2.4.5 -p1.

                                Yep.
                                The patch was integrated in 2.5.0-dev, the version that comes out .... later.

                                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
                                • NovacomN
                                  Novacom
                                  last edited by

                                  Sorry for the delay, I somehow was made aware of replies only this morning...

                                  @free4 Yes I think the patch against current versions could mitigate the issue.

                                  The issue was becoming less urgent since my client dropped the idea of using captive portal. Still, I think we must have a way to fix the issue while waiting 2.5.0 to get current. Reboots might be more frequents in some installations and manual interventions (flush database) should be limited.

                                  Thanks

                                  1 Reply Last reply Reply Quote 0
                                  • F
                                    free4 Rebel Alliance
                                    last edited by free4

                                    @Novacom @Tenshou as requested, i have restored the patch.
                                    The previous URLs should be working now

                                    1 Reply Last reply Reply Quote 0
                                    • F
                                      Finotto @stephenw10
                                      last edited by Finotto

                                      @stephenw10
                                      Your answer saved me, This worked for me, I'm using version 2.4.5-RELEASE-p1.

                                      Patch: https://github.com/pfsense/pfsense/compare/RELENG_2_4_5...Augustin-FL:fix-reconfig-for-2-4-4.diff

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        amanfredini
                                        last edited by

                                        I've tested on version 2.4.5-RELEASE-p1 but patch doesn't apply. There isn't any checkbox in captive portal page

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

                                          I'm running :

                                          f0608e7b-68b0-44e9-87b9-b625a33d3051-image.png

                                          The patch URL :

                                          c870f511-dbdf-41a9-85d1-f11d96f2cd14-image.png

                                          The title == the URL for me.

                                          The patched can be cleanly reverted for me, which implies it is applied right now.
                                          So it should applied.

                                          This patch does not modify the visual part of GUI like adding a button.

                                          1. It will retain the info in the ipfw tables, which represent connected users if you have to edit/save captive portal settings while users are logged in. The issue with 2.4.5-p1 (and some previous version) was that these tables would be emptied, so users would be blocked by ipfw and redirected to the captive portal page. Upon reaching the login page, pfSense find the user already in the "list with connected users" and shows a simple "You are connected" message.
                                            Btw : the list with connected users is the list you see in the GUI :

                                          76049d0d-6c4c-4d2a-892a-d318a3b92180-image.png

                                          1. It will empty the list with connected users when booting.

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

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            soheil.amiri @Gertjan
                                            last edited by

                                            @Gertjan
                                            thanks for your reply
                                            but i could not apply the patch.
                                            Pfsense.JPG
                                            the patch is not even loaded for apply !!!!!

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