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

    Captive Portal RADIUS NAS IP Attribute not being set properly

    Scheduled Pinned Locked Moved 2.3-RC Snapshot Feedback and Issues - ARCHIVED
    3 Posts 2 Posters 1.4k 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.
    • T
      twilley
      last edited by

      I'm running the latest snapshot as of this posting (2.3.b.20160302.0533) and have run a gitsync as well.

      No matter what is selected in the RADIUS NAS IP Attribute field (configured on page https://pfsense.localdomain/services_captiveportal.php?zone=cpzone, where cpzone is an existing zone in the captive portal), the RADIUS server receives the requests with a NAS IP of 0.0.0.0. Looking at the file /usr/local/www/services_captiveportal.php and running some developer shell commands revealed to me that the radiussrcip_attribute, which contains the name of the interface (e.g., LAN) gets stored in /conf/config.xml in uppercase when it should be lowercase.

      The captiveportal code needs to either write the interface name to the configuration file in lowercase (e.g., lan instead of LAN), or it needs lowercase it when read from the configuration file.

      I wrote a quick patch, which runs the post data through strtolower() when writing to the configuration. This may or may not be the right fix for it though:

      
      --- /usr/local/www/services_captiveportal.php	2016-02-15 03:09:32.000000000 +0000
      +++ /usr/local/www/services_captiveportal.php	2016-02-15 03:09:32.000000000 +0000
      @@ -457,7 +457,7 @@
       		$newcp['radiuskey4'] = $_POST['radiuskey4'];
       		$newcp['radiusvendor'] = $_POST['radiusvendor'] ? $_POST['radiusvendor'] : false;
       		$newcp['radiussession_timeout'] = $_POST['radiussession_timeout'] ? true : false;
      -		$newcp['radiussrcip_attribute'] = $_POST['radiussrcip_attribute'];
      +		$newcp['radiussrcip_attribute'] = strtolower($_POST['radiussrcip_attribute']);
       		$newcp['passthrumacadd'] = $_POST['passthrumacadd'] ? true : false;
       		$newcp['passthrumacaddusername'] = $_POST['passthrumacaddusername'] ? true : false;
       		$newcp['radmac_format'] = $_POST['radmac_format'] ? $_POST['radmac_format'] : false;
      
      
      1 Reply Last reply Reply Quote 0
      • C
        cmb
        last edited by

        Thanks, fixed.
        https://redmine.pfsense.org/issues/5946

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

          Looks good. Thanks!

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