• Solution to trigger email when user authenticates to Captive Portal

    3
    0 Votes
    3 Posts
    303 Views
    T
    @Gertjan - This is the solution! Thank you very much.
  • Captive Portal - Cron - Authentication issues

    10
    0 Votes
    10 Posts
    1k Views
    GertjanG
    @uggiz said in Captive Portal - Cron - Authentication issues: its possible to get a "Quota used" message when the users gets logged out? A browser getting a none solicited message from a web server with info ? Noop. Never seen that before. Browers can connect to web server, get the file (page) they are looking for, and bye bye the connection. It is possible to have a "logout" or "you are connected" browser windows open, and have that windows load some Jave stuff that questions the current status. if it was possible to get the "max allowed" and "current" bytes used .... but ..... See for yourself : #!/usr/local/bin/php -q <?php 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 for all zones */ $count_cpusers = 0; /* Is portal activated ? */ if (is_array($config['captiveportal'])) /* For every zone, do */ foreach ($config['captiveportal'] as $cpkey => $cp) /* Sanity check */ if (is_array($config['captiveportal'][$cpkey])) /* Is zone enabled ? */ if (array_key_exists('enable', $config['captiveportal'][$cpkey])) { $cpzone = $cpkey; /* Zone selected -> count users and add */ $cpdb = captiveportal_read_db(); foreach ($cpdb as $cpent) { print_r($cpent); echo date("m/d/Y H:i:s\n", $cpent[0]); echo "---------------\n"; } } ?> Create a file called /root/cap.php and put the above content in it. Now call it : php -q /root/cap.php and you see : no 'used' info is avaible in the pfSense portal session database. The max quota is : [traffic_quota] => 104857600 = 100 Mbytes in my test case = Ok. Ok ... you could, on the web server java side, get the max and used info from these files directly. Another info source is : [image: 1713961353494-32e69f3b-9c5f-4239-9d3d-417955ee1941-image.png] as the main log will be bombarded with these message (imho : they do not belong there - call me and I'll tell you how to ditch them). edit : Another way to have the user have page where you control the info : Have seat-belts ? Put them on. Read this close the initially irrelevant forum thread : captive portal is not working on mobiles But in that forum thread I discovered something : the future of the captive portal ( ! ) It already exist, and you add it easily. One condition : don't use KEA as your DHCP (portal ) server, you have to use ISC. because you have ti create a DHCP option for the HCP portal server. Instructions are present in the forum thread. You need to create one file (content of this file : see thread): [image: 1713962350669-26a4bd49-d5c9-43a8-9383-374fd662abfe-image.png] and now, if you have an Apple device, you can test : connect to the portal - and notice is connects faster - and when connected, tap on the SSID of the portal, and you'll see something new. Open the new suggestd link called "Portal" and the text "This network proposes a portal page". The page you now open - the "You are connected page" is the future "portal status page". Btw : I've also see (real) Samsung devices using this new RFC 8910. Others devices : dono ... Why I'm telling all this ? The page you saw is created here : /usr/local/captiveportal/index.php That where uyour changes go with the info you want to show - if the user wants to see it (and if they know how to request the info, because again, this is "portalling" as it will be done in the future ...) Btw : I've this method running for several month now. Works great. Doesn't interfere with the existing capture method at all, it completely bypasses it. The device will know where to go as soon as DHCP request has been answered. No more DNS hassle, web interception. Just plain KIS. Read the RFC and you'll get the picture. edit : sorry : I went way to far again / was ranting. Sorry.
  • Captive Portal & Proxy on 2.7.0

    9
    0 Votes
    9 Posts
    2k Views
    M
    I came to the conclusion that running a proxy filter is a pain in the a**. It did not work on Android, sometimes it did not work with iOS - at least Windows was the least pain as it seems to implement WPAD in an administrator-friendly way (we announced our proxy using DHCP). My solution: no Squid at all. I am now running two machines with Pi-Hole. The to-be-released version 6 supports allowlists so we can configure a "you cannot do anything per default" and allowing certain websites using our pre-defined lists. The other DNS filter runs the current stable release with a bunch of blocklists. You can also use pfBlocker-ng's DNSBL capabilities, but Pi-Holes web interface is so much faster and easier to work with (it get's even faster with v6). I am using pfBlocker-ng's IP blocking capatabilities :) Regards
  • CREATING 2 CAPTIVE PORTAL WITH SYNC VOUCHER ROLL

    Moved
    5
    0 Votes
    5 Posts
    461 Views
    R
    @Gertjan thank you for the info, gonna test it
  • 0 Votes
    1 Posts
    169 Views
    No one has replied
  • 0 Votes
    3 Posts
    861 Views
    P
    @Gertjan Thanks for your reply. Your pointer to /tmp/rules.debug was a good hint for me. I found the relevant scripts as well. I will first have to learn about pf and will then decide if I want to continue efforts to adjust the scripts. It's just weird that there is no documentation. Even the scripts are very sparsely commented.
  • Creazione pagina di auto registrazione utenti su captive portal

    1
    0 Votes
    1 Posts
    258 Views
    No one has replied
  • Need pfSense captive portal tutorial—not sure, where to put HTML code

    4
    0 Votes
    4 Posts
    1k Views
    GertjanG
    @DominikHoffmann said in Need pfSense captive portal tutorial—not sure, where to put HTML code: The key for me was to check “Enable to use a custom captive portal login page.” Without that, I could not get a captive portal to appear. This : [image: 1711204901822-06b9ae74-b82e-4b53-b203-dcc6627e0783-image.png] option doesn't have to be check. If it isn't, the default login, build-in, page will be sued.
  • Configuration of captive portal and Router for use

    8
    0 Votes
    8 Posts
    1k Views
    GertjanG
    @Fidelinho88 ? The first IP of a network is 'normally' the IP of the pfSense LAN = 192.168.0.1 The next IP could be 192.168.0.2 and that will be your "AP" (look again previous posts). Btw : my opinion, but have the AP use a static IP setup, not DHCP. @Fidelinho88 said in Configuration of captive portal and Router for use: It has been shown as offline ... Offline means here : not in the pfSEnse arp cache. See here : Diagnostics > ARP Table You can - should be able - to ping the 192.168.0.1, your AP, so it is online. And as soon as you ping it from pfSense, pfSnse will have it in it's arp cache for several seconds, and by magic now it shows online. To be offline again afterwards .... or, the AP is still there, up and running.
  • Management for Vouchers

    10
    0 Votes
    10 Posts
    1k Views
    GertjanG
    @skveen said in Management for Vouchers: Yes, but I don’t want to use psk What is psk ? @skveen said in Management for Vouchers: It is a good idea to use one Voucher per day or per table Look in the future. For some reason, you've decide to use a version that is severally depreciated : @skveen said in Management for Vouchers: In the end I chose the version pfSense-CE-2.7.0-RELEASE With the now declared "zero day OpenSSL ready" version 1 ? You've missed : Netgate Will Migrate to OpenSSL 3 in pfSense Plus Software Version 23.09 to name just one. Euh ... ok. Good luck. Normally, a firewall is about security. "Confort" shouldn't come first.
  • Duplicate Captive Portal Sessions after Upgrade from 23.05 to 23.09.1

    5
    0 Votes
    5 Posts
    585 Views
    N
    @Gertjan Thank you for all of the info regarding the captive portal. The APs in the facility don't support LDAP authentication, hence the use of the captive portal. They do support Radius, but I don't have a Radius server running/integrated with AD at this time, so the captive portal was a quick way to get something working with LDAP. Management doesn't want all employees to have access to the WiFi, and since the password on the WiFi can be easily shared and is cumbersome to change, the captive portal is the current solution. We do use MAC address access control for company devices, but not for personal devices of employees who are authorized to use the WiFi. I'll probably look into adding a Radius server so we can just perform the authentication at the AP level instead of the captive portal.
  • Captive portal allows communication between guests

    15
    0 Votes
    15 Posts
    1k Views
    M
    @robsonvitorm You dont need to obfuscate private addresses (RFC1918) or mac addresses generally. If you don't see packets leaving then you have a problem on the host level. Either your network stack on the host is corrupted or you got something else going on.
  • 0 Votes
    4 Posts
    576 Views
    GertjanG
    @getcom said in captive portal: nginx 504 GW timeout & 'dnctl: need a pipe/flowset/sched number' => MAC addr cleanup job needed: https://github.com/pfsense/pfsense/commit/8bfe17dae7ab15b7af802f69dbb7c421d098d38c Looks like that related. It's an easy edit, go ahead ! @getcom said in captive portal: nginx 504 GW timeout & 'dnctl: need a pipe/flowset/sched number' => MAC addr cleanup job needed: You said "Easy to rebuild as "if voucher is expired, then ditch the auto added MAC"". Should we implement that and commit a fix? The easiest solution would be : don't "auto add", as this is only a comfort option for your portal users. On the long run not for you ! They, the portal users, log in once using the voucher code, and from then on they stay logged in forever. Its up to you to remove the 'old' macs manually. Seems tedious to me. Is there a comment add to the auto added MAC entry ? If so, and it contains the voucher ID, it's easy to parse over all the mac entries, isolate the voucher code, test for validity (still time left) and if not, delete the mac entry all together (does doing a auto clean up ^^). I'm not using vouchers at all on my portal, but I'll have some spare time next week, and I'll see what I can come up with.
  • Captive portal 2.7.2 edit Slow

    2
    0 Votes
    2 Posts
    400 Views
    getcomG
    @gsrinivsn Got the same behavior and ran into similar problems: https://forum.netgate.com/post/1157259 This problem is from my perspective unrelated to the firmware version. If I`m not mistaken, it can happen after backup restore or reboot. The reason for this are described in the linked thread: tons of MAC addresses in the config file & DBs.
  • G - Suite Authentication

    1
    0 Votes
    1 Posts
    319 Views
    No one has replied
  • G suite LDAP

    1
    0 Votes
    1 Posts
    387 Views
    No one has replied
  • need a pipe/flowset/sched number error

    4
    0 Votes
    4 Posts
    607 Views
    GertjanG
    That's why I couldn't find the message. It's part of the ipfw sub system. @rennai said in need a pipe/flowset/sched number error: But I wondering why Stop wondering. It has been solved in 2.7.0 and 2.7.2.
  • 0 Votes
    3 Posts
    1k Views
    R
    @Gertjan Hello Gertjan. it's just anonymizing the Mac Addresses. Looks like it may be related to pass-through MACs when "noconcurrentlogins" is set along with per-user limits. "I disabled the 'Pass-through MAC Auto Entry' on the Captive Portal, and the error messages have stopped. However, now, to avoid these messages, I need to add these entries manually. It seems like a bug. Anyway, it's exhibiting some unusual behavior.
  • Your maximum never usage time has bee reached.

    9
    0 Votes
    9 Posts
    1k Views
    R
    Thank you all for your answers to this issue. Truly more heads are better than one :)
  • Captive portal slow down connection troughput

    4
    0 Votes
    4 Posts
    631 Views
    GertjanG
    @pfsenseISIP said in Captive portal slow down connection troughput: there are no firewall rules No rules on an interface means : no traffic enters that interface. Example : [image: 1708930987182-8dc5480d-c651-47ec-be79-1035f61500c3-image.png] @pfsenseISIP said in Captive portal slow down connection troughput: via freeradius installed And the basic, vanilla, just one "Portal on a OPT1", like shown on the official Netgate (Youtube channel) video's, that works ? @pfsenseISIP said in Captive portal slow down connection troughput: and the CP is on both So you have two portal instances ? Normally, LAN us for trusted devices, like the one you use for adming pfSense. All non trusted devices should belong on other interfaces, like OPT1 (portal 1), OPT2 (portal 2) etc. True, a captive portal can work on LAN ...
Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.