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

[Solved] Multiple CP Not Working

Scheduled Pinned Locked Moved Captive Portal
12 Posts 4 Posters 1.2k 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.
  • R
    robertolw
    last edited by robertolw Jul 5, 2018, 2:47 PM Jun 26, 2018, 1:15 AM

    Hi, i have a CP setup up and working but when i add a new one to a different VLAN the new Captive portal is able to authenticate but squid deny connection 403.

    1 Reply Last reply Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Jun 26, 2018, 12:41 PM

      That's a squid problem, not a captive portal problem. Try posting on the Cache/Proxy board.

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • R
        robertolw
        last edited by Jul 3, 2018, 12:23 PM

        Vlan 101-103 are on “CP1” and Vlan 108 is on “CP2”

        0_1530620574326_squi1.JPG 0_1530620580093_squi2.JPG

        1 Reply Last reply Reply Quote 0
        • G
          Gertjan
          last edited by Jul 3, 2018, 12:42 PM

          Why did you post your CP settings of one of your CP zones ?

          @jimp said in Multiples CP Not Working:

          That’s a squid problem, not a captive portal problem.

          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
          • R
            robertolw
            last edited by Jul 4, 2018, 10:46 AM

            0_1530631036764_cp1.JPG
            0_1530631040900_cp2.JPG
            0_1530631044510_cp3.JPG

            1 Reply Last reply Reply Quote 0
            • M
              magokbas
              last edited by Jul 5, 2018, 7:40 AM

              The problem is that the code in /usr/local/bin/check_ip.php is incorrect.
              del /usr/local/bin/check_ip.php and use the following code.

              #!/usr/local/bin/php-cgi -q
              <?php
              /*
               * check_ip.php
               *
               * part of pfSense (https://www.pfsense.org)
               * Copyright (c) 2016-2017 Rubicon Communications, LLC (Netgate)
               * Copyright (c) 2013-2016 Marcello Coutinho
               * All rights reserved.
               *
               * Licensed under the Apache License, Version 2.0 (the "License");
               * you may not use this file except in compliance with the License.
               * You may obtain a copy of the License at
               *
               * http://www.apache.org/licenses/LICENSE-2.0
               *
               * Unless required by applicable law or agreed to in writing, software
               * distributed under the License is distributed on an "AS IS" BASIS,
               * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
               * See the License for the specific language governing permissions and
               * limitations under the License.
               */
              
              require_once("config.inc");
              require_once("globals.inc");
              error_reporting(0);
              global $g;
              // stdin loop
              if (!defined(STDIN)) {
              	define("STDIN", fopen("php://stdin", "r"));
              }
              if (!defined(STDOUT)) {
              	define("STDOUT", fopen('php://stdout', 'w'));
              }
              while (!feof(STDIN)) {
              	$check_ip = trim(fgets(STDIN));
              	$dbs = glob("{$g['vardb_path']}/captiveportal*.db");
              	$status = NULL;
              	
              	foreach ($dbs as $db) {
              		if(!strpos($db, "_radius")) {
              			$status = squid_check_ip($db, $check_ip);
              			if (isset($status)){
              				break;
              			}
              		}
              	}
              	if (!is_null($status)) {
              		fwrite(STDOUT, "OK user={$status}\n");
              	} else {
              		fwrite(STDOUT, "ERR\n");
              	}
              }
              
              function squid_check_ip($db, $check_ip) {
              	exec("/usr/local/bin/sqlite3 {$db} \"SELECT ip FROM captiveportal WHERE ip='{$check_ip}'\"", $ip);
              	if ($check_ip == $ip[0]) {
              		exec("/usr/local/bin/sqlite3 {$db} \"SELECT username FROM captiveportal WHERE ip='{$check_ip}'\"", $user);
              		return $user[0];
              	}
              }
              
              ?>
              
              
              1 Reply Last reply Reply Quote 0
              • G
                Gertjan
                last edited by Jul 5, 2018, 8:06 AM

                Can't find /usr/local/bin/check_ip.php
                It's dealing with files related to the captive portal.

                Is this a file part of a package ?

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

                M 1 Reply Last reply Jul 5, 2018, 9:02 AM Reply Quote 0
                • M
                  magokbas @Gertjan
                  last edited by Jul 5, 2018, 9:02 AM

                  @gertjan With squid. What is your pfsense version?

                  1 Reply Last reply Reply Quote 0
                  • G
                    Gertjan
                    last edited by Jul 5, 2018, 9:33 AM

                    The latest :
                    2.4.3-RELEASE-p1 (amd64)
                    built on Thu May 10 15:02:52 CDT 2018
                    FreeBSD 11.1-RELEASE-p10

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

                    M 1 Reply Last reply Jul 5, 2018, 10:08 AM Reply Quote 0
                    • M
                      magokbas @Gertjan
                      last edited by Jul 5, 2018, 10:08 AM

                      @gertjan If you can not find this file, you do not have squid installed

                      G 1 Reply Last reply Jul 5, 2018, 12:24 PM Reply Quote 0
                      • G
                        Gertjan @magokbas
                        last edited by Jul 5, 2018, 12:24 PM

                        I know.
                        This thread talks about a Squid problem, not a captive portal problem.
                        See also what @jimp said ;)

                        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
                        • R
                          robertolw
                          last edited by Jul 5, 2018, 2:46 PM

                          @magokbas Thanks, it worked!

                          1 Reply Last reply Reply Quote 0
                          12 out of 12
                          • First post
                            12/12
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                            This community forum collects and processes your personal information.
                            consent.not_received