PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) solution. Boasting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, powerful BYOD management options, 802.1X support, layer-2 isolation of problematic devices; PacketFence can be used to effectively secure networks small to very large heterogeneous networks.
Describe the bug
When sending a RADIUS disconnect request for a client authenticated via captive portal to a FortiGate device, the FortiGate answers with a Disconnect-NAK, the error message is like below:
This is because PacketFence does not send the framed ip address attribute in the request, but Fortinet requires it to.
To Reproduce
Steps to reproduce the behavior:
Select a node which is currently authenticated via captive-portal
Reevaluate the access
Review the audit log
See the error
Screenshots
Expected behavior
The PacketFence receives a Disconnect-ACK
Additional context
I fixed this issue locally by editing /usr/local/pf/lib/pf/Switch/Fortinet/FortiGate.pm:
#start of file with imports (ip4log must be included)
...
use pf::ip4log qw(mac2ip);
...
sub deauthenticateMacDefault {
my ( $self, $mac, $is_dot1x ) = @_;
my $logger = $self->logger;
if ( !$self->isProductionMode() ) {
$logger->info("not in production mode... we won't perform deauthentication");
return 1;
}
#Fetching the acct-session-id
my $dynauth = node_accounting_dynauth_attr($mac);
##This is new
#Fetching the ip address
my $ipAddress = pf::ip4log::mac2ip($mac);
$logger->debug("deauthenticate $mac using RADIUS Disconnect-Request deauth method");
##This was changed
return $self->radiusDisconnect(
$mac, { 'Acct-Session-Id' => $dynauth->{'acctsessionid'}, 'User-Name' => $dynauth->{'username'}, 'Framed-IP-Address' => $ipAddress },
);
}
This probably needs some polishing and also support for ipv6 but I guess it's a start.
@fdurand I've noticed that this issue is open since 2022 and I haven't received any feedback. The fix is already in my comment, so I suppose this should be quite an easy implementation for PacketFence 13.2. Thank you!
Describe the bug When sending a RADIUS disconnect request for a client authenticated via captive portal to a FortiGate device, the FortiGate answers with a Disconnect-NAK, the error message is like below:
This is because PacketFence does not send the framed ip address attribute in the request, but Fortinet requires it to.
To Reproduce Steps to reproduce the behavior:
Screenshots
Expected behavior The PacketFence receives a Disconnect-ACK
Additional context I fixed this issue locally by editing /usr/local/pf/lib/pf/Switch/Fortinet/FortiGate.pm:
This probably needs some polishing and also support for ipv6 but I guess it's a start.