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

22.05 - CP clients have connectivity issues after x amount of time

Captive Portal
6
44
6.5k
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.
  • H
    heper @Gertjan
    last edited by heper Sep 12, 2022, 5:43 PM Sep 12, 2022, 5:42 PM

    @gertjan

    i've monitored cp-situation fairly closely the entire day.
    i didn't notice any dropouts throughout the day with the workaround i have in place.

    thanks for looking into this & figuring out what the issue is

    1 Reply Last reply Reply Quote 1
    • S
      stephenw10 Netgate Administrator
      last edited by stephenw10 Sep 12, 2022, 11:23 PM Sep 12, 2022, 11:12 PM

      I have replicated this and we are reviewing it. I'll open a bug report that better describes the issue momentarily:

      https://redmine.pfsense.org/issues/13488

      Please add anything there that may be pertinent.

      Steve

      H 1 Reply Last reply Sep 13, 2022, 5:57 AM Reply Quote 0
      • H
        heper @stephenw10
        last edited by heper Sep 13, 2022, 6:04 AM Sep 13, 2022, 5:57 AM

        @stephenw10

        the same thing happens when per-user-bw is disabled:

        • all users use the same pipe
          • on disconnect that pipe gets removed

        should i add this to the redmine myself or will you change the summary ?

        G 1 Reply Last reply Sep 13, 2022, 6:49 AM Reply Quote 0
        • G
          Gertjan @heper
          last edited by Sep 13, 2022, 6:49 AM

          @heper

          Actually, bandwidth set, for all users, or not, or set individually when using FreeRadius, it doesn't matter.
          The issue has nothing to do with bandwidth, but bandwidth usage made it more 'visible'.
          Your video was spot on : all connected users together use the set bandwidth of one user (10 Mbits down). Looking again at the limiters list did the rest.

          Solving this one is easy.

          I'm often think about what jimp said ones in the past : we will have to re write all this captive portal (Italian food) 'code', he mentioned Python if I recall well. As "/etc/inc/captiveportal.inc" is a bit .... messy.

          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
            stephenw10 Netgate Administrator
            last edited by Sep 13, 2022, 11:47 AM

            Ah, OK, that is likely a hangover from ipfw where all traffic had to use a pipe in order to be filtered at L2. Though the pipe was set at unlimited bandwidth.
            Yes, add that or I can when I've tested it later today.

            Steve

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Sep 13, 2022, 1:12 PM

              Ok, yup, it's exactly that. Adding it.

              1 Reply Last reply Reply Quote 1
              • G Gertjan referenced this topic on Sep 19, 2022, 9:38 AM
              • G Gertjan referenced this topic on Sep 19, 2022, 9:39 AM
              • G Gertjan referenced this topic on Sep 25, 2022, 10:26 AM
              • G Gertjan referenced this topic on Sep 25, 2022, 10:26 AM
              • G Gertjan referenced this topic on Sep 25, 2022, 10:28 AM
              • G Gertjan referenced this topic on Sep 25, 2022, 10:28 AM
              • L
                level4 @Gertjan
                last edited by Oct 31, 2022, 1:52 PM

                @gertjan said in 22.05 - CP clients have connectivity issues after x amount of time:

                I did this to restore unique pipeno usage :

                /usr/local/captiveportal/index.html

                	$pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, true);
                .......
                	}
                	
                	$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
                
                

                I changed the true for false on the first line
                Added an 'else' condition.

                	$pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, false);
                .......
                
                	} else
                		$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
                

                Now, if a pipe gets attributed, but the login fails, the pipe will get freed up again.

                My users have now unique pipes.

                @Gertjan
                Would you be so kind to share the modified 22.05- index.php ?
                (Or a real diff)

                I'm having the same issue, and would like to try this fix, but dont really understand what should be changed.

                G 1 Reply Last reply Oct 31, 2022, 2:11 PM Reply Quote 0
                • G
                  Gertjan @level4
                  last edited by Gertjan Oct 31, 2022, 2:11 PM Oct 31, 2022, 2:11 PM

                  @level4

                  Sorry, never managed to make a "diff" - tried many times, but the obtained patch file isn't usefull (for me) otherwise I would use that myself, and it would be easier to communicate here, I agree.

                  The original code (from github):

                  🔒 Log in to view

                  Step 1: before the first line "$pipeno = captiveportal_get_next_dn_ruleno('auth',......", add

                  $auth_result = array();
                  

                  Step 2 : change the (now second) line

                  $pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, true);
                  

                  for

                  $pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, false);
                  

                  Step 3 - goto the closing line 262 "}"
                  and add an "else" behind and remove the following empty line.

                  The result looks like :

                  🔒 Log in to view

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

                  L 1 Reply Last reply Oct 31, 2022, 2:23 PM Reply Quote 1
                  • L
                    level4 @Gertjan
                    last edited by Oct 31, 2022, 2:23 PM

                    @gertjan Thanks!

                    I'm a total php noob, but;

                    That "} else" ..

                    shouldn't be a "} else {"

                    with a "}" below the "$auth_result =" line ?

                    G 1 Reply Last reply Nov 1, 2022, 7:47 AM Reply Quote 0
                    • G
                      Gertjan @level4
                      last edited by Nov 1, 2022, 7:47 AM

                      @level4 said in 22.05 - CP clients have connectivity issues after x amount of time:

                      That "} else" ..
                      shouldn't be a "} else {"
                      with a "}" below the "$auth_result =" line ?

                      You can place

                      $auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
                      

                      between { .... }, true. Like :

                      	.......
                      	} else
                      	{
                      		$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
                      	}
                      

                      Or

                      	.......
                      	} else { $auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context); }
                      

                      But as this is just one line, so no need.

                      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 2
                      • G Gertjan referenced this topic on Dec 13, 2022, 8:50 AM
                      • G Gertjan referenced this topic on Dec 13, 2022, 8:50 AM
                      • G Gertjan referenced this topic on Dec 13, 2022, 8:51 AM
                      • G Gertjan referenced this topic on Dec 13, 2022, 8:51 AM
                      • G Gertjan referenced this topic on Jan 9, 2023, 11:40 AM
                      • G Gertjan referenced this topic on Jan 9, 2023, 11:40 AM
                      44 out of 44
                      • First post
                        44/44
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.