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

    Pfsense 2.1 only one voucher database for all Multi instance Captive Portal

    Captive Portal
    3
    4
    1.7k
    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.
    • S
      saleh
      last edited by

      Hi,

      I have pfsense 2.1 install and enable "Captive Portal" in two interfaces, I need only one voucher database for the two interfaces. I mean the same voucher "EMb2stekUda3" work for Interface one and Interface two.

      Thanks

      Saleh

      1 Reply Last reply Reply Quote 0
      • E
        eri--
        last edited by

        Just put the interfaces in the same CP instance.

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

          Hi Ermal,

          Thanks for your reply. Is there any way to sync the voucher database between two instances.  Per Interface I have one AP connected to the Interface, via the multi CP instance, I need to know, how many users connected per AP.

          Best Regards,

          Saleh

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

            "per AP" is "per Interface" is "per zone", right ?

            I used this code (in a Munin plugin) to count all users on all zones, I guess it will be easy to adapt it a little bit for your needs:

            #!/usr/local/bin/php -q
            	require_once("/etc/inc/util.inc");
            	require_once("/etc/inc/functions.inc");
            	require_once("/etc/inc/captiveportal.inc");
            
            	/* read in captive portal db */
            	/* determine number of logged in users */
            
            	$count_cpusers = 0;
            	/* Is portal activated ? */
            	if (is_array($config['captiveportal'])) {
            		/* For every zone, do */
            		foreach ($config['captiveportal'] as $cpkey => $cp) {
            			$cpzone = $cpkey;
            			/* zone selected -> count users and add */
            			$count_cpusers += count(captiveportal_read_db());
            			}
            		}
            	echo $count_cpusers;
            ?>
            

            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
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.