Project

General

Profile

Actions

Bug #12730

closed

RADIUS accounting does not work if WAN is down

Added by Viktor Gurov almost 3 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Captive Portal
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
2.5.2
Affected Architecture:

Description

captiveportal_send_server_accounting() always uses WAN IP address as NAS IP Address (because "!is_ipaddr($nasip)")

https://github.com/pfsense/pfsense/blob/master/src/etc/inc/captiveportal.inc#L2951-L2957:

    $nasip = $acctcfg['radius_nasip_attribute'];
    if (!is_ipaddr($nasip)) {
        $nasip = get_interface_ip($nasip);
        if (!is_ipaddr($nasip)) {
            $nasip = get_interface_ip();//We use WAN interface IP as fallback for NAS-IP-Address
        }
    }

same issue as #11109, and the same fix can be used.

https://github.com/pfsense/pfsense/blob/master/src/etc/inc/auth.inc#L1735-L1748:

        if (!is_ipaddr($nasip)) {
            $nasip = get_interface_ip($nasip);

            if (!is_ipaddr($nasip)) {
                /* use first interface with IP as fallback for NAS-IP-Address
                 * see https://redmine.pfsense.org/issues/11109 */
                foreach (get_configured_interface_list() as $if) {
                    $nasip = get_interface_ip($if);
                    if (is_ipaddr($nasip)) {
                        break;
                    }
                }
            }
        }


Related issues

Related to Bug #11109: WebGUI RADIUS authentication doesn't work if WAN is downResolvedViktor Gurov11/27/2020

Actions
Actions #2

Updated by Viktor Gurov almost 3 years ago

  • Related to Bug #11109: WebGUI RADIUS authentication doesn't work if WAN is down added
Actions #3

Updated by Marcos M almost 2 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF