PacketFence Installation Guide
PacketFence Installation Guide
PacketFence v13.1.0
Version 13.1.0 - January 2024
Table of Contents
Permission is granted to copy, distribute and/or modify this document under the terms of the
GNU Free Documentation License, Version 1.2 or any later version published by the Free
Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".
The fonts used in this guide are licensed under the SIL Open Font License, Version 1.1. This
license is available with a FAQ at: http://scripts.sil.org/OFL
This guide will walk you through PacketFence installation and day-to-day administration.
Developer’s Guide
Covers API, captive portal customization, application code customizations and instructions for
supporting new equipment.
Upgrade Guide
Covers compatibility related changes, manual instructions and general notes about upgrading.
PacketFence News
Covers noteworthy features, improvements and bug fixes by release.
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC)
system. Boosting an impressive feature set including a captive portal for registration and
remediation, centralized wired and wireless management, 802.1X support, layer-2 isolation of
problematic devices, integration with IDS, vulnerability scanners and firewalls; PacketFence can
be used to effectively secure networks - from small to very large heterogeneous networks. For a
more detailed presentation on PacketFence please visit https://packetfence.org.
3.1. Assumptions
PacketFence reuses many components in an infrastructure. Nonetheless, it will install the
following ones and manage them itself:
In this guide, we assume that all those components are running on the same server (i.e.,
"localhost" or "127.0.0.1") that PacketFence will be installed on.
3.2.1. Recommendations
• Use logical volume management (LVM) to allocate space
Make sure that you can install additional packages from your standard distribution. For example, if
you are using Red Hat Enterprise Linux, you have to be subscribed to the Red Hat Network
before continuing with the PacketFence software installation.
This section will guide you through the installation of PacketFence from the Zero Effort NAC
(ZEN) appliance and from the standard repository of packages we provide - which can be used to
install PacketFence on top of a vanilla GNU/Linux installation.
You will need a virtual machine or server with 16 GB of RAM dedicated to machine as well as 4
CPUs. Make sure you allocate at least 200GB of disk space for PacketFence.
These repositories contain all required dependencies to install PacketFence. This provides
numerous advantages. Among them, there are:
• easy installation
• everything is packaged as RPM and Debian packages
• easy upgrade
First install your supported distribution with minimal installation and no additional packages.
Then:
• Disable firewall
• Disable SELinux
On Debian
Make sure your system is up to date and your yum or apt-get database is updated. On a RHEL-
based system, do:
yum update
apt-get update
apt-get upgrade
Regarding SELinux or AppArmor, even if they may be wanted by some organizations, PacketFence
will not work properly if SELinux or AppArmor are enabled. You will need to explicitly disable
SELinux from the /etc/selinux/config file and reboot the machine. For AppArmor, you need to
follow instructions on Debian wiki.
Regarding resolvconf, you can remove the symlink to that file and simply create the
/etc/resolv.conf file with the content you want.
Make sure you are actually running the latest kernel prior to installing the kernel
NOTE
development package. Reboot prior to installing this package if unsure.
RHEL 8.x
On RHEL 8.x systems, as a preliminary step, you need to run: rpm --import
NOTE http://inverse.ca/downloads/GPG_PUBLIC_KEY before installing packetfence-
release package.
yum localinstall
http://packetfence.org/downloads/PacketFence/RHEL8/packetfence-release-
13.1.el8.noarch.rpm
Once the repository is defined, you can install PacketFence with all its dependencies, and the
required external services (database server, DHCP server, RADIUS server) using:
Debian-based systems
Once the repository is defined, you can install PacketFence with all its dependencies, and the
required external services (Database server, DHCP server, RADIUS server) using:
This section will guide you through configuring PacketFence as a simple RADIUS server.
PacketFence will provide 802.1X support through Microsoft Active Directory and a Cisco 2960
access switch will be configured to integrate with PacketFence. The 802.1X client will be a
Microsoft Windows 7 computer, connected of course on the wired network in the Cisco 2960
access switch. The following architecture diagram shows the interconnection of all components
for our example:
If you use another access switch, you must refer to PacketFence Network Devices
NOTE
Configuration Guide to adapt your configuration.
• Step 1 - Configure Network - make sure you define only one interface with the
"Management" type. That network interface will be the one to which the Cisco 2960 access
switch will talk to. The management interface of PacketFence and the Cisco 2960 should
normally be in the same network. To set the interface to the "Management" type, click on the
Once all services are started, you will automatically be redirected to the PacketFence’s web admin
interface. It is located at https://@ip_of_packetfence:1443/. Open that link and log in using the
username/password specified in Step 2.
Once the domain join succeeds, click on the REALMS tab. Click on the Default realm and set the
domain to the Active Directory domain you have just created. That will instruct PacketFence to
use that newly created Active Directory for the default authentication realm. Next, do the same
thing for the 'NULL' realm.
Next, we add the Microsoft Active Directory domain controller as an authentication source in
PacketFence. To do so, from Configuration → Policies and Access Control → Authentication Sources,
click on New internal source → AD. Specify all the required fields. If you need help identifying
fields relevant to your Active Directory environment, please use the Active Directory Explorer
(AD Explorer) or AdsiEdit.mmc tools from your Active Directory server.
In this new 'Authentication Source', add an 'Authentication Rules' with name 'catchall' with no
condition and with the following actions:
• Role - default
• Access duration - 5 days
Make sure the information you provided are valid. Click on the Test button to validate the
provided information. If you see the message 'Success! LDAP connect, bind and search
successful' - you have properly configured your Microsoft Active Directory authentication source.
Save your new authentication source by clicking on the Save button.
dot1x system-auth-control
aaa new-model
aaa group server radius packetfence
server PF_MANAGEMENT_IP auth-port 1812 acct-port 1813
aaa authentication login default local
aaa authentication dot1x default group packetfence
aaa authorization network default group packetfence
radius-server host PF_MANAGEMENT_IP auth-port 1812 acct-port 1813 timeout 2 key
useStrongerSecret
radius-server vsa send authentication
snmp-server community public RO
snmp-server community private RW
From the 'RADIUS' tab, specify the 'Secret Passphrase' to use - in our example, it is
'useStrongerSecret'. It is very important to correctly set the RADIUS secret passphrase otherwise
PacketFence will prevent the switch from communicating to itself.
Finally, from the 'SNMP' tab, provide the correct 'Community Read' and 'Community Write'
values.
From Configuration → Policies and Access Control → Connection Profiles, click on on New
Connection Profile. Specify the following information:
5.7. Testing
Now, we are ready to do some testing. First make sure you restart the 'radiusd' service. That is
required since we added a new Active Directory domain controller. From Status → Services, click
on the Restart button for the 'radiusd' service. PacketFence will take care of restarting that
service and the 'radiusd-acct' and 'radiusd-auth' sub-services.
Connect the Microsoft Windows 7 endpoint on port no. 10 from the Cisco Catalyst 2960 switch.
From Microsoft Windows, a popup should appear prompting you for a username and password.
Enter a valid username and password from your Microsoft Active Directory domain - this should
trigger 802.1X (EAP-PEAP) authentication.
To see what’s going on from PacketFence, click on the Auditing tab from PacketFence’s admin
interface. You should see an entry for the MAC address of your Microsoft Windows 7 endpoint.
Click on the line with the right MAC address to see the RADIUS exchanges. If the 802.1X
authentication is successful, you should have 'Accept' as an 'Auth Status'.
5.8. Alerting
PacketFence can send emails to administrators, users and guests. So, it is important to properly
configure the mail sending functionality of PacketFence. From Configuration → System
Configuration → Alerting, set at least the following fields:
If your SMTP server requires authentication or encryption to relay emails, you will have to
properly configure the SMTP encryption, username and password parameters.
In the previous section, we have succesfully configured 802.1X using PacketFence, Microsoft
Active Directory and a Cisco Catalyst 2960 switch. While this demonstrates the fundamental role
and capabilities of a NAC solution, most organizations are also looking at providing access to
guests for example. One way of handling guests on a network is showing them a captive portal
and let them register their own devices. This section will guide you in achieving this with
PacketFence.
There are two ways PacketFence can show its captive portal for unknown (or unregistered)
devices:
• it can use Web Authentication (or also known as hotspot-style authentication) - this works
with numerous equipment vendors
• it can use a registration VLAN, where PacketFence provides DHCP services and DNS black-
holing services - this works with any equipment vendors that support RADIUS dynamic VLAN
assignment
For our example, we will use Web Authentication, as it is supported by the Cisco Catalyst 2960.
For more information on various enforcement modes, please refer to the 'Supported Enforcement
Modes' sections of this document.
• Role - guest
• Access duration - 12 hours
First, we need to enable Change-of-Authorization (CoA) in our Cisco Catalyst 2960 switch
configuration. We essentially need to allow our PacketFence server (172.20.100.2) to send CoA
requests to the switch:
Then, we must enable Web Authentication on switch port no. 10. Add the following
configuration to the global section:
ip device tracking
ip http server
ip http secure-server
• in Role by VLAN ID, set the registration and guest VLAN ID to 20 - this will ensure
unregistered clients are initially put in VLAN 20 and avoid a VLAN change once they properly
authenticate from the captive portal
• make sure 'Role by Switch Role' is checked and set the registration role to 'registration' - this
will ensure the registration access list created in the previous section is returned for
unregistered users. This will limit their access to the PacketFence captive portal
• make sure 'Role by Web Auth URL' is checked and set the 'registration' URL to
'http://172.20.100.2/Cisco::Catalyst_2960'
You must then restart the following services from Status → Services:
• haproxy-portal
• httpd.portal
• iptables
6.6. Testing
First make sure that the Microsoft Windows 7 endpoint is unplugged from the Cisco Catalyst
2960 switch. Then, make sure the endpoint is unregistered from PacketFence. To do this, from
the Nodes configuration module, locate its MAC address and click on it. From the node property
window, change the 'Status' to 'unregistered'.
Next, we need to disable 802.1X from the network configuration card from the Microsoft
Windows 7 endpoint. We want to simulate here an authentication by MAC address, so we have
to disable 802.1X to do this. From Windows' Network Connection connection panel, ask for the
properties of the LAN interface you will use for testing. From the authentication tab, make sure
'Enable IEEE 802.1X authentication' is unchecked. Save all changes.
Next, connect the endpoint in the Cisco Catalyst 2960 switch. After a few second, open a web
browser and try to open any website - say http://packetfence.org. You should now see the
captive portal. You should only need to accept the terms and conditions for gaining network
access.
PacketFence can authenticate users that register devices via the captive portal using various
methods. Among the supported methods, there are:
• Active Directory
• Apache htpasswd file
• BlackHole
• Email
• External HTTP API
• Clickatell
• Facebook (OAuth 2)
• Github (OAuth 2)
• Google (OAuth 2)
• Kerberos
• Kickbox
• LDAP
• LinkedIn (OAuth 2)
• Null
• OpenID Connect (OAuth 2)
• RADIUS
• SMS
• Sponsored Email
• Twilio
• Windows Live (OAuth 2)
• Password of the day
and many others. Moreover, PacketFence can also authenticate users defined in its own internal
SQL database. Authentication sources can be created from PacketFence administrative GUI -
from the Configuration → Policies and Access Control → Authentication Sources section.
Authentication sources, rules, conditions and actions are stored in the
/usr/local/pf/conf/authentication.conf configuration file.
Each authentication sources you define will have a set of rules, conditions and actions.
Multiple authentication sources can be defined, and will be tested in the order specified (note
that they can be reordered from the GUI by dragging them around). Each source can have
multiple rules, which will also be tested in the order specified. Rules can also be reordered, just
like sources. Finally, conditions can be defined for a rule to match certain criteria. If the criteria
match (one or more), actions are then applied and rules testing stop, across all sources as this is a
"first match wins" operation.
In the previous section, you configured two authentication sources: Microsoft Active Directory
and the Null sources. They were both catch-all sources.
Then add an 'Authentication Rules' with name 'catchall' with no condition and with the following
two 'Actions':
• Role - guest
• Access duration - 12 hours
You can preview at any time the portal associated with connection profile by
NOTE
clicking on the Preview button near the Connexion’s title.
• Authentication sources
From Configuration → Policies and Access Control → Authentication Sources, click New external
source → SMS. As 'Name' and 'Description', specify 'sms-source'. Then add an 'Authentication
Rules' with name 'catchall' with no condition and with the following two 'Actions':
• Role - guest
• Access duration - 12 hours
You will also need to select the proper carriers to do your test. Make sure you include the one
your are using for your cellular phone.
Clickatell Source
To use Clickatell as an SMS source, first register at https://www.clickatell.com to get an API Key
for the SMS integration. Then add it as an authentication source the same way as above, except
choosing 'Clickatell' instead of 'SMS' in 'Add source → External'. Enter a name, description and
your Clickatell API key in the source configuration, then add the authentication rule.
You can preview at any time the portal associated with connection profile by
NOTE
clicking on the Preview button near the Connexion’s title.
One important key concept from NAC solutions is for seggretating network accesses. For
example, an employee from the finance department might not have the same network access
level as an other employee from the marketing department. Guests should also not have the
same access level as normal employees within an organization. PacketFence uses roles internally
to identify and differentiate users. For seggretating network access, PacketFence can use one or
all of the following techniques:
• ACL
• VLAN or VLAN pool
• equipment role
The techniques to use depends on the wired/WiFi equipment itself. A role in PacketFence will be
eventually mapped to a VLAN, an ACL or an external role. You must define the roles to use in
your organization for network access.
In our previous configuration examples, we made use of two roles that come by default in
PacketFence: default and guest. We will now add two new roles - one for consultants and one
used to authenticate machines on the network.
Roles are dynamically computed by PacketFence, based on the rules (ie., a set of conditions and
actions) from authentication sources, using a first-match wins algorithm. Roles are then matched
to VLAN or VLAN pool or internal roles or ACL on equipment from the Configuration → Policies
and Access Control → Switches module. For a VLAN pool instead of defining a VLAN identifier,
you can set a value like that: 20..23,27..30 - which means that the VLAN returned by
PacketFence can be 20 to 23 and 27 to 30 (inclusively). There are three algorithms: one based on
a hash of the username (default one), another one based on a round-robin (last registered device
+1) and one that selects a VLAN randomly in the pool.
Configuration → Policies and Access Control → Roles, click on New Role. Provide the following
information:
• Name: employee
• Description: Role used for employees
• Max nodes per user: 2
• Name: corporate_machine
• Description: Corporate owned machines
Let’s say we have two roles: employee and corporate_machine (defined above).
Now, we want to assign roles to employees and their corporate machines using Active Directory
(over LDAP), both using PacketFence’s captive portal.
• Name: ad1
• Description: Active Directory for Employees
• Host: 192.168.1.2:389 without SSL/TLS
• Base DN: CN=Users,DC=acme,DC=local
• Scope: subtree
• Username Attribute: sAMAccountName
• Bind DN: CN=Administrator,CN=Users,DC=acme,DC=local
• Password: acme123
Then, we add an Authentication rules by clicking on the Add rule button and provide the
following information:
• Name: employees
• Description: Rule for all employees
• Don’t set any condition (as it’s a catch-all rule)
• Set the following actions:
• Role - employee
• Access duration - 7 days
Test the connection and save everything. Using the newly defined source, any username that
actually matches in the source (using the sAMAccountName) will have the employee role and a 7
days Access Duration.
• Name: ad2
• Description: Active Directory for Corporate Machines
• Host: 192.168.1.2:389 without SSL/TLS
• Base DN: CN=Computers,DC=acme,DC=local
• Scope: One-level
• Username Attribute: servicePrincipalName
• Name: machines
• Description: Rule for corporate machines
• Don’t set any condition (as it’s a catch-all rule)
• Set the following actions:
• Role - corporate_machine
• Access duration - 7 days
Using this configuration, employees can only connect corporate machines, not personal devices.
If you want to use other LDAP attributes in your authentication source, add them
NOTE in Configuration → System Configuration → Main Configuration → Advanced →
Custom LDAP attributes. They will then be available in the rules you define.
Prior configuring PacketFence, you must chose an appropriate enforcement mode to be used by
PacketFence with your networking equipment. The enforcement mode is the technique used to
enforce registration and any subsequent access of devices on your network. PacketFence
supports the following enforcement modes:
• Inline
• Out-of-band using SNMP or RADIUS
• Hostpot-style (or Web Auth)
• RADIUS only
• DNS
It is also possible to combine enforcement modes. For example, you could use the out-of-band
mode on your wired switches, while using the inline mode on your old WiFi access points.
The following sections will explain these enforcement modes. It will also explain how to properly
configure PacketFence to use each enforcement mode.
This is why it is considered a poor man’s way of doing access control. We have avoided it for a
long time because of the above mentioned limitations. That said, being able to perform both
inline and VLAN enforcement on the same server at the same time is a real advantage: it allows
admins to maintain maximum security while they deploy new and more capable network
hardware providing a clean migration path to VLAN enforcement.
VLAN assignment effectively isolate your hosts at the OSI Layer2 meaning that it is the trickiest
method to bypass and is the one which adapts best to your environment since it glues into your
current VLAN assignment methodology.
The supplicant (i.e., client device) is not allowed access through the authenticator to the network
until the supplicant’s identity is authorized. With 802.1X port-based authentication, the
supplicant provides credentials, such as user name / password or digital certificate, to the
authenticator, and the authenticator forwards the credentials to the authentication server for
verification. If the credentials are valid (in the authentication server database), the supplicant
(client device) is allowed to access the network. The protocol for authentication is called
Extensible Authentication Protocol (EAP) which have many variants. Both supplicant and
authentication servers need to speak the same EAP protocol. Most popular EAP variant is PEAP-
In this context, PacketFence runs the authentication server (a FreeRADIUS instance) and will
return the appropriate VLAN to the switch. A module that integrates in FreeRADIUS does a
remote call to the PacketFence server to obtain that information. More and more devices have
802.1X supplicant which makes this approach more and more popular.
MAC Authentication is a new mechanism introduced by some switch vendor to handle the cases
where a 802.1X supplicant does not exist. Different vendors have different names for it. Cisco
calls it MAC Authentication Bypass (MAB), Juniper calls it MAC RADIUS, Extreme Networks calls
it Netlogin, etc. After a timeout period, the switch will stop trying to perform 802.1X and will
fallback to MAC Authentication. It has the advantage of using the same approach as 802.1X
except that the MAC address is sent instead of the user name and there is no end-to-end EAP
conversation (no strong authentication). Using MAC Authentication, devices like network printer
or non-802.1X capable IP Phones can still gain access to the network and the right VLAN.
Wireless 802.1X works like wired 802.1X and MAC authentication is the same as wired MAC
Authentication. Where things change is that the 802.1X is used to setup the security keys for
encrypted communication (WPA2-Enterprise) while MAC authentication is only used to authorize
(allow or disallow) a MAC on the wireless network.
On wireless networks, the usual PacketFence setup dictate that you configure two SSIDs: an
open one and a secure one. The open one is used to help users configure the secure one
properly and requires authentication over the captive portal (which runs in HTTPS).
The following diagram demonstrates the flow between a mobile endpoint, a WiFi access point, a
WiFi controller and PacketFence:
Web authentication is a method on the switch that forwards HTTP traffic of the device to the
captive portal. With this mode, your device will never change of VLAN ID but only the ACL
associated to your device will change. Refer to the Network Devices Configuration Guide to see a
sample web auth configuration on a Cisco WLC.
Downloadable ACLs
Downloadable ACLs is a method that can be used when the ACL list is greater than the size of a
RADIUS access-accept paquet. Some vendor support it, like Cisco Switches (IOS 15.2) and Dell
(n1500 fw 6.8)
The RADIUS flow is something close to the normal one but in the Access-Accept reply there is an
extra RADIUS attribute that tell the equipment to trigger another RADIUS request to retreive the
ACL.
A second RADIUS request is made with the ACL name as a value of the username and multiples
Access-Challenge are made in order to retreive the complete ACL.
To enable it you need first to enable the RADIUS filter in the PacketFence authorize section. To
do that go in Configuration → System Configuration → RADIUS → General and enable "Use
RADIUS filters in packetfence authorize" then restart the radiusd-auth service.
Push ACLs
Push ACLs is a method to write directly the ACLs on the equipment if compatible (needs ssh
credentials and admin privileges on the switch). In this senario if the PushACLs is enable on the
switch then PacketFence will take the ACL defined in each role configuration (Policies and Access
Control → Roles, and ACL in Cisco format), format it to be compatible with the equipment and
will use ansible to push them on the switch (User role will create a User ACL on the equipment).
Once this ACL is define on the switch, the RADIUS reply will contain an attribute that tell the
switch to apply this ACL on the session. Per example in the case of Cisco, the attribute used is
Filter-ID = User
Role per Switch role needs to be enable and PacketFence will return the role name and not the
role value.
Dynamic/Downloadable ACLs can be combined with Push ACLs but in certain conditions. If an
ACL is defined in the role in the switch configuration then this one will take precedence on the
Push ACL. If the ACL in the role configuration is empty but you have an ACL defined in the role
config then PacketFence will only return the attribute to assign the ACL (no RADIUS reply
containing the ACL).
Here an example of what happen when you have a Cisco WLC where you enabled PushACLs and
you defined the ACL as following:
Relies on the port-security SNMP Traps. A fake static MAC address is assigned to all the ports
this way any MAC address will generate a security violation and a trap will be sent to
PacketFence. The system will authorize the MAC and set the port in the right VLAN. VoIP
support is possible but tricky. It varies a lot depending on the switch vendor. Cisco is well
supported but isolation of a PC behind an IP Phone leads to an interesting dilemma: either you
shut the port (and the phone at the same time) or you change the data VLAN but the PC doesn’t
do DHCP (didn’t detect link was down) so it cannot reach the captive portal.
Aside from the VoIP isolation dilemma, it is the technique that has proven to be reliable and that
has the most switch vendor support.
You need to create a registration VLAN (with a DHCP server, but no routing to other VLANs) in
which PacketFence will put unregistered devices. If you want to isolate computers which have
open security event in a separate VLAN, an isolation VLAN needs also to be created.
When a host connects to a switch port, the switch sends a linkUp trap to PacketFence. Since it
takes some time before the switch learns the MAC address of the newly connected device,
PacketFence immediately puts the port in the Registration VLAN in which the device will send
DHCP requests in order for the switch to learn its MAC address. Then pfqueue will send
periodical SNMP queries to the switch until the switch learns the MAC of the device. When the
MAC address is known, pfqueue checks its status (existing ? registered ? any security event?) in
the database and puts the port in the appropriate VLAN. When a device is unplugged, the switch
sends a 'linkDown' trap to PacketFence which puts the port into the Registration VLAN.
If your switches support MAC notification traps (MAC learned, MAC removed), we suggest that
you activate them in addition to the linkUp/linkDown traps. This way, pfqueue does not need,
after a linkUp trap, to query the switch continuously until the MAC has finally been learned.
When it receives a linkUp trap for a port on which MAC notification traps are also enabled, it only
needs to put the port in the Registration VLAN and can then free the process. When the switch
learns the MAC address of the device it sends a MAC learned trap (containing the MAC address)
to PacketFence.
In its most basic form, the Port Security feature remembers the MAC address connected to the
switch port and allows only that MAC address to communicate on that port. If any other MAC
address tries to communicate through the port, port security will not allow it and send a port-
security trap.
If your switches support this feature, we strongly recommend to use it rather than
linkUp/linkDown and/or MAC notifications. Why? Because as long as a MAC address is
authorized on a port and is the only one connected, the switch will send no trap whether the
device reboots, plugs in or unplugs. This drastically reduces the SNMP interactions between the
switches and PacketFence.
When you enable port security traps you should not enable linkUp/linkDown nor MAC
notification traps.
SSID::GuestAccess,MAC::00:11:22:33:44:55
This will trigger all the nodes that connects to the GuestAccess SSID to use inline enforcement
mode (PacketFence will return a void VLAN or the inlineVlan if defined in switch configuration)
and the MAC address 00:11:22:33:44:55 client if it connects on another SSID.
Using RADIUS enforcement, everytime a device connects to the network, a matching production
VLAN will be assigned, depending on the rules in Configuration → Policies and Access Control →
Authentication Sources.
This enforcement mode used by itself can be bypassed by the device by using a different DNS
server or by using its own DNS cache.
After, you need to configure a routed network for this interface by clicking New routed network.
See the 'Routed Networks' section of this document for details on how to configure it.
If you are not using a routed network, you need to use Inline enforcement as DNS
NOTE
enforcement can only be used for routed networks.
Once this is done, you need to restart the pfdhcp and pfdns services.
10.1. Introduction
The inline enforcement is a very convenient method for performing access control on older
network equipment that is not capable of doing VLAN enforcement or that is not supported by
PacketFence.
Inline enforcement uses ipset to mark nodes as registered, unregistered and isolated. It is also
now possible to use multiple inline interfaces. A node registered on the first inline interface is
marked with an IP:MAC tuple (for L2, only ip for L3), so when the node tries to register on an
other inline interface, PacketFence detects that the node is already registered on the first inline
network. It is also possible to enable inline.should_reauth_on_vlan_change to force users to
reauthenticate when they change inline network - you can change this from
'Configuration→Network Configuration→Inline' - by checking or not the 'Reauthenticate node'
checkbox.
By default the inline traffic is forwarded through the management network interface but it is
possible to specify another one by adding in pf.conf the option interfaceSNAT in inline section
of the pf.conf configuration file. Alternatively, you can change this from
'Configuration→Network Configuration→Inline' in the 'SNAT Interface' section. It is a comma
delimited list of network interfaces like eth0,eth1.2. It’s also possible to specify a network that
will be routed instead of using NAT by adding in conf/networks.conf an option nat=no under
one or more network sections (take care of the routing table of the PacketFence server).
• 2 network interfaces for the VM (1 for the Inline and another one to go out)
• a switch port in the management network for the PacketFence server
• a switch port in the inline network for the PacketFence server which needs to be configured
in access mode and in the same access VLAN as every switchport on which devices will be
connected
The first step is to add a dedicated Network Interface Card (NIC) to your current PacketFence
installation. In our example, our new NIC will be named ens192. The PacketFence web interface
will list all currently installed network interfaces on the system. An IP and a netmask will be visible
if the network interface is configured (either by DHCP or already manually configured). You can
edit those ones, create/delete VLANs on physical interfaces and enable/disable interfaces. Note
that these changes are effective immediately. Persistence will be written only for enabled
interfaces. Which means that if you change your management IP address, to pursue the
configurator, you will need to go on this new IP address you just set. At all time, you will need to
set a Management interface. That means that the required interface types for inline enforcement
are:
Management
Inline layer 2
Note that PacketFence will provide these services on its inline interface:
• PacketFence provides its own DHCP service. It will take care of IP address distribution in our
Inline network. PacketFence will not provide DHCP services on the management network -
this is the responsibility of your own infrastructure.
• PacketFence provides its own DNS service. However, for the inline mode, you will also need
to provide access to the DNS server of your infrastructure.
IP Address: 192.168.2.1
Netmask: 255.255.255.0
Type: Inline Layer 2
Additionnal listening daemon(s): portal
DNS Servers: 10.0.0.10
Once done, your PacketFence server should have the following network layout:
You should be in mode '#conf-t' if not execute 'configuration terminal' in your CLI.
Now you can connect any devices that you want to be in the inline network in any of the port
you have just configured.
• make sure PacketFence changes the firewall (ipset -L) rules so that the user is authorized
through. Look into PacketFence log file: /usr/local/pf/logs/packetfence.log
• from the web administrative interface, go under Nodes and make sure you see the computer
as 'Registered'.
• the computer has access to the network and the Internet.
11.1. Introduction
In order to build a VLAN isolation setup you need :
• a supported switch (please consult the list of supported switch vendors and types in the
Network Devices Configuration Guide including information on uplinks
• a normal, registration and isolation VLAN (VLAN numbers and subnets)
• a switch port for the PacketFence (PacketFence) server which needs to be configured as a
dot1q trunk (several VLANs on the port)
Throughout this configuration example we use the following assumptions for our network
infrastructure:
Note that PacketFence will provide these services on its registration and isolation VLANs:
We will create three interfaces VLAN for registration, isolation and normal using the management
interface.
• Management
• Registration
• Isolation
• Other
Note that you can only set one (1) management interface.
In our example, we will create three new VLANs on the wired interface on our new trunk
interface (ens224) To do so, click the 'Add VLAN' button besides the wired interface for each of
the needed VLAN:
Registration
Isolation
Normal
According to our example, we’ll associate the correct type the each interfaces.
ens160: Management
ens224 VLAN 102: Registration
ens224 VLAN 103: Isolation
ens224 VLAN 104: Other
Make sure that those three interfaces are in an enabled state for the persistence to occur. We
also need to set the Default Gateway which will generally be the gateway of the management
network.
From the Roles tab, make sure you specify the following information:
If you want to test some ports with a VoIP phone (ex: Voice VLAN 200), add the following lines to
your interface configuration:
NOTE You can refer to the Cisco Catalyst documentation for more options.
On the computer:
• PacketFence puts the switch port into the normal VLAN (VLAN 104)
• The computer has access to the network and the Internet.
If this didn’t help, run FreeRADIUS in debug mode. To do so, start it using the following
commands.
Additionally there is a raddebug tool that can extract debug logs from a running FreeRADIUS
daemon. PacketFence’s FreeRADIUS is pre-configured with such support.
1. Make sure user pf has a shell in /etc/passwd, add /usr/sbin to PATH (export
PATH=/usr/sbin:$PATH) and execute raddebug as pf
The above will output FreeRADIUS' authentication debug logs for 5 minutes.
This section details most of the authentication mechanisms supported by PacketFence. It walks
you through the required steps to properly use an authentication mechanism on your captive
portal, for example. For Public Key Infrastructure (PKI) integration, please refer to the PKI
Integration section from this document.
If you can’t access this section and you have previously configured your server to
NOTE bind to a domain externally to PacketFence, make sure you run
/usr/local/pf/addons/AD/migrate.pl
If you are running a windows server earlier than Windows Server 2008 as a
domain controller, you’ll need to upgrade your windows server. From PacketFence
NOTE
13.1, we use secure channel to perform ntlm authentication, it is only supported
in windows server 2008 and later.
Click New Domain and fill in the information about your domain.
• Identifier is a unique identifier for your domain. It’s purpose is only visual.
• Workgroup is the workgroup of your domain in the old syntax (like NT4).
• DNS name of the domain is the FQDN of your domain. The one that suffixes your account
names.
• This server’s name is the name that the server’s account will have in your Active Directory.
If you are using an Active/Active cluster, each member of the cluster must be
NOTE joined separately. Please follow the instructions in the PacketFence Clustering
Guide.
13.1.1. Troubleshooting
• In order to troubleshoot unsuccessful binds, please refer to the following file :
/usr/local/pf/log/packetfence.log. Search for "ntlm-auth-api-domain" for all ntlm-auth-
api entries.
• you can check the service status and journal log using journalctl -f -u packetfence-ntlm-
auth-api-domain@[domain_id] for domain specific logs. Replace [domain_id] with your
domain
• You can test the authentication process using the following command
/usr/local/pf/bin/ntlm_auth_wrapper --username=administrator
Once they are configured, go in Configuration → Policies and Access Control → Domains →
REALMS.
Create a new realm that matches the DNS name of your domain AND one that matches your
workgroup. In the case of this example, it will be DOMAIN.NET tied to mydomain.
• Realm is either the DNS name (FQDN) of your domain or the workgroup
• Domain is the Active Directory domain where PacketFence sends the NTLM request
• Realm options are any realm options that you want to add to the FreeRADIUS configuration
• Domain is the domain which is associated to this realm
• RADIUS Auth is the RADIUS authentication server to proxy the request to
• Type is the home server pool type
• Authorize from PacketFence specifies if we forward the request to PacketFence to have a
dynamic answer or do we use the remote proxy server answered attributes
• RADIUS Acct is the RADIUS accounting server to proxy the request to
• Type is the home server pool type
• Eduroam Realm Options You can add Eduroam FreeRADIUS options in the realm definition
• Eduroam RADIUS Auth is the RADIUS Eduroam authentication server to proxy the request to
• Type is the home server pool type
• Authorize from PacketFence specifies if we forward the request to PacketFence to have a
dynamic answer or do we use the remote proxy server answered attributes
• Eduroam RADIUS Acct is the RADIUS Eduroam accounting server to proxy the request to
• Type is the home server pool type
• Strip on the portal Should the usernames matching this realm be stripped when used on the
captive portal
• Strip on the admin Should the usernames matching this realm be stripped when used on the
administration interface
• Strip in RADIUS authorization Should the usernames matching this realm be stripped when
used in the authorization phase of 802.1X
• Custom attributes Allow to use custom attributes to authenticate 802.1X users (attributes are
defined in the source)
• LDAP source The LDAP Server to query the custom attributes
The captive portal of PacketFence allows a guest/user to register using his Google, Facebook,
LinkedIn, Windows Live, OpenID Connect or Github account.
For each providers, we maintain an allowed domain list to punch holes into the firewall so the
user can hit the provider login page. This list is available in each OAuth2 authentication source.
You must enable the passthrough option in your PacketFence configuration (fencing.passthrough
in pf.conf).
13.2.1. Google
In order to use Google as a OAuth2 provider, you need to get an API key to access their services.
Sign up here : http://code.google.com/apis/console. In the Google APIs Console, go into
'Credentials → Create Credentials → OAuth client ID → Web Application', then enter a name and
make sure you use this URI for the "Authorized redirect URIs" field :
https://YOUR_PORTAL_HOSTNAME/oauth2/callback. Of course, replace the hostname with the
values from general.hostname and general.domain. Save to get the Client ID and Client secret.
You can keep the default configuration, modify the App ID & App Secret (Given by Google on the
developer platform) and Portal URL (https://YOUR_PORTAL_HOSTNAME/oauth2/callback).
Once you have your client id, and API key, you need to configure the OAuth2 provider. This can
be done by adding a Google OAuth2 authentication source from Configuration → Policies and
Access Control → Authentication Sources. Remember to add the Authentication Rules with at least
two Actions (example: Role and Access duration).
Moreover, don’t forget to add Google as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
13.2.2. Facebook
To use Facebook as an authentication source, you also need an API code and a secret key. To get
one, go here: https://developers.facebook.com/apps. When you create your App, make sure you
specify the following as the Website URL: https://YOUR_PORTAL_HOSTNAME/oauth2/callback
Of course, replace the hostname with the values from general.hostname and general.domain.
To find the secret, go in your newly created app, and click on 'Settings → Basic'.
While in 'Settings → Basic', add YOUR_PORTAL_HOSTNAME in the App Domains field. Next,
you will need to add the product Facebook Login. Click on Set up, and choose Web platform. Go
through the 5 steps, then on the left side of the screen, go in Settings under Facebook Login. For
Valid OAuth Redirect URIs, enter https://YOUR_PORTAL_HOSTNAME/oauth2/callback and then
save changes.
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding a Facebook OAuth2 authentication source from Configuration → Policies and Access
Control → Authentication Sources. Remember to add the Authentication Rules with at least two
Actions (example: Role and Access duration).
You can keep the default configuration, modify the App ID & App Secret (Given by Facebook on
the developer platform) and Portal URL (https://YOUR_PORTAL_HOSTNAME/oauth2/callback).
Moreover, don’t forget to add Facebook as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
By allowing OAuth through Facebook, you will give Facebook access to the
CAUTION
users while they are sitting in the registration VLAN.
13.2.3. Github
To use Github, you also need an API code and a secret key. To get one, you need to create an
App here: https://github.com/settings/applications/new. When you create your App, make sure
you specify the following as the Callback URL https://YOUR_PORTAL_HOSTNAME/oauth2/
callback
Of course, replace the hostname with the values from general.hostname and general.domain.
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding a GitHub OAuth2 authentication source from Configuration → Policies and Access
Moreover, don’t forget to add GitHub as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
13.2.4. Kickbox
To use Kickbox, you need a API key. To get one, first create an account on https://kickbox.io, then
navigate to https://app.kickbox.com/settings/keys. Click on 'API Keys → Create Key'. Pick a name
and choose 'Production' mode and 'Single' verification.
Once you have your API key, you need to configure the OAuth2 provider. This can be done by
adding a Kickbox authentication source from Configuration → Policies and Access Control →
Authentication Sources. Remember to add the Authentication Rules with at least two Actions
(example: Role and Access duration).
Moreover, don’t forget to add Kickbox as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
13.2.5. LinkedIn
To use LinkedIn, you also need an API code and a secret key. To get one, you need to create an
App here: https://developer.linkedin.com/. When you create your App, make sure you specify the
following as the Callback URL https://YOUR_PORTAL_HOSTNAME/oauth2/callback
You can get more details about how to configure your LinkedIn application inside Microsoft
documentation.
Of course, replace the hostname with the values from general.hostname and general.domain.
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding a LinkedIn OAuth2 authentication source from Configuration → Policies and Access
Control → Authentication Sources. Remember to add the Authentication Rules with at least two
Actions (example: Role and Access duration).
Moreover, don’t forget to add LinkedIn as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
When testing LinkedIn OAuth2, use a different LinkedIn account to setup the
NOTE
application and to test the Source in the captive portal.
When you create your App, make sure you specify the following as the Callback URL,
https://YOUR_PORTAL_HOSTNAME/oauth2/callback.
Of course, replace the hostname with the values from general.hostname and general.domain.
OpenID connect have different ways to be configured, make sure to create a client ID and a client
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding an OpenID OAuth2 authentication source from Configuration → Policies and Access
Control → Authentication Sources. Remember to add the Authentication Rules with at least two
Actions (example: Role and Access duration).
Moreover, don’t forget to add OpenID as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
13.2.7. Twilio
To use Twilio, first create an account on https://www.twilio.com. From the console (dashboard)
https://www.twilio.com/console create a 3rd Party Integration. Note the Account SID and Auth
Token for later use. From the Phone Manager https://www.twilio.com/console/phone-numbers/
incoming click the "+" button to Buy a number with SMS capability - no payment is needed to
start using this phone number right away.
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding a Twilio OAuth2 authentication source from Configuration → Policies and Access Control
→ Authentication Sources. Enter your 'Account SID', 'Auth Token' and 'Phone Number (From)' from
above. Remember to add the Authentication Rules with at least two Actions (example: Role and
Access duration).
Moreover, don’t forget to add Twilio as a Source from your connection profile definition, available
from Configuration → Policies and Access Control → Connection Profiles.
Once you have your information, you need to configure the OAuth2 provider. This can be done
by adding a WindowsLive OAuth2 authentication source from Configuration → Policies and Access
Control → Authentication Sources. Remember to add the Authentication Rules with at least two
Actions (example: Role and Access duration).
The App secret must be a client secret created in the Certificates & secrets section of your
app on Azure AD. Note that Azure AD secrets do expire so make sure you set a reminder to
update your secret before it expires.
Moreover, don’t forget to add WindowsLive as a Source from your connection profile definition,
available from Configuration → Policies and Access Control → Connection Profiles.
13.3. Eduroam
Eduroam (education roaming) is the secure, world-wide roaming access
PacketFence supports Eduroam and allows participating institutions to authenticate both locally
visiting users from other institutions as well as allowing other institutions to authenticate local
users.
First create RADIUS sources for each Eduroam servers you want to define.
Fill the Name, Description, Host, Port, Secret and disable Monitor. (The information to configure
that source could be found on the Eduroam platform)
Next click on Exclusive Sources and click on New exclusive source then Eduroam.
Associate the Radius sources you previously configured in 'Eduroam RADIUS AUTH' section,
define the radius listening port and keep the type to Keyed Balance.
In order to handle correctly external and internal students with your Eduroam source, you will
need to:
First, you need to refer to the previous step Configure the Eduroam source.
For this use case, there is no need to create a connection profile in PacketFence. FreeRADIUS will
only perform a NTLM Auth and won’t send RADIUS request to PacketFence API.
First, transfer the Identity Provider metadata on the PacketFence server. In this example, it will be
under the path /usr/local/pf/conf/idp-metadata.xml.
Where :
• Service Provider entity ID is the identifier of the Service Provider (PacketFence). Make sure
this matches your Identity Provider configuration.
• Path to Service Provider key is the path to the key that will be used by PacketFence to sign its
messages to the Identity Provider. A default one is provided under the path :
/usr/local/pf/conf/ssl/server.key
• Path to Service Provider cert is the path to the certificate associated to the key above. A self-
signed one is provided under the path : /usr/local/pf/conf/ssl/server.crt
• Path to Identity Provider metadata is the path to the metadata file you transferred above
Once this is done, save the source and you will be able to download the Service Provider
metadata for PacketFence using the link 'Download Service Provider metadata' on the page.
Configure your identity provider according to the generated metadata to complete the Trust
between PacketFence and your Identity Provider.
$metadata['PF_ENTITY_ID'] = array(
'AssertionConsumerService' => 'http://PORTAL_HOSTNAME/saml/assertion',
'SingleLogoutService' => 'http://PORTAL_HOSTNAME/saml/logoff',
);
PacketFence does not support logoff on the SAML Identity Provider. You can still
NOTE
define the URL in the metadata but it will not be used.
You need to make some configuration on the Azure portal in order to create the IDP.
Then fill the information required in the section 1 (Note that the Identifier will need to match with
what you will define in PacketFence):
On this page you have to download the Certificate (base64) and the Federation Metadata XML
and copy the Azure AD Identifier.
• Service Provider entity ID is the identifier of the Service Provider (PacketFence). In this
example it’s "https://radius.accessportal.page".
• Path to Service Provider key is the path to the key that will be used by PacketFence to sign its
messages to the Identity Provider. A default one is provided under the path :
/usr/local/pf/conf/ssl/server.key
• Path to Service Provider cert is the path to the certificate associated to the key above. A self-
signed one is provided under the path : /usr/local/pf/conf/ssl/server.crt
• Path to Identity Provider metadata Upload the XML file you previously downloaded from
Azure.
• Path to Identity Provider cert Upload the certificate you previously downloaded from Azure.
• Path to Identity Provider CA cert Upload the certificate you previously downloaded from
Azure (the same as the section above).
• Attribute of the username in the SAML response is the attribute that contains the username
in the SAML assertion returned by your Identity Provider. The one that can be used with
Azure is this one http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name who return
the "Unique User Identifier" (Edit the section 2 of the Azure SAML configuration detail to see
which attribute you can use).
• Authorization source is the source that will be used to match the username against the rules
defined in it. This allows to set the role and access duration of the user or also the access
level of the PacketFence’s administration GUI (if you have configured the "Advanced Access
Control For Admin Login"). The 'Authentication' section of this document contains
explanations on how to configure an Azure source which can then be used here.
13.4.3. Passthroughs
In order for your users to be able to access the Identity Provider login page, you will need to
activate passthroughs and add the Identity Provider domain to the allowed passthroughs.
Next, restart iptables and pfdns services to apply your new passthroughs.
PacketFence currently supports two payment gateways: Authorize.net, Paypal and Stripe.
In order to activate the billing, you will need to configure the following components :
• Billing source(s)
• Billing tier(s)
Paypal
This provider requires that your PacketFence server is accessible on the public
NOTE domain. For this your PacketFence portal should be available on a public IP using
the DNS server name configured in PacketFence.
If you have a business account and do not want to configure a test environment, you can skip the
next section.
Sandbox account
Create an account that has the type Personal and one that has the type Business.
Afterwards, go back into accounts, and expand the business account, then click Profile
Now click the 'Change password' link and change the password and note it.
Login into the Paypal business account that you created at https://www.sandbox.paypal.com/ if
you are using a sandbox account or on https://www.paypal.com/ if you are using a real account.
You should turn on Auto Return, set the return URL to https://YOUR_PORTAL_HOSTNAME/
billing/paypal/verify.
Enable Payment data transfert and you should see the Identity Token appear, note it as it will
be required in the PacketFence configuration.
Now on this page you will need to submit the certificate used by PacketFence to Paypal
(/usr/local/pf/conf/ssl/server.crt by default).
Once you have submitted it, note it’s associated Cert ID as you will need to configure it in
PacketFence.
The certificate will NOT be the same if you use a sandbox account or a real
CAUTION
account.
Configuring PacketFence
Now, in the PacketFence administration interface, go in Configuration → Policies and Access Control
→ Sources and create a new source of type 'Billing → Paypal'.
• Identity token is the one you noted when on the 'Website Payment Preferences' page.
• Cert ID is the one you noted when on the 'Encrypted Payment Settings'.
• Payment type is whether the access is donation based (not mandatory to pay for it).
If they aren’t already enabled, you will need to enable passthroughs so that users
NOTE can reach the domains of this provider. Refer to the Passthroughs section of this
document for details
Stripe
Stripe account
Next on the top right click Your account then Account settings.
Navigate to the API keys tab and note your key and secret. The test key should be used when
testing the configuration and the live key when putting the source in production.
Configuring PacketFence
Now, in the PacketFence administration interface, go in Configuration → Policies and Access Control
→ Sources and create a new source of type Billing → Stripe
• Secret key is the secret key you got from your Stripe account.
• Publishable key is the publishable key you got from your Stripe account.
• Style is whether you are doing a one-time charge or subscription based billing (recurring). See
section Subscription based registration below for details on how to configure it.
• Currency is the currency that will be used in the transactions.
• Test mode should be activated if you are using the test key and secret account.
If they aren’t already enabled, you will need to enable passthroughs so that users
NOTE can reach the domains of this provider. Refer to the Passthroughs section of this
document for details.
PacketFence supports integrating with the Stripe customer portal and will handle subscription
In order to enable the customer portal in Stripe, go in Settings → Product settings → Billing →
Customer portal. Next, enable the options you want for the customer portal.
Optionally, once this is configured, you need to make sure your captive portal is accessible
publicly for Stripe to send it webhooks if you want to support subscription cancellations. Once its
accessible publicly, configure a webhook to receive the event customer.subscription.deleted
on https://PF_DOMAIN_NAME/hook/billing/STRIPE_SOURCE_ID. Replace STRIPE_SOURCE_ID by
the identifier (name) of your Stripe source in your PacketFence configuration.
Next, in PacketFence, go in your Stripe source (Configuration → Policies and Access Control →
Authentication Sources) and enable the option Customer portal in your Stripe source.
Now when your users will visit the status page (https://PF_DOMAIN_NAME/status), they will
have the option to manage their subscriptions and visit the Stripe customer portal.
If don’t want to use all the billing tiers that are defined, you can specify the ones
NOTE
that should be active in the Connection profile.
Stripe configuration
• Price is the price of the plan. It is important that this matches the price of the billing tier in
PacketFence.
• Currency is the currency that will be used in the transactions. It is important that this matches
the currency of the Stripe source in PacketFence.
• Billing period is the interval at which the customer should be billed. In the case of this
example, it is monthly.
Where :
• API ID is the billing tier identifier. It is important that this matches the ID of the billing tier in
PacketFence.
Billing tier
When using subscription based billing, it is advised to configure the billing tier so it has an almost
infinite access duration (e.g. 20 years) as the billing provider will be contacting the PacketFence
server when the subscription is canceled.
You should configure a billing tier for each subscription plan you want to have. This example will
use the plan base and advance configured using the following parameters. In this case
price_1KW0jVIHkusDcikdVCGcvCii and price_1HFl6mIHkusDcikdZfIh5Bcj are the API ID copied
from the 2 products.
[price_1KW0jVIHkusDcikdVCGcvCii]
name=Base access
[price_1HFl6mIHkusDcikdZfIh5Bcj]
name=Advanced network access
description=Click here if you are poor
price=9.99
role=advanced_guest
access_duration=10Y
use_time_balance=disabled
As the subscription can be cancelled by a user, you need to setup your PacketFence installation
to receive updates from Stripe.
You need to make sure that your PacketFence server is available through a public IP on port 80
and that your PacketFence server hostname resolves on the public domain.
Then, in Stripe, configure a Webhook so Stripe informs PacketFence of any event that happens in
this Stripe merchant account.
Now every time a user unsubscribes from a plan, PacketFence will be notified and will unregister
that device from your network.
13.6.1. Authentication
This should provide the information about whether or not the username/password combination is
valid
These information are available through the POST fields of the request
13.6.2. Authorization
This should provide the actions to apply on a user based on it’s attributes
The following attributes are available for the reply : access_duration, access_level, sponsor,
unregdate, category.
Sample JSON response, note that not all attributes are necessary, only send back what you need.
{"access_duration":"1D","access_level":"ALL","sponsor":1
,"unregdate":"2030-01-01","category":"default"}
• Host : First, the protocol, then the IP address or hostname of the API and lastly the port to
connect to the API.
• API username and password : If your API implements HTTP basic authentication (RFC 2617)
you can add them in these fields. Leaving any of those two fields empty will make
PacketFence do the requests without any authentication.
• Authentication URL : URL relative to the host to call when doing the authentication of a user.
Note that it is automatically prefixed by a slash.
• Authorization URL : URL relative to the host to call when doing the authorization of a user.
Note that it is automatically prefixed by a slash.
With this configuration, you can now use this source in your connection profiles to authenticate
and authorize users on the captive portal and use it with EAP-TLS to authorize users (getting the
role and access duration) as long as your EAP-TLS certificates use the distinguished name of the
Azure AD users as their common name. Additionally, you can use this source for authenticating
users in the admin interface and for VPN access.
You can perform 802.1X authentication of users using Azure AD but this will only work with
supplicants configured to perform EAP-TTLS PAP which provides the RADIUS server with the
plain-text password of the user. Support for this type of authentication is not as broad as EAP-
PEAP MSCHAPv2 in the 802.1X supplicants but unfortunately Azure AD doesn’t support
MSCHAP authentication. Refer to the documentation of your operating system on how to
You can perform a EAP-TLS authentication and verify the machine group membership in order to
provide a access to the network.
To do that first you will have to provide to the end device a certificate that contains the Device
ID, to do this go in the Intune management interface and configure the template like this:
As you can see the CN (Common Name) will contain the Device Identifier, so when the device
will connects on the secure SSID, the username will be equal to the device ID (like 8df07f7e-
d98e-4579-aa97-bfcfaaa7fe38)
Now it just a matter to retrieve the group membership associated with the device ID, in order to
do that you will need to change the "User Groups URL" parameter in the "Azure Active Directory"
authentication source.
From the "Azure Active Directory" authentication source, create an authentication rule like this:"
If you need to perform other types of authentication for the admin interface (ex: SAML, multi-
factor auth, etc), then you can leverage all the capabilities of the captive portal for authenticating
administrators.
Next, you will need to configure a connnection profile for authenticating administrators. Go in
'Configuration→Policies and Access Control→Connection Profiles' and create a new connection
profile with these values:
After this, restart api-frontend and httpd.portal and when accessing the admin interface login
page, you should see a new option named 'Single Sign On'. This text can be changed in the
'Admin Login' configuration section.
Any authentication mechanism that can be used on the portal (SAML, Akamai MFA, TOTP, etc)
can be used for authenticating administrators using this process. Refer to the appropriate section
for each feature in this guide in order to configure them on your connection profile used for
authenticating administrators.
When upgrading from a previous version that does not include portal modules,
defaults are included that fit most cases with the same behavior as previous
NOTE
version, i.e. authentication uses the configured Connection Profile sources, and
then the provisioners.
• Root: a simple container that defines all the modules that need to be applied in a chain to the
user. Once the user has completed all modules contained in the Root module, the device is
released on the network.
• Choice: a choice between multiple modules for the user. See 'default_registration_policy' for a
good example.
• Chained: a list of ordered modules for the user to complete. One example is for users to
register with Google+ and pay for network access with PayPal.
• Authentication: many different types are available. Define one of these modules to override
the required fields, the source to use, the template or any other module attribute.
◦ Billing: one or more billing sources.
◦ Choice: multiple sources and modules with advanced filtering options. See Authentication
Choice module below for a detailed explanation.
◦ Login: username/password for multiple internal sources (Active Directory, LDAP, …).
• Other: The other modules are all based on the source type they are assigned to, they allow to
select the source, the AUP acceptance, and mandatory fields if applicable.
◦ Message: display a message to the user. An example is available below in Displaying a
message to the user after the registration
◦ SelectRole: override the role when a device is registered. For example an admin user is
trying to register a device using the normal registration process, with this module the
admin can choose which role to apply to the device while registering. This will bypass
authentication rules.
◦ URL: redirect the user to a local or external URL which may return the user back to the
portal to continue. An example is available below in Calling an external website.
14.1.1. Examples
Creating a custom root module
First in Configuration → Advanced Access Configuration → Portal Modules. Create a New Root
Module which will not affect the default policy. Give it the name my_first_root_module and the
Next in Configuration → Policies and Access Control → Connection Profiles. Select the connection
profile (most probably default) and set the Root Portal Module by selecting
my_first_root_module, then click Save.
Accessing the captive portal now will display an error since the Root module is
NOTE empty. Add some pre-configured modules to the new Root module to suppress
the error.
To prompt fields to the user without authentication, use the Null source with the Null Portal
Module.
A pre-configured Null source is included. If it has not been modified or deleted it can be used for
this example. Otherwise, in Configuration → Policies and Access Control → Sources, create a new
Null source with a catchall rule that assigns a role and access duration.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
"Authentication → Authentication::Null". Set the "Identifier" to prompt_fields and configure the
Portal Module with the desired "Mandatory fields" and uncheck "Require AUP" so the user does not
have to accept the AUP before submitting the form.
In my_first_root_module add the prompt_fields module (remove all previous modules), then
click Save. The portal will now prompt the user for the fields defined in the module. Once
submitted these fields are used to assign the role and access duration that is defined in the "Null
source".
To prompt additional fields to the user during authentication, define a Module based on the
source which specifies additional mandatory fields.
Example requiring the user to enter a value for "first name", "last name" and "address" before
registering:
Not all sources support additional mandatory fields (ex: OAuth sources like
NOTE
Google, Facebook, …).
Chained authentication
Two or more modules may be chained together in order to make the user accomplish all of the
actions of each module in the desired order.
Example requiring the user to login using any configured OAuth source (Github, Google+, …) and
then validate their phone number with SMS registration:
Use the default_oauth_policy for OAuth login, and ensure an OAuth source is configured and
available in Connection Profiles.
Create a Portal Module that will contain the SMS registration definition.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
type "Authentication → SMS". Set the "Identifier" to prompt_sms and configure the Portal Module
with with sms Authentication Source, and uncheck "Require AUP" since the user will already have
accepted the AUP earlier when registering with OAuth.
Portal Module "Saved Fields" save and persist user responses. Adding telephone
to the first module’s "Saved Fields" will persist through all subsequent modules in
NOTE
the chain, and subsequent modules will not prompt the user again for a field that
is already saved.
Devices can access an open SSID with LDAP username/password, and then a Provisioner handles
the remainder of the device on-boarding.
Configure the Provisioners for Secure SSID onboarding. Refer to the Apple and Android Wireless
Provisioning section of this guide to configure the provisioners and add them to the Connection
Profile.
Create a new provisioner with type Deny at the bottom of the list with the existing provisioners.
This ensures the device is not allowed if no other provisioner is matched.
In the Connection Profile set the Sources to only the LDAP source, removing any other sources.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
type "Other → Provisioning". Set the "Identifier" to secure_boarding, provide a relevant
description, and uncheck "Skippable" so the user is forced to board the SSID if this option is
chosen.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
type "Multiple → Choice" . Set the "Identifier" to login_or_boarding, and provide a relevant
description. Add secure_boarding and default_login_policy to the "Modules", then click
Create.
A custom message can be displayed to the user using the Message Portal Module.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
type "Other → Message". Set the "Identifier" to hello_world, provide a relevant description.
Add the following text in the "Message" field, then click Create:
Hello World !
<a href="www.packetfence.org">Click here to access the PacketFence website!</a>
The user can be redirected to either a local or external URL (if included in passthroughs) using the
"URL" Portal Module. In order for the Portal flow to continue the Module must accept a callback,
otherwise users are redirected without the possibility to continue with the registration process.
In my_first_root_module add the token_system module (removing any previous modules), then
click Save. The portal will now prompt the user for authentication using the Sources defined in
the Connection Profile, and then the user is redirected to the token_system URL. From there,
once the user continues they are redirected back to the Portal in order to complete the
registration process.
All the defined "Sources" and "Modules" are available for use. Mandatory fields can be defined in
the module, but they will only be shown if applicable to the Source.
Dynamically select a Source from the Connection Profile based on an object attribute (Object
Class, Authentication Type, Authentication Class).
• Source(s) by Class: Specify the perl class name of the available source(s).
◦ ex: pf::Authentication::Source::SMSSource selects all the SMS source(s).
◦ ex: pf::Authentication::Source::BillingSource selects all the billing sources (Paypal,
Stripe, …).
14.1.3. SelectRole
Manually define specific roles when registering a device. This is useful for a technical crew to
register new devices.
In Configuration → Advanced Access Configuration → Portal Modules, click "New Module" and select
type "Other → Select Role". In "Admin Roles" chose the user role(s) that is required to use this
module. In "Roles" choose the user role(s) that can then be assigned.
For example; technicians in the AD group technical support will have the role technical support
while registering. In "Admin Roles" add technical support, then in "Roles" add default, voice and
guest. Technicians that have the technical support role will be prompted to assign either the
default, voice or guest role when registering a new device.
Consider that a root portal module is linked to an Authentication::Login module and associated
with a Connection Profile. In order to present a Guest authentication if the login failed, configure
a New Root Module called "Guest portal policy" with the "Module" set to Authentication::SMS,
and in the previous "Authentication::Login" module add the "Action" on_failure ⇒ Guest portal
policy.
mysql -uroot -p
The MySQL root password was only provided during Configuration and not
NOTE
stored on disk.
1 [survey1]
2 description=Mustard Turkey Sandwich Brothers
3
4 [survey1 field gender]
5 label=What is your gender?
6 type=Select
7 choices=<<EOT
8 M|Male
9 F|Female
10 EOT
11 required=yes
12
13 [survey1 field firstname]
14 label=What is your firstname?
15 type=Text
16 required=yes
17
18 [survey1 field lastname]
19 label=What is your lastname?
20 type=Text
21 required=yes
22
23 [survey1 field sandwich_quality]
24 label=On a scale of 1 to 5, how good was your sandwich today?
25 type=Scale
26 minimum=1
27 maximum=5
28 required=yes
29
30 [survey1 field prefered_sandwich]
31 label=What is your prefered sandwich?
32 type=Select
33 choices= <<EOT
34 Classic|Classic
35 Extra Turkey|Sandwich with extra turkey
36 Extra Mustard|Sandwich with extra mustard
37 EOT
38 required=yes
The Captive Portal will now collect some data from the user (ex: survey1 field firstname) and
some data contextually (ex: survey1 data ssid).
Add the survey to an existing Portal Module (Choice, Chained or Root) or create a New Root
Module dedicated for the survey:
In "Policies and Access Control → Connection Profiles → Name of the profile", ensure the correct
"Root Portal Module" is selected.
1 [survey1]
2 description=My first survey report
3 base_table=survey_survey1
4 columns=firstname as "Firstname", lastname as "Lastname", prefered_sandwich
as "Prefered Sandwich", gender as "Gender"
14.2.5. Cleaning up
Once configured, optionally for security, it is recommended to revoke the CREATE and ALTER
privileges from the pf user. The MySQL root user must be used to REVOKE these privileges.
mysql -uroot -p
The MySQL root password was only provided during Configuration and not
NOTE
stored on disk.
The user can access the portal within the network, or in any VLAN that can reach
NOTE PacketFence on a portal interface (see below) at:
https://YOUR_PORTAL_HOSTNAME/device-registration.
Device registration page is disabled by default. In order to enable it, you need to configure a self
service policy and assign it to a connection profile.
In Configuration → Policies and Access Control → Connection Profiles, assign the "Self service policy",
then click Save.
By default all users can manage all their own devices through the self-service portal. In
Configuration → Advanced Access Configuration → Self Service Portal, choose a Self Service Portal,
specify the "Self Service Portal → Allowed roles", then click Save.
Status page is available by default, even if you don’t configure a self service policy. Optionally, it
can be disabled in all but the PacketFence management network (registration, isolation, inline) by
enabling Status URI only on management interface in Configuration → Advanced Access
Configuration → Captive Portal.
In Configuration → Policies and Access Control → Connection Profiles, assign the "Self service policy",
then click Save.
14.5. Passthroughs
Passthroughs allow access from users confined inside the registration network to specific
resources on the outside. An example is to allow clients on the Captive Portal access to an
external password reset server.
Passthroughs can be done with either DNS resolution and iptables, or with Apache’s mod_proxy
module, or both. A domain configured for both gives priority to DNS passthroughs.
When pfdns receives a DNS request for a passthrough domain it will forward the unaltered DNS
record for the FQDN instead of a response for the Captive Portal. An ipset entry will be added
to permit the device to access the real external IP address for the FQDN via iptables routing.
When pfdns receives a DNS request it will respond with the IP address of the Captive Portal, and
when the device makes a HTTP request on the Captive Portal for a FQDN that has a configured
passthrough the request is forwarded through mod_proxy.
For Apache to receive the proxy requests, manually add a new entry in
WARNING /etc/hosts to resolve the FQDN of the Captive Portal to the IP address of
the registration interface.
In large registration networks Parking can be used to provide a longer lease and provide a
In Configuration → Network Configuration → Networks → Device Parking, set the "Parking Threshold"
(seconds). A value of 21600 / 6 hours is suggested. If a device is idle in the registration network
for more than 6 hours, Security Event 1300003 (see below) will be triggered and the device will be
parked.
Optionally the lease length (seconds) can also be set in "Parking lease length". If the device is
parked with a "Parking lease length" of 1 hour, then immediately unparked, the next detection will
occur in 1 hour, even if the "Parking threshold" is a lower value.
Parking is detected when a device requests DHCP and only works if PacketFence
NOTE
is the DHCP server for the registration network.
• In "Event Actions" add actions with the predefined ones (ex: 'Email administrator' or 'Execute
script').
• In "Event Actions → Isolate → Role while isolated" set the destination role (VLAN) of the user.
Leave as registration unless a dedicated role is needed for parking.
• In "Event Actions → Isolate → Template to use" set the template used in the registration Portal,
not the template used for parking. To use the non-parking portal disable "Show parking portal"
in Configuration → Network Configuration → Networks → Device Parking.
• In "Grace" set the amount of grace time between two parking security events. Once a device is
unparked, wait at least this amount of time for the user to register before re-triggering the
Security Event.
• Redirect URL under Configuration → Policies and Access Control → Connection Profile → Profile
Name
For some browsers, it is preferable to redirect the user to a specific URL instead of the URL the
user originally intended to visit. For these browsers, the URL defined in redirecturl will be
where the user is redirected. Affected browsers are Firefox 3 and later.
This IP is used as the web server that hosts the common/network-access-detection.gif which is
a pixel-gif used to detect network access. The IP cannot be a domain name since it is used during
Registration and Isolation where DNS is black-holed. It is recommended to allow users to reach
the PacketFence server with the PacketFence LAN IP.
In some cases, a different captive portal may be presented (see below for the available
customizations) according to the SSID, the VLAN, the switch IP/MAC or the URI the client
connects to. To do so, PacketFence uses the concept of connection profiles to provide this
possibility.
When configured, connection profiles will override default values. When no values are configured
in the profile, PacketFence will use the values from the "default" connection profile.
Below the different configuration parameters for each connection profile are provided. The only
mandatory parameter is "filter", otherwise, PacketFence will not be able to correctly apply the
connection profile. The parameters are set in /usr/local/pf/conf/profiles.conf:
/usr/local/pf/conf/profiles.conf
1 [profilename1]
2 description = the description of the connection profile
3 filter = the name of the SSID or the VLAN to apply the profile
4 sources = a comma-separated list of authentications sources (IDs) to use
Connection profiles should be managed from PacketFence’s Web administration GUI - from the
Configuration → Policies and Access Control → Connection Profiles section. Adding a new
connection profile will make a copy of the default templates - which can then be modified as
desired.
• Filters under Configuration → Policies and Access Control → Connection Profile → Profile Name
→ Filters
Connection Type
Network
Node Role
Port
Realm
SSID
Switch
Switch Port
URI
VLAN
Time period
• SSID: Guest-SSID
• VLAN: 100
• Time period: wd {Mon Tue} hr {1pm-3pm} — See http://search.cpan.org/~pryan/Period-1.20/
Period.pm
• Switch Port: <SwitchId>-<Port>
• Network: IP address or Network CIDR
CAUTION Node role is only used with 802.1X connections and VLAN filters.
• Advanced filter under Configuration → Policies and Access Control → Connection Profile →
Profile Name → Advanced Filter
This section defines how to create an advanced filter to match specific attributes.
autoreg
status
bypass_vlan
bandwidth_balance
regdate
bypass_role
device_class
device_type
device_version
device_score
pid
machine_account
category
mac
last_arp
connection_sub_type
connection_type
switch
port
vlan
ssid
dot1x_username
realm
machine_account
Operators:
&& and
|| or
!= is not equal
== equal
() group precedence
Special values:
Match machine authentication from a previous connection and is connected on a secure ssid:
machine_account == \\__NULL__
1 'radius_request' => {
2 'NAS-Port-Type' => 15,
3 'Service-Type' => 2,
4 'State' => '0x7cfd15627dba0f5a45baee16526652a6',
5 'Called-Station-Id' => '00:8e:73:5d:f6:9e',
6 'FreeRADIUS-Proxied-To' => '127.0.0.1',
7 'Realm' => 'null',
8 'EAP-Type' => 26,
9 'NAS-IP-Address' => '172.30.255.13',
10 'NAS-Port-Id' => 'GigabitEthernet1/0/30',
11 'SQL-User-Name' => 'gwten',
12 'Calling-Station-Id' => '00:11:22:33:44:55',
13 'PacketFence-Domain' => 'ZAYM',
14 'Cisco-AVPair' => 'service-type=Framed',
15 'User-Name' => 'zaym',
16 'Event-Timestamp' => 'Aug 15 2019 17:10:03 BST',
17 'EAP-Message' => '0x024700061a03',
PacketFence uses Apache for its captive portal, administration interface and Web services. The
PacketFence Apache configuration is located in /usr/local/pf/conf/httpd.conf.d/.
In this directory the following important files are used for different purposes:
• httpd.admin: used to manage PacketFence admin interface
• httpd.portal: used to manage PacketFence captive portal interface
• httpd.webservices: used to manage PacketFence webservices interface
• httpd.aaa: used to manage incoming RADIUS requests
These files are dynamically generated with Perl and services are only activated on the network
interfaces needed for each purpose.
The other files in this directory are managed by PacketFence using templates, so it is easy to
modify these files based on the configuration. SSL is enabled by default to secure access.
As a security precaution, this option will only reuse 802.1X credentials if there is an
authentication source matching the provided realm. This means, if users use 802.1X credentials
with a domain part (username@domain, domain\username), the domain part needs to be configured
as a realm under the RADIUS section and an authentication source needs to be configured for
that realm. If users do not use 802.1X credentials with a domain part, only the NULL realm will be
matched IF an authentication source is configured for it.
uc
lc
join
substr
macToEUI48
random_from_range
log
replace
BuildFromMatch
15.2.1. uc
Upper case string.
Example:
PacketFence-UserName = ${uc($radius_request.Calling-Station-Id)}
15.2.2. lc
Lower case string.
Example:
PacketFence-UserName = ${lc($radius_request.User-Name)}
15.2.3. join
Join strings.
Example:
15.2.4. substr
A part of a string.
Example:
15.2.5. macToEUI48
EUI48 format of a MAC address.
Example:
PacketFence-UserName = ${macToEUI48($radius_request.Calling-Station-Id)}
15.2.6. random_from_range
A random integer between a range.
Example:
Session-Timeout = ${random_from_range("10620..12600")}
15.2.7. log
Log a message in packetfence.log.
Example:
logs the value of the RADIUS request attribute User-Name appended with " logged".
15.2.8. replace
Replace a string or character.
Example:
PacketFence-UserName = ${replace($radius_request.User-Name,"z","r")}
replace the character "z" by the character "r" from User-Name and assign it to PacketFence-
UserName.
15.2.9. BuildFromMatch
Regular expression match on a string or character.
Example:
TLS-Stripped-UserName = ${BuildFromMatch($radius_request.TLS-Client-Cert-
Common-Name,"^[^@]+","$0")}
extract the value from TLS-Client-Cert-Common-Name before the @ sign and assign it to TLS-
Stripped-UserName.
IsolationRole
RegistrationRole
RegisteredRole
InlineRole
AutoRegister
NodeInfoForAutoReg
Default VLAN filters are defined in the configuration that can be used to achieve the following
goals:
EXAMPLE_Reject_between_11am_2pm
prevent a registered device from connecting when its role is default, the SSID is SECURE, the
current time is between 11am and 2pm, from Monday to Friday.
EXAMPLE_Trigger_event_if_user
create a security event if the SSID is OPEN and the owner is igmout (the security event needs
to have a custom trigger with the value 12345).
EXAMPLE_Autoregister_if_user
autoregister the device and assign the role staff to each device if the username is igmout.
EXAMPLE_Autoregister_windows_devices
autoregister all Windows devices and assign them the default role.
EXAMPLE_Reject_specific_MAC
filter a MAC address and reject it by assigning the REJECT role.
EXAMPLE_Reject_User_Unless_Machine
refuse user authentication without prior machine authentication.
EXAMPLE_Autoregister_Printer_Scanner
autoregister printers and scanners and add a note.
We added the ability to specify filters directly in the portion of code that return RADIUS
attributes or do a call to the API. These filters can be defined in Configuration → Advanced Access
Configuration → Filter engines.
Default RADIUS filters are defined in the configuration that can be used to achieve the following
goals:
EXAMPLE_Ethernet-EAP-Accept
returns Access-Accept (with Cisco-AVPair attribute) when the connection is Ethernet-EAP and
no security event exists.
EXAMPLE_Session-timeout_Idle-Timeout_Terminate_action
filter on the switch IP addresses and add the Session-Timeout (with a value between 10620
and 12600), the Idle-Timeout and Terminate-Action RADIUS attributes.
EXAMPLE_ipad_by_name
use Fingerbank to target specific devices (Apple iPad) and add Cisco ACL(s) to them.
EXAMPLE_eap-tls-preProcess
create RADIUS attributes that will be used internally (like authentication rules). Add the TLS-
Stripped-UserName RADIUS attribute in the request which can be used in the
authentication/administrations rules.
Adding the action set_role_on_not_found = REJECT will reject the device if the LDAP filter
match returns empty. On the other hand, if a filter match is found then the set_role action is
applied.
Example that takes the LDAP attribute customRadius value and adds it in the RADIUS answer. In
the authentication rule add an action "Role from source" to customRadius. Next create a RADIUS
filter that will add the custom RADIUS attributes:
[IF_SET_ROLE_FROM_SOURCE]
status=enabled
answer.0=reply:Packetfence-Raw = $ldap_attribute.customRadius
top_op=and
description=If the role has been computed from the action set_role_from_source
then return the value of the role as a RADIUS attribute
scopes=returnRadiusAccessAccept
radius_status=RLM_MODULE_OK
merge_answer=no
condition=action == "set_role_from_source"
(&(|(sAMAccountName=%{User-Name})(sAMAccountName=%{Stripped-User-
Name})(cn=%{User-Name})(cn=%{Stripped-User-Name})(sAMAccountName=%{%{Stripped-
User-Name}:-%{User-Name}})))
(&(|(sAMAccountName=%{User-Name})(sAMAccountName=%{Stripped-User-
Name})(cn=%{User-Name})(cn=%{Stripped-User-Name})(sAMAccountName=%{%{Stripped-
User-Name}:-%{User-Name}}))(|(memberOf=CN=Staff,OU=Security
Groups,DC=ad,DC=acme,DC=com)(wifi=enabled)))
If the "Search Attributes" feature is not required, this will still store the users' DN in the
PacketFence-UserDN attribute.
For example in the ACME realm we define the regex like this:
.*\.acme\.com$
Thus in the case of username [email protected], the realm is defined as la.acme.com - which is
included in the RADIUS request - and the user is mapped with the ACME realm.
This section presents the FreeRADIUS configuration steps. In some occasions, a RADIUS server is
mandatory in order to give access to the network. For example, the usage of WPA2-Enterprise
(Wireless 802.1X), MAC authentication and Wired 802.1X all require a RADIUS server to
authenticate the users and the devices, and then to push the proper roles or VLAN attributes to
the network equipment.
1 ldap openldap {
2 server = "ldap.acme.com"
3 identity = "uid=admin,dc=acme,dc=com"
4 password = "password"
5 basedn = "dc=district,dc=acme,dc=com"
6 filter = "(uid=%{mschap:User-Name})"
7 ldap_connections_number = 5
8 timeout = 4
9 timelimit = 3
10 net_timeout = 1
11 tls {
12 }
13 dictionary_mapping = ${confdir}/ldap.attrmap
14 edir_account_policy_check = no
15
16 keepalive {
1 authorize {
2 suffix
3 ntdomain
4 eap {
5 ok = return
6 }
7 files
8 openldap
9 }
First create a guest SSID with the guest access you want to use (Email, Sponsor or SMS, …) and
activate 'Create local account' on that source.
At the end of the guest registration, PacketFence will send an email with the credentials for Email
and Sponsor and SMS.
This option doesn’t currently work with the Reuse dot1x credentials option of the
NOTE
captive portal.
Take care of the "Database passwords hashing method" that has been
configured in Configuration → System Configuration → Main Configuration →
CAUTION Advanced or in the authentication source configuration (when you enabled
"create local account") , the hash method must be plaintext or ntlm to be
able to work.
Edit /usr/local/pf/conf/radiusd/packetfence-tunnel
By default it will reject for 5 minutes a device that has been rejected twice in the last 5 minutes.
Fell free to change the default values in raddb/policy.d/packetfence and in raddb/mods-
enabled/cache_ntlm
16.7. Testing
Test your setup with radtest using the following command and make sure you get an Access-
Accept answer:
Accounting::[DIRECTION][LIMIT][INTERVAL(optional)]
• DIRECTION: You can either set a limit to inbound(IN), outbound(OUT), or total(TOT) bandwidth
• LIMIT: You can set a number of bytes(B), kilobytes(KB), megabytes(MB), gigabytes(GB), or
petabytes(PB)
• INTERVAL: This is actually the time window we will look for potential abuse. You can set a
number of days(D), weeks(W), months(M), or years(Y).
Example triggers
Accounting::IN50GB1M
Accounting::OUT500MB1D
• Look for Total (Download + Upload) traffic with a 200GB limit in the last week
Accounting::TOT200GB1W
Grace Period
When using such security event feature, setting the grace period is really important. You don’t
want to put it too low (ie. A user re-enable his network, and get caught after 1 bytes is
transmitted!) or too high. We recommend that you set the grace period to one interval window.
To do that in PacketFence you need first to define the target RADIUS server(s) in Configuration →
Policies and Access Control → Authentication Sources, and create the RADIUS source(s) (ACME1
ACME2). In the Source configuration, fill the mandatory fields and add the options to define the
home_server in FreeRADIUS. (https://github.com/FreeRADIUS/freeradius-server/blob/v3.0.x/
raddb/proxy.conf)
$src_ip is a way to dynamically use the correct source ip address of the system in case of
multiples network interfaces.
Next go in Configuration → Policies and Access Control → REALMS, and add a new realm.
Authorize from PacketFence will send the request to PacketFence to compute the role and access
duration of the device.
In this case the easiest way to achieve that is to create a Authorization source (with rules), assign
this source to a connection profile where you enabled "Automatically register devices" and where
you defined a filter like Realm = acme.com .
Now when a device connect with the username [email protected] then the authentication and
accounting requests will be forwarded to one of the ACME RADIUS servers.
First you have to create RADIUS authentication source like above and create for example two
realms "to_NPS" and "to_ISE" (associate the RADIUS sources in the REALMs)
Next you have to enable the RADIUS filters in the packetfence.authorize and packetfence.post-
proxy scope, to do that you have to go in _Configuration → System Configuration → RADIUS →
General , and enable "Use RADIUS filters in packetfence authorize" and "Use RADIUS filters in
packetfence post-proxy".
After this step restart the packetfence-radiusd-auth service (systemctl restart packetfence-
radiusd-auth.service).
Here are some examples of what you can do with the RADIUS filters (the content of the
radius_filters.conf file):
Proxy the RADIUS request to the to_NPS realm if the Calling-Station-Id or Colubris-AVPair
attribute matches the regex ACME$
[NPS]
scopes=packetfence.authorize
description=to_NPS
condition=radius_request.Called-Station-Id =~ "ACME$" ||
radius_request.Colubris-AVPair =~ "ACME$"
status=disabled
merge_answer=yes
answer.0=control:Proxy-To-Realm = to_NPS
Proxy the RADIUS request the to_ISE realm if the Calling-Station-Id or Colubris-AVPair attribute
contains ACME_Admin$ and add the attribute Realm with the value to_ISE in the RADIUS
request (can be for example used as a filter in a connection profile)
Proxy the RADIUS request to the NULL realm if the Calling-Station-Id or Colubris-AVPair
attribute matches the regex Guest$
[NULL]
scopes=packetfence.authorize
description=to_null
status=enabled
merge_answer=yes
condition=radius_request.Called-Station-Id =~ "Guest$" ||
radius_request.Colubris-AVPair =~ "Guest$"
answer.0=control:Proxy-To-Realm = NULL
Proxy the RADIUS request to the to_ISE realm if the Calling-Station-Id attribute matches the
regex ACME$
[NO_REALM]
merge_answer=no
scopes=packetfence.authorize
status=enabled
condition=radius_request.Called-Station-Id =~ "ACME$" &&
not_contains(radius_request.User-Name, "@") &&
not_contains(radius_request.User-Name, "\\")
description=NO_REALM
answer.0=control:Proxy-To-Realm = to_ISE
Proxy the RADIUS request to the to_ISE realm if the device role is Employe and the status is
registered
[Employe]
merge_answer=no
scopes=packetfence.authorize
status=enabled
condition=node_info.category == "Employe" && node_info.status == "reg"
description=Employe
In this EAP profile you can define: Certificates configuration. OCSP configuration EAP-Fast
configuration TLS Configuration
For example the realm ACME.COM needs to use the CA certificate from ACME CA and the other
realms need to use the default one.
The last thing to do is to link the EAP profile with your realm configuration, to achieve that go in
Configuration → Policies and Access Control → Domains → REALMS and edit the ACME.COM realm
(create it if it’s not already the case) then choose the EAP profile you created before in the EAP
configuration parameter.
Fingerbank, a great device profiling tool developed alongside of PacketFence, now integrates with
it to power-up the feature set allowing a PacketFence administrator to easily trigger security
events based on different device types, device parents, DHCP fingerprints, DHCP vendor IDs,
MAC vendors and browser user agents.
The core of that integration resides in the ability for a PacketFence system, to interact with the
Fingerbank upstream project, which then allow a daily basis fingerprints database update, sharing
unknown data so that more complex algorithms can process that new data to integrate it in the
global database, querying the global upstream database in the case of an unknown match and
much more.
Since the Fingerbank integration is now the "de facto" device profiling tool of PacketFence, it was
a requirement to make it as simple as possible to configure and to use. From the moment a
working PacketFence system is in place, Fingerbank is also ready to be used, but only in a "local"
mode, which means, no interaction with the upstream Fingerbank project.
17.1. Onboarding
To benefit from all the advantages of the Fingerbank project, the onboarding step is required to
create an API key that will then allow interaction with the upstream project. That can easily be
done only by going in the "Settings" menu item under the "Fingerbank" section of the
PacketFence "Configuration" tab. From there, an easy process to create and save an
user/organization specific API key can be followed. Once completed, the full feature set of
Fingerbank can be used.
17.6. Settings
Fingerbank settings can easily be modified from the "Settings" menu item under the "Fingerbank"
section of the PacketFence "Configuration" tab. There’s documentation for each an every
parameter that allow easier understanding.
You should then check Enabled to activate this feature. You will then have the choice between
triggering the security event on any device class change or on a specific set of changes.
The easiest method for performing this detection is to trigger on any device class change which
will trigger the security event whenever the device is detected transitioning from any device class
to another. Since some of these transitions may be normal in your environment, you can add
whitelisting of transitions via the "Device class change whitelist" parameter which allows you to
list valid transitions (ex: "Windows OS" to "Mac OS X or macOS").
Starting with version 10, PacketFence integrates network devices anomaly detection capabilities.
This means that PacketFence can detect abnormal network activies from devices - that is, if they
are talking to a compromised host, if they are deviating from their pristine network profile and
more. These capabilities come from the integration of the Fingerbank technology. That is, the
Fingerbank Cloud API is responsible for producing pristine network device profiles while the
Fingerbank Collector, included in PacketFence, does consume the pristine profiles and does
anomaly detection based on its templating engine.
Network behavior policies can be consumed from PacketFence’s Security Events module.
You can use your policy by first adding a new trigger. The network behavior policy can be
selected after defining an internal event on the following attributes:
Once done, the appropriate policy can be selected. If you want your entire network policy to be
checked in the Security Events module, you must create three triggers - one with each of the
attribute listed above together with your appropriate policy selected. You can look at the default
security events Fingerbank profile anomaly (1300007) and Fingerbank detected blacklisted
communication (1300008) for some examples on how to create customized security events to
fulfill your requirements.
Defining Actions
Example Action
Regex -
mac\s*:\s*(?P<mac>[a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}),
notes\s*:\s*(P?<notes>.*)
Action -
The first step is to create the syslog regex parser and then create the security event.
Detector *: Suricata
Enabled: checked
Alert pipe: /usr/local/pf/var/suricata (To create the fifo file, do: mkfifo
/usr/local/pf/var/suricata)
Rules:
Rule - New:
You can directly test your rule. In the previous example the parser expect a syslog string like this:
In order to have a correct match in the rule, you will need to have a valid iplog entry in the
database. Put the string in the test box and then click on the RUN TEST button, you should get:
We can see that PacketFence will execute the security event on the MAC address
00:11:22:33:44:55.
Definition:
Enabled: ON
Identifier: 1500001
Description: ET P2P Kaaza Media
Action: Reevaluate Access Action; Log message
Priority: 1
Triggers:
Remediation:
Now you will need to restart the pfqueue and the pfdetect services.
Since a security suite consists of multiple pieces of software tied together, you may be prompted
for different options during the installation process. A detailed "Production Deployment" guide
can also be found directly from the Security Onion website: https://github.com/Security-Onion-
Solutions/security-onion/wiki/ProductionDeployment
set DEBUG 2
sudo nsm_server_ps-restart
Modify rsyslog configuration to allow incoming UDP packets by uncommenting the following two
lines in /etc/rsyslog.conf:
$ModLoad imudp
$UDPServerRun 514
mkfifo /usr/local/pf/var/securityonion_ids
At this point, Security Onion should be able to send detected alerts log entries to PacketFence.
A configuration of a new 'syslog parser' as well as some security events are the only remaining
steps to make full usage of the Security Onion IDS integration.
Configuration of a new security event can use the following trigger types:
Type: detect
Triggers ID: The IDS triggered rule ID
Type: suricata_event
Trigger ID: The rule class of the triggered IDS alert
Locate the outputs section and modify the fast options as follow:
outputs:
- fast:
enabled: "yes"
filename: /nsm/fast.log
append: "yes"
- eve-log:
enabled: "yes"
filetype: regular
filename: /nsm/eve-%Y-%m-%d-%H:%M.json
rotate-interval: hour
#prefix: "@cee: "
#identity: "suricata"
#facility: local5
#level: Info
#redis:
# server: 127.0.0.1
If you want to disable some rules in suricata, you can use so-rule:
You can also check this video to understand how to manage suricata rules:
https://www.youtube.com/watch?v=1jEkFIEUCuI
$ModLoad imfile
$InputFileName /nsm/suricata/fast.log
$InputFileTag suricata
$InputFileStateFile stat-suricata
$InputFileSeverity error
$InputFileFacility local3
$InputRunFileMonitor
local3.* @PACKETFENCE_MGMT_IP:514
Restart Rsyslog:
$ModLoad imudp
$UDPServerRun 514
mkfifo /usr/local/pf/var/securityonion_ids
At this point, Security Onion should be able to send detected alerts log entries to PacketFence.
A configuration of a new 'syslog parser' as well as some security events are the only remaining
steps to make full usage of the Security Onion IDS integration.
Type: suricata
Alert pipe: the previously created alert pipe (FIFO) which is, in this case,
/usr/local/pf/var/securityonion_ids
Configuration of a new security event can use the following trigger types:
Type: detect
Triggers ID: The IDS triggered rule ID
Type: suricata_event
Trigger ID: The rule class of the triggered IDS alert
One way of accessing encapsulated traffic at the destination host is through a software called
RCDCAP, which is a daemon that creates a virtual interface if not existing, on which both GRE
and ERSPAN headers are decapsulated prior to the traffic being injected to the previous
interface. Security Onion can then feed on that interface like it would on any other, and if the
RCDCAP daemon dies, continue to listen to that interface even though decapsulated traffic won’t
be available anymore.
Assumptions for the example: The switch is at IP 172.16.0.1, the monitored switch port is
GigabitEthernet0/10 and the Security Onion monitoring destination IP is 10.10.10.10 on eth2,
eth2 ideally being a dedicated interface.
On Security Onion:
• Install RCDCAP
• Modify network file (/etc/network/inferfaces) so that eth2 has an IP and a proper MTU.
Decapsulated traffic will be injected on mon1. Make sure that the configuration is similar to
the following:
1 auto eth2
2 iface eth2 inet static
3 address 10.10.10.10
4 netmask 255.255.255.240
5 up ip link set $IFACE arp on up
6 up ip link set dev $IFACE mtu 1900
7 post-up ethtool -G $IFACE rx 4096; for i in rx tx sg tso ufo gso gro lro;
do ethtool -K $IFACE $i off; done
8 post-up echo 1 > /proc/sys/net/ipv6/conf/$IFACE/disable_ipv6
9
• Rerun Security Onion wizard and make sure to skip network configuration step. Make sure
that mon1 is selected for monitoring purposes, note that eth2 doesn’t need to.
sudo sosetup
On the Switch:
PacketFence is able to update some firewall based on device information, like the IP address, the
username connected on it. Look below for integration guides to see how you can configure your
firewall with PacketFence. By default PacketFence uses the DHCP traffic to trigger an update on
the firewall but it’s also possible to do it with the RADIUS accounting traffic.
In order to manage the way you want to update the firewall, go in Configuration → System
Configuration → Main Configuration → Advanced, then there are two choices:
You can use both methods at the same time but this will result in duplicate SSO requests if you
receive the DHCP and accounting of the same device which can cause unexpected load on your
firewall.
20.1. Barracuda
20.1.1. Configuration of the Barracuda in PacketFence
Go to Configuration → Integration → Firewall SSO → Add Firewall → Barracuda.
If you want to see if it’s working, open an SSH access to your Barracuda and run this command
20.2. Checkpoint
20.2.1. Enabling Identity Awareness on the Security Gateway
To enable Identity Awareness:
1. Log in to 'SmartDashboard'.
2. From the 'Network Objects tree', expand the 'Check Point branch'.
3. Double-click the 'Security Gateway' on which to enable 'Identity Awareness'.
4. In the 'Software Blades' section, select 'Identity Awareness' on the 'Network Security tab'. The
'Identity Awareness Configuration' wizard opens.
5. Select 'one or more options'. These options set the methods for acquiring identities of
managed and unmanaged assets.
6. Select 'AD Query - Lets the Security Gateway seamlessly identify Active Directory users and
computers' and click Next. The 'Integration With Active Directory' window opens.
7. Select the Active Directory to configure from the list that shows configured LDAP account
units or create a new domain. If you have not set up Active Directory, you need to enter a
domain name, username, password and domain controller credentials.
8. Enter the Active Directory credentials and click Connect to verify the credentials. (Important -
For AD Query you must enter domain) administrator credentials.
9. Click Finish.
To select gateway interfaces: 1. In the 'RADIUS Client Access Permissions' section, click Edit. 2.
Select 'All Interfaces - All Security Gateway interfaces can accept connections from RADIUS
Accounting clients'. 3. Leave the default port to 1813. 4. Click OK on both windows to submit the
configuration. 5. Select 'Policy' > 'Install' from the SmartDashboard menu.
Then add each of your PacketFence servers as Syslog providers using the syslog template you
created above. In the case of a cluster, add each member management IP and the management
virtual IP.
In your DNS servers, make sure the FQDN and reverse lookup entries match your
NOTE
PacketFence server FQDN.
You should then see User Sessions populating under “Live Logs” in ISE-PIC. The source should
say "syslog"
20.4. FortiGate
20.4.1. Configuration of the RSSO Agent
Go to your FortiGate administration webpage in User & Device → User → User Groups →
Create New.
• Name: RSSO_group
• Type: RADIUS Single Sign-On (RSSO)
• RADIUS Attribute Value: RSSO_Student (use the rolename of PacketFence, it’s case sensitive)
Select the interface that will communicate with PacketFence and check 'Listen for RADIUS
Accounting Messages' then confirm.
20.5. iBoss
20.6. JSON-RPC
20.6.1. JSON-RPC interface
The JSONRPC module shipped with PacketFence is meant as a generic firewall SSO module to be
used with Linux or BSD firewalls that do not by default ship with a vendor-specific interface to do
SSO with.
A compatible server must implement the methods Start and Stop, both with the identical set of
parameters provided below.
A simple JSON-RPC server written in Python that is compatible with this specification and
creates ipsets based on the SSO information provided by PacketFence can be found at
https://github.com/tribut/ipset-rpcd.
Then you need to allow traffic from the PacketFence management interface to port you set up on
webapi settings (i.e. 8443) on SRX device.
or
You will first need to create an SSO role on the web interface on the PaloAlto firewall.
Create the role name 'SSO_Role', under the 'XML API' tab, enable everything and validate it with
'OK'.
Now you have created the role, you will associate an user with it.
• Name: xmluser
• Authentication Profile: None
• Password: xmluser
• Role: Role Based
It should display:
<response status="success">
<result>
<key>
LUFRPT1jeFV6SHd1QnJHaU55dnYvRlFNSkJNeTR6Uzg9TDgzNVlj0=
</key>
</result>
</response>
Now that we have the key, we will configure the PaloAlto firewall in PacketFence.
Now we will check that PacketFence is sending information when a user registers on the portal. If
the process worked, you will see the entry in the PaloAlto database.
Create a filter
You will first need to create a filter to parse the SSO line that PacketFence will send. This can be
done in 'User Identification→User Mapping'
Next, configure the filter to be used in a syslog receiver on the Palo Alto. In order to do so, go in
'User Identification→User Mapping' and configure a syslog sender.
Verification
Now we will check that PacketFence is sending information when a user registers on the portal. If
the process worked, you will see the entry in the PaloAlto database.
If the process is not working and you get the following error Usage:
Socket::inet_ntoa(ip_address_sv), check that the hostname of your
NOTE
PacketFence server can be resolved correctly on the server itself. If its not, make
sure you adjust your hosts file or your DNS server.
PacketFence supports either Nessus and OpenVAS as a scanning engine for compliance checks.
Since PacketFence v5.1 you are now able to create multiples scan engines configuration and
assign them on specific captive portals. It mean per example that you are now able to active a
scan for specific Operating System only on a specific SSID.
21.1. Installation
21.1.1. Nessus
Please visit https://www.tenable.com/downloads/nessus to download Nessus v7 and install the
Nessus package for your operating system. You will also need to register for the HomeFeed (or
the ProfessionalFeed) in order to get the plugins.
After you installed Nessus, follow the Nessus documentation for the configuration of the Nessus
Server, and to create a user for PacketFence.
You may run into some issue while using Nessus with the Net::Nessus::XMLRPC
NOTE module (which is the default behavior in PacketFence). Please refer to the bug
tracking system for more information.
21.1.2. OpenVAS
Requirements
You will first need to install OpenVAS along with XYZ and ABC in order to manage OpenVAS
remotely via the omp command line.
In order to validate proper connectivity from PacketFence to OpenVAS for remote management,
execute the following command (replacing admin by the user you wish to use for PacketFence to
communicate with OpenVAS):
The output of the above command should provide you the version of OpenVAS. Otherwise,
ensure all the necessary components are in place for management through the omp command line
client and that PacketFence is able to communicate with OpenVAS on port 9390.
You will need to configure an alert policy in OpenVAS to inform PacketFence of the completion of
a task. The httpd.portal daemon takes care of handling this callback so you’ll want to make sure
that you have "portal" in your additionnal listening daemons on your management interface in
PacketFence.
Where:
Once you have connectivity working between PacketFence and OpenVAS, use the Greebone
Security Assistant to obtain the following information for configuring PacketFence
Alert ID
Navigate to Configuration → Alerts, then click on the alert you’ve configured above to view it, and
note down the ID of the alert.
Navigate to Configuration → Scan Configs and then select the scan configuration you would like to
use to scan the hosts. In this scan config view, note down the ID.
Report format ID
Navigate to Configuration → Report Formats and then select the CSV Results report format. In
this view, note down the ID.
21.2. Configuration
In order for the compliance checks to correctly work with PacketFence (communication and
generate security events inside PacketFence), you need to configure these sections:
Specific to Nessus:
Specific to OpenVAS:
Rules syntax
The syntax of the rules are simple to understand and use same syntax as VLAN filters.
• Request is the SQL request you will launch on the remote device, you must know what the
request will return to write the test.
The test bloc is a simple test based on the result of the request:
The action bloc is where you will define your logic. All actions available are identical to VLAN
filters. Take a look at /usr/local/pf/conf/vlan_filters.conf.example for all available actions.
Using Nessus:
Using OpenVAS:
Where security event ID is either the ID of the Nessus plugin or the OID of the OpenVAS
plugin to check for. Once you have finished the configuration, you need to reload the security
event related database contents using:
NOTE Security events will trigger if the plugin is higher than a low severity vulnerability.
• PacketFence needs to be able to communicate to the server on the port specified by the
vulnerability engine used
• The scanning server need to be able to access the targets. In other words, registration VLAN
access is required if scan on registration is enabled.
• The scanning server need to be able to reach PacketFence’s Admin interface (on port 1443 by
default) by its DNS entry. Otherwise PacketFence won’t be notified of completed scans.
• You must have a valid SSL certificate on your PacketFence server
• You just have to change the host value by the Nessus server IP.
Make sure that you create a site for the devices you want to manage in Rapid7,
NOTE
you will need to reference it in the PacketFence configuration
First, you will need to create credentials for PacketFence so that it can perform API calls on
Rapid7. In order to do so, on Rapid7, go in Administration → Users and click on Create. Then
configure the appropriate username and password and make sure the account is enabled.
Next, in the roles of that user, select the "Custom" role and assign at least the following privileges
to the new user:
• Manage Sites
• Manage Scan Enginespfcron
• View Site Asset Data
• Specify Scan Targets
• View Group Asset Data
Once you have the user created, you need to create the scan engine by going in Configuration →
Compliance → Scan Engines and creating a New Scan Engine of the type Rapid7
• 172.20.20.230 is the IP address (hostname can also be configured) of your Rapid7 server
• Verify Hostname must be disabled unless you have a valid SSL certificate configured for the
configured Rapid7 hostname
• Roles and OS represents the roles and operating systems for which you want to apply this
scan engine. Leaving them empty will apply the policy to all devices.
• Scan before/on/after registration controls when the automated scans are started for the
devices PacketFence sees. If you only want to start the scans manually, leave those
unchecked.
• You will not be able to select a scan template, site and scan engine when initially configuring
the engine. First configure the access and credentials and edit the engine again to be able to
select those from the available values in Rapid7.
With the scan engine now created, you need to assign it to the connection profile that your
endpoints use. In order to do so, go in Configuration → Connection Profiles, select your connection
profile and add your scan engine there.
With the scan engine integration completed, PacketFence will now automatically start scans on
the endpoints it sees DHCP for and you will be able to view the Rapid7 information of the
endpoints by going in the Nodes tab in PacketFence and then viewing a node and browsing its
Rapid7 tab.
In Rapid7:
• First select the site you want to have alerts for and click on Manage Site
• In the site management tabs select Alerts, then create a new alert
If you are using a PacketFence cluster, you will need to do these steps on all
WARNING
your PacketFence servers.
First, logon to PacketFence Server with a ssh terminal, then create the fifo pipe file that
PacketFence will use to get data from Rapid7.
mkfifo /usr/local/pf/var/run/nexpose_pipe
Next, modify /etc/rsyslog.conf to accept syslogs data on 'udp 514' by uncommenting the
following two lines:
$ModLoad imudp
$UDPServerRun 514
You can see if the Nexpose server is sending to the right server by monitoring the
traffic using tcpdump -i any dst host YOUR_PACKETFENCE_SERVER_IP on your
TIP
Rapid7 Nexpose server and tcpdump -i any src host YOUR_RAPID7_IP on the
PacketFence server.
Now that PacketFence is properly configured to receive information from Nexpose, we can
configure it to perform some actions on the alerts it receives. In the PacketFence GUI, go to
Configuration → Compliance → Security Events and create a new security event.
Make sure you set the following parameters in the 'Definition' tab:
• Enable: Set it to ON
• Action: This is where you put what you want PacketFence to do, refer to the security events
documentation in this guide for details on these.
For more info on security event actions, go to the Blocking malicious activities with security events
section of this guide.
Apple devices such as iPhones, iPads, iPods and Mac OS X (10.7+) support wireless profile
importation using a special XML file format (mobileconfig). Android is also able to support this
feature by importing the wireless profile with the Android PacketFence Agent. In fact, installing
such file on your Apple device will automatically configure the wireless settings for a given SSID.
This feature is often used when the SSID is hidden, and you want to ease the configuration steps
on the mobile device (because it is often painful to configure manually). In PacketFence, we are
going further, we generate the profile according to the administrator’s preference and we pre-
populate the file with the user’s credentials (without the password). The user simply needs to
install its generated file and he will be able to use the new SSID.
The Windows agent will import and apply the provisioned profile so that the user only needs to
enter his username and password.
First of all, you need to configure the SSID that your devices will use after they go through the
authentication process.
After, you simply need to add the 'Android', 'iOS' and 'Windows' provisioners to your 'Connection
Profile' configuration. If no connection profile is defined, configure the 'default' connection profile
to use the provisioners created.
If you use two different connection profiles for the open and secure networks,
NOTE
make sure you configure the provisioners on both profiles.
To add a new provisioner for another class of devices to be supported, click on the Add
Provisioner button, and fill out the form, choosing a different Provisioning ID per provisioner.
• Roles: this field defines which devices will be affected by the provisioning item. If empty, all
devices for this class will be affected.
We also advise you to configure a SSID for provisioning, for instance: OnBoarding-PF, open with
MAC Authentication, pointing to PacketFence. Create a New Portal Profile, add a filter SSID
with this SSID name, add the source you want the users to authenticate from and add your
provisioners to this Portal Profile. From there, users who logged in will have to follow the captive
portal instruction to get provided their certificate.
Android specifications
For Android provisioning support, you must activate and adjust the passthroughs. You might need
to adapt them depending on your geolocality.
*.ggpht.com,*.googleusercontent.com,android.clients.google.com,*.googleapis.com
,*.android.clients.google.com,*.gvt1.com,*.l.google.com,play.google.com,*.gstat
ic.com
Next, make sure you are using a valid SSL certificate on your captive portal since Android devices
will only be able to be provisioned on a captive portal that uses valid HTTPS
Some Android devices may use their cellular connection when running the
PacketFence agent during the onboarding process. If that is the case, enable the
NOTE
airplane mode on the Android device and then only enable WiFi during the
onboarding process.
iOS specifications
Mac OS X/iOS require the provisioning profile to be signed if you want to remove the untrusted
warning when installing the profile. For more information, please refer to the PKI guides referred
earlier in 'Configure the feature' above.
Let’s say that you now need to add some 'Linux computers' as 'corporate' devices.
Those devices cannot be authenticated via Machine Authentication, so we will need to use EAP-
TLS and provide those devices with a certificate.
First of all make sure that your RADIUS certificate from the PacketFence server and the
certificates that you will be provided are delivered from the same CA, else your authentication
will not work. To enable EAP-TLS you will need to reconfigure the new RADIUS server certificate
in the file conf/radiusd/eap.conf.
While creating the RADIUS server certifcate make sure to have the Extended key usage:
servAuth.
Under the section tls-config tls-common, search for `private_key_file', `certificate_file' and
`ca_file'. Those should contain respectively the path of:
If you have an OCSP capable PKI you can configure it in the section OCSP in the eap.conf file.
Lastely you will need to restart RADIUS to ensure the use of the new configuration and
certificates. Please do the following:
Now that your RADIUS is ready to handle EAP-TLS, configure your SSID connection profile on
the corporate device using this method. Generate a client certificate for your device and install it
on.
Please configure an EAPTLS source which can be found while adding a new sources under
Configuration → Policies and Access Control → Authentication Sources New internal Source →
EAPTLS, simply give it a name, a description and a catch-all rule. This will allow you to validate the
authentication via EAP-TLS.
You can now create a new Portal Profile for EAP-TLS. Under the tab configuration, section
Configuration → Policies and Access Control → Connection Profiles, New Connexion Profile and
select as a filter the Sub Connection Type as EAP-TLS, add your source EAP-TLS. Check the box
"Automatically register devices".
You now have a full flow working for your corporate devices.
22.2. MobileIron
22.2.1. Configure MobileIron
First of all you will need to configure the basic functionality of MobileIron using their
documentation.
MDM profile
One important step is to enable the MDM profile like in this screenshot. Note that this will
require you to create an MDM certificate with Apple. Refer to the MobileIron documentation for
specifics about this step.
First go in the 'USERS & DEVICES' tab and then in 'Users' and click 'Add local user'.
Now go in the 'ADMIN' tab, check the box next to your newly created user and then in 'Actions'
Select the Global space at the top and then check API at the bottom. You should now see API in
the roles list of your newly created user when viewing the users list.
In it you will find the boarding host and port for the PacketFence configuration. In this case, the
boarding host is m.mobileiron.net and the boarding port is 50291.
Login in the PacketFence administration interface, then go in the 'Configuration' tab, then in
'Provisioners'. Click 'Add provisioner' then select 'mobileiron'.
Here are the URIs that should work by default. Replace accountName by your real
account/instance name at MobileIron.
• Android: https://m.mobileiron.net/accountName/c/d/android.html
• IOS devices: https://m.mobileiron.net/accountName/c/d/ios.html
• Windows: https://m.mobileiron.net/accountName/EnrollmentServer/Discovery.svc
In order for the provisioner to be used by your captive portal you need to add it in its
configuration. Go in 'Connection Profiles', then select the portal you want to modify and add
'mobileiron' as a provisioner.
Check the 'Passthrough' box above the field and add the following domains to the passthrough
list.
• m.mobileiron.net
• *.itunes.apple.com
• itunes.apple.com
• play.google.com
• *.play.google.com
In order to enable the boarding passthrough for the device enrollment, you will need to restart
the iptables service of PacketFence.
You can do this using the command line by doing '/usr/local/pf/bin/pfcmd service iptables restart'
or in the administration interface under 'Status / Services'.
22.2.6. Testing
You can now test that MobileIron is mandatory after the device registration. Connect a device to
your test network and register like you normally would. At the end of the registration process you
will be presented a page asking you to install the MobileIron on your device. After you install the
agent click 'Continue'. If your access is enabled than this means the connectivity between
PacketFence and MobileIron is good.
22.3. SentinelOne
22.3.1. Download the agents
You will first need to download the SentinelOne agents in order to host them on the PacketFence
server.
Login in the PacketFence administration interface, then go in the 'Configuration' tab, then in
'Provisioners'. Click 'Add provisioner' then select SentinelOne.
Now that you have created the provisioner, go in the 'Connection Profiles' menu on the left and
select the default connection profile. Click 'Add Provisioner' and select the new SentinelOne that
was created earlier.
Make sure you have passthroughs enabled before proceeding further. Instructions
NOTE on how to enable passthroughs can be found in the 'Passthroughs' section of the
Administration Guide.
Once you have completed the configuration, you need to restart pfdns in order for the
SentinelOne specific passthroughs to be taken into consideration.
22.3.4. Testing
You can now test that the installation of the SentinelOne client is mandatory after the device
registration. Connect a device to your test network and register like you normally would. At the
end of the registration process you will be presented a page asking you to install the SentinelOne
client on your device. After you install the client click continue. If your access is enabled then this
means the connectivity between PacketFence and SentinelOne is good.
PacketFence polls SentinelOne at a regular interval (30 seconds by default) to find devices that
have uninstalled their agent. When it detects them as uninstalled, it automatically brings the
device back to the portal so the agent is installed.
Everytime your device connects to PacketFence using RADIUS, it schedules a provisioning check
to occur 2 minutes after the connection (controlled via security event 1300002). If the agent is
inactive on the device or was uninstalled, PacketFence will bring the device back to the portal so
the agent is installed again or brought back to an active state.
Once you are logged in the portal you need to create an application to allow the access to the
Graph API.
Click on 'Azure Active Directory' and on 'App registrations' and on 'New registration'
Set a name for the application (in this case PacketFence) and choose as 'Supported account types'
: 'Accounts in this organizational directory only' and click 'Register'
Next click on 'Certificates & secrets' and 'New client secret' , this will provide you the password to
use for the application (Save it right now because you won’t be able to have it after).
Device.ReadWrite.All
DeviceManagementManagedDevices.Read.All
Login in the PacketFence administration interface, then go in the 'Configuration' tab, then in
'Provisioners'. Click 'Add provisioner' then select Microsoft Intune.
Now that you have created the provisioner, go in the 'Connection Profiles' menu on the left and
22.4.3. Testing
You can now test that the installation of the Microsoft Intune client is mandatory after the device
registration. Connect a device to your test network and register like you normally would. At the
end of the registration process, you will be presented a page asking you to install the Intune client
on your device. After you install the client click continue. If your access is enabled then this
means the connectivity between PacketFence and Azure is good.
22.7. Kandji
22.7.1. Configure Kandji
First of all you will need to configure the basic functionality of Kandji using their documentation
and enable a blueprint to apply on your devices.
In the Kandji admin panel, first go in the 'Settings' tab and then in 'Access'.
Note down the value of Your organization’s API URL for usage in the PacketFence
configuration.
Create your API token by giving it a meaningful name and you will then be presented the API
token
Note the API token for usage in the PacketFence configuration, then hit 'Next'.
Login in the PacketFence administration interface, then go in the 'Configuration' tab, then in
'Provisioners'. Click 'Add provisioner' then select 'Kandji'.
Now configure this new provisioner with the information you got above.
• The API token is the token you obtained in the instructions above
• The host is obtained by the value of your organization’s API URL. For example, if your API
URL is https://foo.clients.us-1.kandji.io/api/v1/, the host will be foo.clients.us-
1.kandji.io
• The enroll URL can be obtained in the 'Add devices' menu of the Kandji admin panel under
'Enrollment Portal Link'
In order for the provisioner to be used by your captive portal you need to add it in its
configuration. Go in 'Connection Profiles', then select the portal you want to modify and add your
new provisioner in the list.
Next, still in the PacketFence administration console, go in 'Fencing' in the left menu, then scroll
then to 'Passthroughs'.
Check the 'Passthrough' box above the field and add the following domains to the passthrough
list.
Restart PacketFence
In order to enable the boarding passthrough for the device enrollment, you will need to restart
the iptables service of PacketFence.
You can do this using the command line by doing '/usr/local/pf/bin/pfcmd service iptables restart'
or in the administration interface under 'Status / Services'.
22.7.6. Testing
You can now test that Kandji enrollment is mandatory after the device registration. Connect a
device to your test network and register like you normally would. At the end of the registration
process you will be presented a page asking you to install the Kandji MDM on your device. After
you install the agent click 'Continue'. If your access is enabled than this means the connectivity
between PacketFence and Kandji is good.
23.1.1. Assumptions
• You have at least one server with PacketFence 5.4 or later.
• The server already has a properly configured switch or access point with 802.1X support.
• The PacketFence RADIUS server is working in your environment.
• You have a Microsoft Windows 2008 R2 Enterprise server installed.
• The PacketFence management IP will be 192.168.1.5.
• The RADIUS shared secret is "useStrongerSecret".
• In this guide you will see a lot of use of <ServerDNSName>, most of the MSPKI services
requires in their configuration to use the FQDN of the server and not his IP.
23.1.2. Installation
Install Active Directory Certificate Service (ADCS)
This section will cover the configuration for Active Directory Certificate Services
(ADCS) on Microsoft Windows 2008 R2 Enterprise. The installation of ADCS is
not covered by this guide, refer to the Microsoft documentation about it for more
NOTE
information (http://social.technet.microsoft.com/wiki/contents/articles/
9063.network-device-enrollment-service-ndes-in-active-directory-certificate-
services-ad-cs.aspx).
For the integration with PacketFence, the following subroles need to be installed in ADCS:
Before you start the configuration, a hotfix is necessary due to a Microsoft issue. After restarting
the ADCS service, the server cannot enroll new certificates and display the following error
message: "The RPC Server is unavailable". The hotfix is available here:
https://support.microsoft.com/en-us/kb/2633200
Communication between the MSPKI and PacketFence will be using port 80.
For the deployment of ADCS you will need to configure Network Device Enrollment Service
(NDES). This subrole will allow us to exchange certificates with the MSPKI server via Simple
Certificate Exchange Protocol (SCEP).
Challenge Password
Microsoft SCEP (MSCEP) includes by default a challenge password, which is unique and
dynamically generated for each device which wants to enroll. In a BYOD deployment, this can be
a barrier as a user cannot register a device by himself without the intervention of an
administrator. Since we use NDES with PacketFence, our security to obtain a certificate would be
the credentials necessary to access the enrollment system.
To disable the challenge password you need to modify the following key in the Windows registry.
Navigate to
Computer→HKEY_LOCAL_MACHINE→SOFTWARE→Microsoft→Cryptography→MSCEP→EnforcePassword.
Best practices recommends to extend the URL length to avoid issue with longer request.
To do so, enter the following command in the CLI on the NDES server:
Certificate Template
Remember that the validity of your CA can impact your whole certificate
CAUTION
architecture.
The goal is to deliver certificates for user Authentication, this means you will need to setup a
specific template.
First, the certificate template needs at least the following Enhanced Key Usage and Key Usage:
Once duplicated, right click your new template, go to Properties. Navigate to the tab Subject
Name. Make sure to select Supplied in the request over Built from information in Active
Directory, otherwise the requested CN will be overwritten by NDES.
To allow NDES to use this template you need to navigate to Server Manager→Roles→Active
Directory Certificates Services, expand <ServerDNSName>, right click Certificate template
and choose New template to issue, in the list select your newly created template.
Now that you choose the template to deliver you need to configure it in the registry.
• EncryptionTemplate,
• GeneralPurposeTemplate,
• SignatureTemplate.
The default value should be IPSECIntermediateOffline. Replace each value with your newly
created template name.
At this point, you need to reboot the NDES server to apply changes to the registry.
The use of SCEP with PacketFence also require a change in the IIS configuration.
Navigate to Server Manager→Web(IIS), expand Default web site then select CertSrv→mscep.
Select Authentication, and double click Anonymous Authentication. Make sure that
Application pool identity is selected.
First we need to allow the use of the template OCSPResponseSigning by the server, to do so
navigate to Server Manager→Roles→Active Directory Certificates Services, expand
<ServerDNSName>, right click Certificate template and choose New template to issue, in the
list select OCSPResponseSigning.
Choose Select a certificate for an existing enterprise CA, click Next. Click Browse and
find your enterprise CA in the list, select it, click OK and then Next. Choose Automatically
select a signing certificate, make sure Auto-Enroll for an OCSP signing certificate is
selected, then choose the default template of OCSP which is OCSPResponseSigning in the
dropdown list next to Certificate Template:. You need to add providers only if you wish to use
a CRL in addition to OCSP.
Once created, right click the revocation configuration and select Edit properties, go to the
Signing tab, then select Enable NONCE extension support then click OK.
Make sure that your OCSP server appears in the CA settings. Right click your CA, choose
Properties. Navigate to the tab Extension, in the dropdown list Select extension choose
Authority Information Access (AIA). Make sure that you have the following in the list of
locations: http://<ServerDNSName>/OCSP.
If you do not have it, add it via the button Add…. In this menu type the http:// then insert
<ServerDNSName> and type /OCSP, validate by clicking OK. Also verify that Include in the online
certificate status protocol(OCSP) extension is selected.
By default OCSP has a two days delay to refresh it’s CRL information. Which means if you revoke
a certificate on MSPKI, it will take two days before PacketFence detects the certificate is revoked.
If this delay is too long for your needs, you can change it on the NDES server. To do so, navigate
to Server Manager→Roles→Active Directory Certificate Service and right click Enterprise
PKI, in the menu select Options…. The delay can be changed by modifying the value of Set CRL
status to Expiring when expiring in: to your convenience.
Using the Microsoft PKI involves that all your certificates will be delivered by the root CA of the
MSPKI.
As for RADIUS authentication you will need to generate a certificate for PacketFence.
The next step is to create the request (CSR), a private key from the PacketFence server and
submit the CSR to the NDES server. Connect to PacketFence via SSH and type the following in
the CLI to generate the CSR and sign it with the private key:
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
You will be prompted for some information, here is an example of a valid configuration.
• CN=packetfence.local
• C=CA
• ST=QC
• Locality=Montreal
• Organization=Inverse
• Organization Unit=IT
Once you have your CSR you will submit it to the NDES server.
To submit the request you need to copy the content of the request (CSR) on the MSPKI
enrollment website. The URL to input the request will be: http://<ServerDNSName>/CertSrv/.
When reaching the website, click Request a certificate, select advanced certificate
request. Paste the content of your CSR file and select the template Web Server. Click Submit. On
this page select Base 64 encoded and click Download certificate.
This will give you the certificate (public key) for PacketFence.
Now download the CA file by reaching the following URL in your browser:
http://<ServerDNSName>/CertSrv/.
Click Download a CA certificate, certificate chain or CRL, select your CA certificate in the
list, select Base 64 as the encoding method and finally click Download CA certificate.
# mkdir /usr/local/pf/conf/ssl/tls_certs/
RADIUS EAP-TLS authentication requires three files, the CA certificate, the server certificate and
the server private key.
• Private Key of the RADIUS server (obtained while generating the CSR)
• Certificate for RADIUS (obtained from the submitted CSR)
• CA Certificate (downloaded from the NDES website)
In order to use the certificates generated by the MSPKI, edit the radius EAP configuration file.
E.g.
For example:
ocsp {
enable = yes
override_cert_url = yes
url = "http://<MSPKI ServerDNSName or IP>/ocsp"
}
Restart radiusd to regenerate the new configuration files and enable EAP-TLS using your CA
signed certificates:
Using the PKI requires configuring the PKI providers section in the PacketFence GUI under
Configuration→Advanced Access Configuration→PKI Providers. The provider configuration defines
Fill out the form for a PKI provider according to your Certificate of Authority configuration.
The "Common name attribute" field defines how the certificate will be generated and what type
of "ownership" will associate the certificate to the connection. If you select 'MAC address', a
certificate will be generated using the MAC address as the identifier. If you select 'Username', a
Provisioners Configuration
Provisioners allow devices to automatically configure themselves to connect to the proper SSID
(if applicable), use the proper authentication method (e.g. EAP-TLS) and trust the CA certificate
and any certificate signed by it.
Add a new provisioner for each of the classes of devices to be supported amongst Android, Apple
Devices and Windows. Fill out the form, choosing a different Provisioning Id per provisioner.
• Roles: The "Roles" field defines which devices will be affected by the provisioning item. If
empty, all devices for this class will be affected.
• SSID: The "SSID" field defines which SSID will be configured on the device using the
authentication profile.
• EAP-Type: The EAP type defines the authentication method supported and should be set to
EAP-TLS to integrate with the PacketFence PKI.
• Security type: The security type should be set to WPA2 to integrate with the PacketFence
PKI.
• PKI Provider: This should match the provider you configured earlier in the PKI provider
section.
Copy everything from the BEGIN to END lines. Repeat this operation for the certificate key and
intermediate certificate.
Android devices require passthroughs to be created to allow them to fetch the configuration
application from the Google Play Store.
Add the following to the "Fencing" section of the Configuration tab in the PacketFence GUI.
passthrough=enabled
passthroughs=*.ggpht.com,*.googleusercontent.com,android.clients.google.com,
*.googleapis.com,*.android.clients.google.com,*.gvt1.com
This is a way to do the procedure of enrollment manually, mainly for debugging purposes.
First you need to generate a request and its private key via the openssl command. Type following
commands in PacketFence CLI:
This will create 2 files in your current directory, local.csr and local.key.
Now you need to obtain the CA and some specific certificates from the MSPKI.
Now you need to use the "CEP encryption" certificate and the "Enrollment agent". Both were
obtained when doing the sscep getca. You should have at least three certificates with the same
name and a different number at the end. e.g. MyCA.crt-0 (Enrollment agent certificate),
MyCA.crt-1 (CEP encryption certificate) and MyCA.crt-2 (CA certificate).
In the output search for X509v3 extensions:. When using the sscep enroll command you will
need the "Enrollment agent" certificate as an argument for -c and the "CEP Encryption"
certificate as an argument for -e. -d is use for the debug output. -l is the local file where your
certificate will be save.
To verify your certificate against the OCSP you can use the following openssl command:
If you need to add domains to passthroughs, we advise you to capture the traffic coming from
the device which cannot access the Google Play Store. To do this you can use tcpdump for
instance, collect the IP address of the device then run the following in PacketFence CLI:
This will output any DNS requests from the device to PacketFence. You will need to find google
related domain and add them to your passthroughs list.
If the CA certificate is about to expire, generate a new CSR or click on Resign CA Certificate (self-
signed).
Here’s a CA example:
This will authorize the EAP TLS authentications using the PKI issued certificates.
Optionally, enable 'SCEP Server Enabled' and define an external SCEP server to proxy the
request.
SCEP Test
Let’s do a scep request by hand. Directly from the PacketFence server do that:
First, you would need to create the PKI provider that will query the PacketFence PKI for new
certifcate. Go to Configuration → Advanced Access Configuration → PKI provider
Create a certificate per user or per device mac address, this example will cover one certificate per device:
You can hand out certificates when you use intune enrolment.
First you need to create an application on Azure that allow PacketFence to connect to the Intune
API.
To do that first you have to go in Azure portal and App registration then click New registration
Then you need to generate a "Client secrets", to do that click on "Add a certificate or secret"
Previous versions used Azure Active Directory Graph which is now deprecated and will stop
working after December 2022, if you have granted those permissions you must remove them and
add the new permissions instead.
Last step is to "Grant admin", just click on "Grant admin consent for …" and click Yes
CAUTION Key storage provider (KSP) needs to be set to Enroll to Software KSP
Intune definition
First of all you have to define the configuration parameters to reach the Intune API. To do that go
in Configuration → Integration → Cloud Services → New Cloud → Microsoft Intune
Next fill the field with the values taken from the Azure portal ("Application (Client) ID" , "Directory
(tenant) ID" and "Client secrets") and Create.
SCEP configuration
Now let’s configure the PKI template to enable SCEP on it. (go to the previous section on how to
configure a template in the PKI)
Go in Configuration → Integration → PKI → Templates and edit the one you created previously.
You can see that there is a SCEP section. Enable SCEP and check Enable Cloud Integration and
select the Cloud Service you created previously. (In the case the SCEP challenge password is not
mandatory).
Intune configuration
For this section you can follow the instruction on the Microsoft web site:
https://docs.microsoft.com/en-us/mem/intune/protect/certificates-profile-scep
From the PacketFence server you will need to extract the PKI Ca certificate associated to the
template and put it in Intune as a "trusted certificate"
23.3. AirWatch
This section has been created to give a quick overview to configure AirWatch (WMware) with
PacketFence. This guide does not include advanced troubleshooting of EAP-TLS connections.
Refer to the relevant documentation of EAP-TLS, RADIUS and OpenSSL for advanced features.
The PKI comes installed by default since PacketFence version 10. All certificates would be saved
in the database. If you want to migrate your certificate from the old PacketFence PKI please see
the upgrade section.
Make sure that your PacketFence PKI Root CA validity is under 825 days and your
PacketFence PKI Template is under 398 days. References:
NOTE
https://support.apple.com/en-us/HT211025 and https://support.apple.com/en-
ca/HT210176
This section has been created to give a quick overview on how to configure MFA integration with
PacketFence.
24.1. Assumptions
You have a fonctional PacketFence server and you configured an Internal Source (like Active
Directory Source) associated to a "Connection Profile" You also have a radius client that is doing
PAP (like a VPN server or a switch with CLI access enabled to use RADIUS).
24.2.2. Assumptions
You have all the MFA information provided by Akamai to configure in PacketFence.
In this section we will configure the Akamai MFA from the administration GUI.
The App ID of the Akamai MFA: This is the App ID provided by Akamai
The signing key of the Akamai MFA: This is the signing key provided by Akamai
The verify key of the Akamai MFA: This is the verify key provided by Akamai
The callback URL to redirect back the user to PacketFence: This parameter is used when you
trigger the MFA on the portal, once authenticate on Akamai Bind v2, it redirects to this specific
URL to reach back the PacketFence’s portal. This value should be the FQDN of the portal with
/mfa at the end (https://portal.acme.com/mfa)
RADIUS OTP Method: It is where you define which method you want to use in RADIUS
(Explaination are covered in the next section)
Cache duration: The amount of time PacketFence will store the MFA information of the user
(used for "Strip OTP" and "Second Password Field" since PacketFence deal with multiple RADIUS
requests)
24.2.4. Assumptions
You have a phone where you have an MFA application compatible with TOTP (Akamai MFA,
Google Authenticator, Microsoft Authenticator, DUO).
In this section we will configure the OTP MFA from the administration GUI.
RADIUS OTP Method: It is where you define which method you want to use in RADIUS
(Explaination are covered in the next section)
Character separator: The character used to split the password and OTP when "Strip OTP"
RADIUS method is selected.
"Trigger RADIUS MFA" if you want to be triggered in RADIUS "Trigger Portal MFA" if you want to
be triggered in the Portal.
Akamai Bind v2
This section has been created to give a quick overview on how to configure Akamai Bind V2 in
PacketFence.
Assumptions
First you need to have a connection profile that use the Internal Source where you defined a
authentication rule that "Trigger Portal MFA" and also use the "Default portal policy" Root Portal
Module (There is already the MFA policy defined in it).
Once you are able to hit the portal and register with your credentials, the portal will forward you
to the Akamai Bind V2 web interface. From this page you will be able to onboard your device and
also trigger any type of MFA. Once done and authenticated, Akamai Bind V2 portal will forward
you back to PacketFence’s portal and will grant you the access.
Note: Before using Akamai MFA in the RADIUS flow, you need to onboard your device and it is a
way to do it in PacketFence.
TOTP
This section has been created to give a quick overview on how to configure TOTP in
PacketFence.
Assumptions
Connection Profile
First you need to have a connection profile that use the Internal Source where you defined a
authentication rule that "Trigger Portal MFA" and also use the "Default portal policy" Root Portal
Module (There is already the MFA policy defined in it).
PacketFence Portal
Once you are able to hit the portal and register with your credentials, the portal will show you a
QRcode you will need to scan with your device (Akamai / Goggle / Microsoft / DUO
Authenticator per example). This will configure an account where you will be able to see
"username.packetfence" and the OTP PIN code.
With that, you will be able to use this OTP on the portal to register your device.
Note: Before using OTP MFA in the RADIUS flow, you need to onboard your device on the
portal.
In this use case only the username and password is sent in the RADIUS request, the only method
available is the "push" notification. Once the user authenticated, a push notification will be sent
on his phone and the user will have to validate in order to be granted.
In this user scenario the username and password is sent but the password can be splitted with a
special character to obtain the code.
The code is the OTP code you will read on your device (the one who change every 30s)
The code can be "push" to use the default phone or "pushx" (x represent the telephone index in
the list if you have multiples one), push1 will trigger a push on the first phone, push2 on the
second one. The user needs to validate on his phone in order to grant the access.
The code can be "sms" to use the default phone or "smsx" (x represent the telephone index in the
list if you have multiples one), sms1 will trigger a push on the first phone, sms2 on the second
one. The RADIUS request will be rejected and the RADIUS client will prompt again for the
credentials.
Once the user receives the code by SMS he will need to reauthenticate with his username and
password and append the SMS code. (like password,smscode)
The code can be "phone" to use the default phone or "phonex" (x represent the telephone index
in the list if you have multiples one), phone1 will trigger a push on the first phone, phone2 on the
second one. The RADIUS request will be rejected and the RADIUS client will prompt again for the
credentials.
Once the user receives the code by phone call he will need to reauthenticate with his username
and password and append the code. (like password,smscode)
In this user scenario the VPN client presents a login page with one username, password and a
second password field. In this 2nd password field you can set multiples things like:
The code is the OTP code you will read on your device (the one who change every 30s)
The code can be "push" to use the default phone or "pushx" (x represent the telephone index in
the list if you have multiples one), push1 will trigger a push on the first phone, push2 on the
second one. The user needs to validate on his phone in order to grant the access.
The code can be "sms" to use the default phone or "smsx" (x represent the telephone index in the
list if you have multiples one), sms1 will trigger a push on the first phone, sms2 on the second
one. The RADIUS request will be rejected and the RADIUS client will prompt again for the
credentials.
The code can be "phone" to use the default phone or "phonex" (x represent the telephone index
in the list if you have multiples one), phone1 will trigger a push on the first phone, phone2 on the
second one. The RADIUS request will be rejected and the RADIUS client will prompt again for the
credentials.
Once the user receives the code by phone call he will need to reauthenticate with his username
and password and set the code received by phone in the 2nd password field.
25.1. IPTables
IPTables is now entirely managed by PacketFence. However, if you need to perform some custom
rules, you can modify /usr/local/pf/conf/iptables.conf to your own needs. However, the
default template should work for most users.
In order to mitigate the problem, you need to tweak kernel settings. In order to enlarge the ARP
cache table on a live system, change the following in sysctl.conf :
net.ipv4.neigh.default.gc_thresh1 = 2048
net.ipv4.neigh.default.gc_thresh2 = 4096
net.ipv4.neigh.default.gc_thresh3 = 8192
# sysctl -p
This means that the layer 2 garbage collection will kick in at 2048 MAC addresses exposed to the
server with the most aggressive collection kicking in at 8192. This should be large enough for
most but feel free to increase if necessary (at the cost of more kernel memory consumed).
Another approach to solve this problem is to do more segmentation of your layer 2 networks.
If you have multiple Active Directory servers, you will want to apply the following set of best
practices to your installation so that PacketFence is able to efficiently detect a failure of one of
your AD server and switch to the next one. This is even more important if your PacketFence
deployment points to Active Directory servers located in 2 different availability zones (i.e. 2
different datacenters).
Some versions of samba/winbindd may not failover correctly when one of the DC fails, even with
the best practices above. For this reason, it is suggested to enable monit on your installation. This
will automatically activate an additional check that will restart winbindd if authentication fails to
the current DC. Upon restart, a new DC will be found and authentication will resume. To enable
this mecanism, enable monit as described in this section of the document and it be added
automatically.
search example.com
options timeout:1
options retries:1
nameserver 10.0.1.100
nameserver 10.0.2.100
nameserver 10.0.1.101
Once the DNS servers of the OS are setup to fail-over efficiently, you will need to review the
configuration of the different Active Directory sources you have in PacketFence
('Configuration→Policies and access control→Authentication Sources'). In these sources, you will
need to ensure that you are either using a DNS name that resolves to multiple servers of your
Active Directory domain or that multiple IP addresses are specified to connect. If you are not sure
about the robustness of your DNS layer, use multiple IP addresses.
The cache requires minimally Windows Server 2008. Older versions will not
CAUTION
work.
When using NTLM authentication against an Active Directory for 802.1X EAP-PEAP connections,
this can become a bottleneck when handling dozens of authentications per seconds.
To overcome this limitation, it is possible to use a Redis driven cache inside PacketFence to
reduce the amount of authentications requiring an external NTLM authentication call. Should a
user be in the cache, PacketFence will attempt to compare the 802.1X credentials with those. In
the even that the validation fails, a call to ntlm_auth is made. In the event of a cache miss, an
ntlm_auth call is made as well. This ensures that even if a user changes his password, his new
password is immediately valid for 802.1X EAP-PEAP connections even if the cache contains the
outdated entry.
The NTLM cache doesn’t cache clear text passwords, it caches the NT hash of
NOTE
the user password.
Once that is done, you need to configure PacketFence to start caching the credentials. In order to
do so, go in Configuration → Policies and Access Control → Domains → Active Directory Domains
and select the domain you want to cache the credentials for.
After that, you will need to enable the redis_ntlm_cache service which is used by PacketFence
to store the cached credentials. In order to do so, go in Configuration → System Configuration →
Main Configuration → Services and enable 'redis_ntlm_cache' and save the changes.
Please refer to the following Microsoft KB entry to configure the replication rights (Replicating
Directory Changes and Replicating Directory Changes All): https://support.microsoft.com/en-us/
kb/303972
Because of that, it is possible to limit the number of SNMP traps coming in from a single switch
port and take action if that limit is reached. For example, if over 100 traps are received by
PacketFence from the same switch port in a minute, the switch port will be shut and a
notification email will be sent.
Here’s the default config for the SNMP traps limit feature. As you can see, by default,
PacketFence will log the abnormal activity after 100 traps from the same switch port in a minute.
These configurations are in the conf/pf.conf file:
[snmp_traps]
trap_limit = enabled
trap_limit_threshold = 100
trap_limit_action =
Alternatively, you can configure these parameters from the PacketFence Web administrative GUI,
in the Configuration → Network Configuration → SNMP section.
# uptime
11:36:37 up 235 days, 1:21, 1 user, load average: 1.25, 1.05, 0.79
# iostat 5
avg-cpu: %user %nice %sys %iowait %idle
0.60 0.00 3.20 20.20 76.00
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
cciss/c0d0 32.40 0.00 1560.00 0 7800
avg-cpu: %user %nice %sys %iowait %idle
0.60 0.00 2.20 9.20 88.00
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
cciss/c0d0 7.80 0.00 73.60 0 368
avg-cpu: %user %nice %sys %iowait %idle
0.60 0.00 1.80 23.80 73.80
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
As you can see, the load-average is 1.25 and iowait is peaking at 20% - this is not good. If your
iowait is low but your MariaDB is taking over %50 CPU this is also not good. Check your
MariaDB install for the following variables:
PacketFence relies heavily on InnoDB, so you should increase the buffer_pool size from the
default values.
# uptime
12:01:58 up 235 days, 1:46, 1 user, load average: 0.15, 0.39, 0.52
# iostat 5
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
cciss/c0d0 8.00 0.00 75.20 0 376
This will grind PacketFence to a halt so you want to avoid that at all cost. One way to do so is to
increase the number of maximum connections (see above), to periodically flush hosts or to allow
more connection errors. See http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html for
details.
This is fixed easily by using MariaDB-backup which can complete a full database backup without
locking your tables.
RHEL-based systems
Once this is done, grant the proper rights to the pf user (or the one you configured in pf.conf):
# mysql -u root -p
MariaDB> GRANT PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO
'pf'@'localhost';
If the backup fails, check /usr/local/pf/logs/innobackup.log for details and refer to the
MariaDB-backup documentation for troubleshooting.
In the event that you want to stop using MariaDB-backup for your MariaDB
NOTE
backups, simply uninstall it and the database script will fallback to mysqldump.
Solution:
# cd /usr/local/pf
# bin/pfcmd service httpd.admin start
• It is strongly advised that you update your browser to Internet Explorer 11 or download an
alternative.
• TLSv1.2 needs to be activated manually in Internet Explorer 8-10.
Within Internet Explorer: click `Tools -> Internet Options -> Advanced` and
make sure that TLS v1.2 is enabled under the security section. Retry.
Currently only Cisco and Nortel switches configured with port-security are
CAUTION
supported.
A regular device is placed in the VLAN corresponding to its status (Registration, Isolation or
Production VLAN) and is authorized on the port (port-security). This is not managed the same
way as a floating network device.
When a floating network device is connected, PacketFence will let/allow all the MAC addresses
are connected to this device or appear on the port. If necessary the port is configured as multi-
vlan (trunk) the PVID is set and VLANs are tagged on the port.
When a floating network device is disconnected, PacketFence will reconfigure the port to what it
was before the device connected.
When a port-security trap is received for a floating network device, the port configuration is changed with:
• disable port-security
• set the PVID
• eventually set the port as multi-vlan (trunk) and set the tagged VLANs
• enable linkdown traps
When a linkdown trap is received on a port in which a floating network device was connected, the port
configuration is changed with:
• enable port-security
• disable linkdown traps
27.1.2. Identification
Each floating network device has to be identified. There are two ways to do this:
• by editing /usr/local/pf/conf/floating_network_device.conf
• through the Web GUI, in Configuration → Network Configuration → Floating Device
MAC Address
MAC address of the floating device.
IP Address
IP address of the floating device (not required, informational only).
trunkPort
Should the port be configured as a multi-vlan port (yes/no)?
pvid
Port VLAN.
taggedVlan
Comma separated list of VLANs. If the port is a multi-vlan, these are the VLANs that are
tagged on the port.
To have the ability to isolate a node or to have IP information about a node within a network or
VLAN, one of the following techniques must be used.
This is not required for the Registration or Isolation VLANs and inline interfaces
NOTE
since PacketFence acts as the DHCP server within these networks.
27.2.1. IP Helpers
If IP-helpers for your production DHCP in your production VLANs are already being used then
this approach is the simplest to setup and works the best.
No DHCP Server should be listening on the interface where these requests are being sent,
otherwise PacketFence would pointlessly reply to all DHCP requests.
/etc/sysconfig/network-scripts/ifcfg-eth2:
DEVICE=eth2
ONBOOT=yes
Add to /usr/local/pf/conf/pf.conf:
[interface eth2]
mask=255.255.255.0
type=dhcp-listener
gateway=192.168.1.5
ip=192.168.1.1
NOTE The IP address is not important and is only used to start PacketFence.
On the network side ensure that the VLAN reaches from your client to the DHCP infrastructure
to the PacketFence server.
First configure an operating system VLAN interface in PacketFence like the example below
/etc/sysconfig/network-scripts/ifcfg-eth0.1010:
# Engineering VLAN
DEVICE=eth0.1010
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.101.4
NETMASK=255.255.255.0
VLAN=yes
[interface eth0.1010]
mask=255.255.255.0
type=dhcp-listener
gateway=10.0.101.1
ip=10.0.101.4
Repeat the above steps for all production VLANs then restart PacketFence to apply the changes.
For dhcpd, ensure the clients DHCP requests are being forwarded correctly (IP Helpers in the
remote routers) to the PacketFence server.
[interface eth0.2]
enforcement=vlan
ip=192.168.2.1
type=internal
mask=255.255.255.0
[interface eth0.3]
enforcement=vlan
ip=192.168.3.1
type=internal
mask=255.255.255.0
Provide the routed networks to PacketFence through the GUI in Configuration → Network
Configuration → Networks or manually in /usr/local/pf/conf/networks.conf.
Example /usr/local/pf/conf/networks.conf:
[192.168.2.0]
netmask=255.255.255.0
gateway=192.168.2.1
next_hop=
domain-name=registration.example.com
dns=192.168.2.1
dhcp_start=192.168.2.10
dhcp_end=192.168.2.200
dhcp_default_lease_time=300
dhcp_max_lease_time=600
type=vlan-registration
named=enabled
dhcpd=enabled
[192.168.3.0]
netmask=255.255.255.0
gateway=192.168.3.1
next_hop=
domain-name=isolation.example.com
dns=192.168.3.1
dhcp_start=192.168.3.10
dhcp_end=192.168.3.200
dhcp_default_lease_time=300
dhcp_max_lease_time=600
type=vlan-isolation
named=enabled
dhcpd=enabled
[192.168.20.0]
netmask=255.255.255.0
gateway=192.168.20.254
next_hop=192.168.2.254
domain-name=registration.example.com
dns=192.168.2.1
dhcp_start=192.168.20.10
[192.168.30.0]
netmask=255.255.255.0
gateway=192.168.30.254
next_hop=192.168.3.254
domain-name=isolation.example.com
dns=192.168.3.1
dhcp_start=192.168.30.10
dhcp_end=192.168.30.200
dhcp_default_lease_time=300
dhcp_max_lease_time=600
type=vlan-isolation
named=enabled
dhcpd=enabled
DHCP clients on the Registration and Isolation networks receive the PacketFence server IP as
their DNS server in their lease, then DNS responses are spoofed to force clients via the portal.
However, clients could manually configure their DNS settings to escape the portal. To prevent
this, apply an ACL on the access router nearest to the clients, permitting access only to the
PacketFence server and local DHCP broadcast traffic.
If the edge switches support 'vlan-isolation' the ACL can also be applied there. This has the
advantage of preventing machines in Isolation from attacking each other.
PacketFence needs to know which switches, access points or controllers it manages, their type
and configuration. You can modify this configuration directly in
/usr/local/pf/conf/switches.conf or from the Web Administration GUI in Configuration →
Policies and Access Control → Switches (recommended).
/usr/local/pf/bin/pfcmd configreload
Any ports declared as uplinks are ignored and not managed by PacketFence. This
parameter is defined in the [default] section of
NOTE
/usr/local/pf/conf/switches.conf. A different uplink list for each switch can
be defined.
Testing
pfsetvlan writes in the log files what it would normally do, but no VLAN changes are
performed.
Registration
pfsetvlan automatically registers all MAC addresses seen on the switch ports, but no VLAN
changes are performed.
Production
pfsetvlan sends the SNMP writes to change the VLAN on the switch ports.
27.4.2. RADIUS
To set the RADIUS secret, set it from the Web Administrative GUI when adding a switch.
Alternatively, edit the switch configuration file /usr/local/pf/conf/switches.conf and set the
following parameters
SNMPVersion = 3
SNMPEngineID = AA5ED139B81D4A328D18ACD1
SNMPUserNameRead = readUser
SNMPAuthProtocolRead = MD5
SNMPAuthPasswordRead = authpwdread
SNMPPrivProtocolRead = AES
SNMPPrivPasswordRead = privpwdread
SNMPUserNameWrite = writeUser
SNMPAuthProtocolWrite = MD5
SNMPAuthPasswordWrite = authpwdwrite
SNMPPrivProtocolWrite = AES
SNMPPrivPasswordWrite = privpwdwrite
SNMPVersionTrap = 3
SNMPUserNameTrap = readUser
SNMPAuthProtocolTrap = MD5
SNMPAuthPasswordTrap = authpwdread
SNMPPrivProtocolTrap = AES
SNMPPrivPasswordTrap = privpwdread
Switch Configuration
Set the following switch configuration in order to enable SNMPv3 in both directions on a Cisco
Switch.
Obtain the SNMPv3 engine identifier (SNMPEngineID) with show snmp engineid.
PacketFence can occasionally establish an interactive command-line session with a switch. This
can be done using either Telnet or SSH. Edit the switch configuration file
/usr/local/pf/conf/switches.conf and set the following parameters or :
This can also be configured with the Web Administration GUI in Configuration → Policies and
Access Control → Switches.
This can also be configured with the Web Administration GUI in Configuration → Policies and
Access Control → Switches.
The current role assignment strategy is to assign the role along with the VLAN
NOTE
(this may change in the future).
Example that returns the full-access role to the nodes categorized as admin or engineering and
the role little-access to nodes categorized as sales:
adminRole=full-access
engineeringRole=full-access
salesRole=little-access
This can also be configured with the Web Administration GUI in Configuration → Policies and
Access Control → Switches.
Ensure the roles are defined in the network devices prior to configuring role-
CAUTION
based assignment.
Many other vendors support LLDP or LLDP-MED. Link Layer Discovery Protocol (LLDP) is a
vendor-neutral Link Layer protocol in the Internet Protocol Suite used by network devices for
advertising their identity, capabilities, and neighbors. Same as CDP, LLDP can instruct an IP Phone
which VLAN ID is the voice VLAN.
Port-security
Using port-security, the VoIP device relies on CDP/LLDP to tag the ethernet frames using the
configured voice VLAN on the switch port. Afterwards a security trap is sent from the voice
VLAN so PacketFence can authorize the MAC address on the port. When the device connects
another security trap is sent from the data VLAN. That way, 1 MAC address is authorized on the
voice VLAN, and 1 on the access VLAN.
Not all vendors support VoIP on port-security, please refer to the Network
NOTE
Configuration Guide.
On other vendor hardware VoIP works using RADIUS VSAs. When an IP phone connects to a
switch port, the proper VSA is returned to instruct the switch to allow tagged frames from this
device. When a PC connects, PacketFence will return the standard RADIUS tunnel attributes to
the switch, for the untagged VLAN.
NOTE Refer to the Network Configuration Guide for switch hardware VoIP support.
For this scenario to work, the Registration and Production DHCP servers must be configured to
provide the DHCP option, there is a voice VLAN configured on the port, and IP Phones are auto-
registered (On the first connection, the phone is assigned on the registration VLAN).
All switches must be added and SNMP read (switch and PacketFence side) enabled in
Configuration → Policies and Access Control → Network Devices → Switches.
These sensors capture low-level packets on the DHCP server and forwards them to the
PacketFence management interface.
This installs nPCAP, nssm, launches a configurator for the interface, IP and port, saves the
configuration, and finally installs and launches the DHCP-Forwarder service.
When asked for a host IP and UDP port for DHCP mirroring provide the PacketFence
management IP and 767 respectively.
wget http://inverse.ca/downloads/PacketFence/CentOS6/extra/x86_64/RPMS/udp-
reflector-1.0-6.1.x86_64.rpm
wget http://inverse.ca/downloads/PacketFence/CentOS7/extra/x86_64/RPMS/udp-
reflector-1.0-6.1.x86_64.rpm
• libpcap
• libpcap-devel
• gcc-c++
• where pcap0 is the pcap interface where the DHCP server listens on. (List them using
udp_reflector -l)
• where 192.168.1.5 is the management IP of the PacketFence server
###############################################################################
##########
#Powershell script to unregister deleted Active Directory account based on the
UserName.#
###############################################################################
$bytes = [System.Text.Encoding]::ASCII.GetBytes($command)
$web = [System.Net.WebRequest]::Create($url)
$web.Method = "POST"
$web.ContentLength = $bytes.Length
$web.ContentType = "application/json-rpc"
$web.Credentials = new-object System.Net.NetworkCredential($username,
$password)
$stream = $web.GetRequestStream()
$stream.Write($bytes,0,$bytes.Length)
$stream.close()
Task Scheduler → Task Scheduler Library → Event Viewer Task → Create Task
General
Name: PacketFence-Unreg_node-for-deleted-account
Check: Run whether user is logged on or not
Check: Run with highest privileges
Triggers → New
Actions → New
Settings:
At the bottom, select in the list "Run a new instance in parallel" in order to
unregister multiple nodes at the same time.
Validate with Ok and provide the account that will run this task (usually DOMAIN\Administrator).
###############################################################################
###########
#Powershell script to unregister disabled Active Directory account based on the
UserName.#
###############################################################################
###########
$bytes = [System.Text.Encoding]::ASCII.GetBytes($command)
$web = [System.Net.WebRequest]::Create($url)
$web.Method = "POST"
$web.ContentLength = $bytes.Length
Task Scheduler → Task Scheduler Library → Event Viewer Task → Create Task
General
Name: PacketFence-Unreg_node-for-disabled-account
Check: Run whether user is logged on or not
Check: Run with highest privileges
Triggers → New
Actions → New
Settings:
Validate with Ok and provide the account that will run this task (usually DOMAIN\Administrator).
###############################################################################
##########
#Powershell script to unregister locked Active Directory account based on the
UserName.#
###############################################################################
##########
$bytes = [System.Text.Encoding]::ASCII.GetBytes($command)
$web = [System.Net.WebRequest]::Create($url)
$web.Method = "POST"
$web.ContentLength = $bytes.Length
$web.ContentType = "application/json-rpc"
$web.Credentials = new-object System.Net.NetworkCredential($username,
$password)
$stream = $web.GetRequestStream()
$stream.Write($bytes,0,$bytes.Length)
$stream.close()
NOTE Change @IP_PACKETFENCE to the IP address of the PacketFence server and change
Task Scheduler → Task Scheduler Library → Event Viewer Task → Create Task
General
Name: PacketFence-Unreg_node-for-locked-account
Check: Run whether user is logged on or not
Check: Run with highest privileges
Triggers → New
Actions → New
Settings:
Validate with Ok and provide the account that will run this task (usually DOMAIN\Administrator).
Then enable CLI Access Enabled setting on the switch(s) to manage in Configuration → Network
devices → Switches.
Logs are retained on the PacketFence server and a copy is sent to the remote Syslog server(s).
28.5. Monit
monit manages and monitors processes, files, directories and filesystems on a Unix system. Monit
conducts automatic maintenance and repair, and can execute meaningful causal-actions in error
situations. E.g. Monit can start a process if it stops running, restart a process if it does not
respond and stop a process if it uses too much resources.
EL based systems:
• MONIT_PATH=/etc/monit.d
• MONIT_PATH=/etc/monit/conf.d
To simplify further documentation, $MONIT_PATH will be used as a reference to these paths herein.
Starting from PacketFence 11.1, the Monit configuration is directly managed by PacketFence.
To enable Monit, configure the following settings in Configuration → System Configuration → Main
Configuration → Monit:
• Status: enabled
• Alert Email To: The email address(es) to send the alerts. If left empty, the default email
addresses defined in Configuration → System Configuration → Main Configuration → Alerting will
be used.
• Configuration: Enter the configurations for monit to use. If left empty, the defaults should be
fine unless port-security enforcement or active/passive cluster is used.
• Mailserver: Specify the mailserver to use. This can only be used for unauthenticated relaying.
If using localhost, ensure postfix is installed and properly configured. If left empty, the SMTP
/usr/local/pf/addons/monit/monitoring-scripts/update.sh
/usr/local/pf/addons/monit/monitoring-scripts/run-all.sh
To ignore one of the checks that are being performed, add its script name in
$MONIT_PATH/packetfence/local-ignores.
For example, to ignore the script that generated the following output add
/usr/local/pf/var/monitoring-scripts/.check-epel.sh to $MONIT_PATH/packetfence/local-
ignores:
------------------------------------------
/usr/local/pf/var/monitoring-scripts/.check-epel.sh failed
Result of /usr/local/pf/var/monitoring-scripts/.check-epel.sh
The EPEL repository is enabled. This can cause disastrous issues by having the
wrong versions of certain packages installed. It is recommended to disable it
using the following command: sed -i 's/enabled\s*=\s*1/enabled = 0/g'
/etc/yum.repos.d/epel.repo
------------------------------------------
Some scripts need to run as root but are disabled by default. To run these checks add the
following in $MONIT_PATH/packetfence/local-vars:
export RUN_ROOT_SCRIPTS=1
monit summary
This section covers advanced topics in PacketFence. Note that it is also possible to configure
PacketFence manually using its configuration files instead of its Web administrative interface. It is
still recommended to use the Web interface.
All these parameters are also accessible through the web-based administration interface under
the Configuration tab. It is highly recommended that you use the web-based administration
interface of PacketFence for any configuration changes.
29.1. Reports
Using the report.conf configuration file, you can define reports that create SQL queries to view
tables in the PacketFence database. These reports will appear under the Reports menu of the
administration interface.
PacketFence comes preloaded with several reports that are optimized for most common
production use-cases in reports.conf.defaults. This file should not be modified, but can be
used to provide working examples.
Improperly formed reports can consume significant resources on the server. All
queries should be profiled and optimized to avoid service outages when executed.
NOTE
Using type=sql (script/batch mode) allows increased query and transaction
control.
The administration interface builds the structured menu by splitting and separating all the section
identifier’s by double colons "::". Identifiers without this separator are shown at the top level. Up
to a maximum of 2 sets of double colons can be used for a maximum menu depth of 3 levels. All
The following attributes are available to define a report (* mandatory attributes are marked with
an asterisk):
• type*: The type of report. Use type=abstract to use SQL Abstract and type=sql to use
MySQL script/batch mode. Each of these types have their own additional attributes which are
explained in more detail below.
• description*: A user-friendly description that provides more details about the report. Used
as a title for all charts.
• charts: A comma delimited list of charts to display. Each chart is displayed in its own tab
above the table data. There is no limit to the number of charts that can be defined. Charts are
explained in more detail below.
• columns*: A comma separated list of columns or aliases that are displayed in the table from
the SQL query (ex: node.mac, Node MAC). The table columns are displayed in the respective
order. Columns can be aliased to a more friendly name, but these aliases must be used
throughout the other attributes.
• date_limit: A PacketFence interval that defines the maximum date range allowed between
start_date and end_date. The reports user is restricted from choosing a date range that
exceeds this limit. This is used to prevent the MySQL query from consuming too much
resources with large datasets. The duration is defined as date_limit=[unit][interval] (ex:
date_limit=1D), where the unit is a positive integer and the interval is one of the following
characters:
◦ s: second(s)
◦ m: minute(s)
◦ h: hour(s)
◦ D: Day(s)
◦ W: Week(s)
◦ M: Month(s)
◦ Y: Year(s)
• formatting: A comma separated list of column or alias formatters. Each column is defined
folowed by a colon and the internal PacketFence function used to format the column value
for every row (ex: formatting=vendor:oui_to_vendor). This is used to format the query result
columns using a function to access internal PacketFence memory. The supported formatters:
◦ oui_to_vendor: format a MAC OUI to a vendor.
• has_date_range: [enabled|disabled] Display a datetime range and provide start_date and
end_date bindings. See date_limit to restrict the maximum date range.
• has_limit: [enabled|disabled] Display a limit selection and provide a limit binding.
• node_fields: A comma delimited list of fields (columns or aliases) that will be clickable from
the table of the Report and linked to the specific Node - only clickable if the reports' user has
The following attributes are available when using type=abstract(* mandatory attributes are
marked with an asterisk):
• base_conditions: A comma delimited list of conditions that is applied to the SQL query.
Conditions should match the following format : field:operator:value (ex:
auth_log.source:=:sms,auth_log.status:!=:completed).
• base_conditions_operator: [all|any] The logical SQL operator (AND|OR respectively) used
with the base_conditons.
• base_table*: The base SQL table used in the SQL query.
• date_field*: The table field (column) used to filter by the date range. When used the column
will also be used for the default sorting, unless order_fields is explicitly defined.
• group_field: The field (column) to group the query results by. No grouping is performed if
this field is empty or omitted.
• joins : The table(s), columns and aliases used to join on the base_table. See example below
and the following documentation. This attribute supports multi line blocks (heredoc), see
below.
• order_fields: A comma delimited list of fields (columns) used to order the SQL query. The
field should be prefixed of - if the sort should be made in descending order for the field (ex:
-node.regdate,locationlog.start_time,+iplog.start_time).
• searches: A comma delimited list of searchable fields (columns) that are presented to the
reports' user. This allows the user to optionally include additional criteria for the query. Each
item is defined as type:Friendly Name:tableName.columnName (ex:
searches=string:Owner:person.pid,string:Node:node.mac). Currently only the type string
is supported.
◦ type defines the type of the search, the only one currently supported is string.
◦ Display Name is the user-friendly name of the field for display.
◦ field is the SQL name of the field to search
Examples
[auth_log]
description=Authentication report
# The table to search from
base_table=auth_log
# The columns to select
columns=auth_log.*
# The date field that should be used for date ranges
date_field=attempted_at
# The mac field is a node in the database
node_fields=mac
# Allow searching on the PID displayed as Username
searches=string:Username:auth_log.pid
In this simple example, you will be able to select the whole content of the auth_log table and use
the date range on the attempted_at field as well as search on the pid field when viewing the
report.
[open_security_events]
description=Open security events
# The table to search from
base_table=security_event
# The columns to select
columns=security_event.security_event_id as "Security event ID",
security_event.mac as "MAC Address", class.description as "Security event
description", node.computername as "Hostname", node.pid as "Username",
node.notes as "Notes", locationlog.switch_ip as "Last switch IP",
security_event.start_date as "Opened on"
# Left join node, locationlog on the MAC address and class on the security
event ID
joins=<<EOT
=>{security_event.mac=node.mac} node|node
=>{security_event.mac=locationlog.mac} locationlog|locationlog
=>{security_event.security_event_id=class.security_event_id} class|class
EOT
date_field=start_date
# filter on open locationlog entries or null locationlog entries via the
end_date field
In the example above, you can see that the security_event table is left joined to the class, node
and locationlog tables. Using that strategy we make sure all the security events are listed even on
deleted nodes. Then, base conditions are added to filter out outdated locationlog entries as well
as include devices without locationlog entries. Removing those conditions would lead to duplicate
entries being shown since the report would reflect all the historical locationlog entries.
29.1.3. SQL
When type=sql PacketFence uses MySQL script/batch mode to manually build the SQL query
including the execution of multiple statements. This provides complete query control as well as
the ability to manage the SQL session and the SQL transaction. This is the preferred mode where
SQL optimization is needed to execute complex queries, or for those more comfortable with raw
(non-abstract) SQL.
Multiline block (heredoc) is required when executing multiple statements. Each statement should
be terminated with a semi-color ";".
SQL execution exits on the first error and returns the result set of the last
NOTE
successful statement.
• bindings: A comma delimited list of ordered bindings to send to the SQL script (ex:
bindings=tenant_id,start_date,end_date,cursor,limit). See Bindings below.
• cursor_type: [node|field_multi_field] Adds a cursor binding to the sql script that implements
pagination of the results. The cursor is automatically handled in the administration interface,
but its use in the sql requires special attention. If omitted the default none is used. More
information about cursors is provided below. There are 2 types of cursors:
◦ cursor_type=field: Use a single field (column or alias) for the cursor.
◦ cursor_type=multi_field: Use multiple fields (columns or aliases) for the cursor.
◦ cursor_type=offset: Use integer based offset for the cursor.
◦ cursor_type=none: No cursor is used.
• cursor_default: The default cursor used to conditionally query the results for the first page.
On subsequent pages this is replaced with the results from N+1 row of the previous page,
meaning the cursor for page 2 (with default_limit=25) will contain the value from the
column of the 26th row from the previous page.
• cursor_field: A comma delimited list of fields (columns) used for pagination.
• default_limit: The default limit passed into the bindings of the SQL script. When
29.1.4. Bindings
The bindings attribute defines an ordered comma delimited list of columns (or aliases) that are
made available to the sql script. There is no limit with the number of bindings that can used and
a binding can be repeated more than once.
Bindings are consumed in the sql using "?" in the same order that they are defined.
[single binding]
type=sql
bindings=limit
sql=SELECT * FROM table LIMIT ?;
default_limit=100
has_limit=enabled
If a binding is needed more than once within the sql, it can either be defined multiple times, or
defined once and consumed to SET a MySQL variable.
[many bindings]
type=sql
bindings=start_date,end_date,tenant_id,start_date,end_date,limit
sql= << EOT
SELECT
*
FROM tableA
JOIN tableB ON tableA.id = tableB.id
AND date BETWEEN ? AND ?
WHERE tenant_id = ?
AND date BETWEEN ? AND ?
LIMIT ?;
EOT
default_limit=100
has_date_range=enabled
29.1.5. Pagination
Pagination is supported through the use of the cursor_type, cursor_default, cursor_field,
bindings and sql attributes. Pagination supports the use of one to many columns. Special
attention must be given to the order of the final result set in order to utilize the cursor properly.
Symptoms of too few pages, or infinite loops through subsequent pages are signs of a
mismatched cursor and/or query results order.
The limit binding always has +1 added to it as PacketFence always consumes an extra row to
determine the cursor for the following page. Due to this all conditional statements must be
inclusive (ex: Bad operators "<, >", Good operators: "⇐, >="). If the column value is not unique then
cursor_type=multi_field should be used instead to avoid infinite loops.
29.1.6. Charts
Charts are defined as a comma delimited list using the chart attribute. An optional "@" symbol
can be used to delimit a chart name. A mandatory pipe (vertical-bar) | is used to delimit the chart
type and the fields. Within the fields a colon ":" is used to delimit each of the fields (if more than
one field is necessary). The general syntax is:
NOTE All charts use the same color palette to provide a visual continuity.
29.1.7. Heredoc
The joins and sql attribute support multi line block statements. All whitespace characters are
preserved. All multi line statements are pure SQL, thus the -- prefix can be used as a remark.
attribute= <<EOT
-- multi-line
-- block
-- statement
EOT
29.1.8. Troubleshooting
• If the API request returns an error or an empty response refer to the packetfence.log to
obtain the full MySQL error message.
• SQL scripts are transactional. After the script is run any variables or stored procedures created
or temporary tables created are destroyed. Any locks obtained are released.
• Modification to the configuration file only requires a /usr/local/pf/bin/pfcmd
configreload hard for the changes to take effect. The administration interface will begin
using the new script on its next request.
To minimally configure guest pre-registration, you must make sure that the following statement is
set under [guests_self_registration] in /usr/local/pf/conf/pf.conf:
[guests_self_registration]
preregistration=enabled
This parameter should be configured from the Configuration → Policies and Access Control →
Connection Profiles → Profile Name section.
A 'portal' interface type is required to use this feature. A 'portal' interface type can
NOTE
be added to any network interface using the web admin GUI.
If, for some reason the portal is modified with content that needs to be accessed from
PacketFence generated web pages, CSP can be deactivated through Configuration → System
Configuration → Main Configuration → Advanced → CSP headers for Captive Portal.
If you want to get bandwidth reports, security events or online/offline features, you need to
enable 'Process Bandwidth Accounting' in Configuration → System Configuration → RADIUS →
General menu. pfacct service needs to be restarted to apply changes.
By default, pfacct listens NetFlow traffic on localhost, using udp/2056 port to not conflict with
the fingerbank-collector (which listens NetFlow traffic on all interfaces).
pfacct must be able to map an IP address to a MAC address (from NetFlow traffic) in order to
create a record in bandwidth_accounting table. It means that PacketFence needs to be aware of
IP addresses of your nodes (default behavior on inline L2/L3 networks).
You need to adjust pfacct configuration based on your NetFlow traffic source.
• make pfacct listens on IP address where you want to receive NetFlow traffic using
netflow_address setting in Configuration → System configuration → Services menu
• enable NetFlow on all networks in Configuration → System configuration → Advanced menu
You need to enable Netflow Accounting Enabled setting when defining an inline network.
If you enable NetFlow on all networks in Configuration → System configuration → Advanced menu,
pfacct will collect NetFlow bandwidth usage for all networks instead of the ones defined in
/usr/local/pf/conf/networks.conf.
This section covers export/import mechanism available since PacketFence 11.0.0. It can be used
to automate parts of upgrades or to restore PacketFence installations.
yum localinstall
http://packetfence.org/downloads/PacketFence/RHEL8/packetfence-export-
13.1.el8.noarch.rpm
wget http://packetfence.org/downloads/PacketFence/debian/packetfence-
export_13.1.deb
dpkg -i packetfence-export_13.1.deb
/usr/local/pf/addons/backup-and-maintenance.sh
/usr/local/pf/addons/full-import/export.sh /tmp/export.tgz
The command above will create your export archive in /tmp/export.tgz. You will now need to
copy this file to your new server using SCP or your prefered mechanism.
Consequently, if you installed Mariabackup before running the import script, you should ensure
that Mariabackup is still installed at end of import.
To start the import process using the export archive you made on the current installation:
/usr/local/pf/addons/full-import/import.sh -f /tmp/export.tgz
Completed import of the database and the configuration! Complete any necessary
adjustments and restart PacketFence
If that’s not the case, check the output above to understand why the process failed.
If you experience any issues during import, you can run it again.
If all goes well, you can restart services using following instructions.
If you want to build or rebuild a cluster, you need to follow instructions in Cluster setup section.
If your previous installation was a cluster, some steps may not be necessary to do. Your export
archive will contain your previous cluster.conf file.
if you installed Mariabackup before running the import, it’s possible that you
WARNING
need to reinstall it.
apt update
apt install packetfence-upgrade
/usr/local/pf/addons/full-upgrade/run-upgrade.sh
/usr/local/pf/addons/upgrade/do-upgrade.sh
32.1. Introduction
32.1.1. Context and Objectives of the Documentation
This documentation PacketFence v11.2 and later aims to provide information and instructions on
the implementation and renewal of SSL/TLS certificates for HTTP (captive web portal + web
admin) and RADIUS.
The captive portal is a common method of user authentication on a wireless or wired network. It
allows controlling user access by redirecting them to an authentication page where they must
provide login information. The RADIUS protocol, on the other hand, is used for user
authentication and authorization on a network.
• SSL/TLS: Secure Sockets Layer/Transport Layer Security, a security protocol that allows
encrypting communications between a client and a server.
• SSL/TLS certificate: an electronic file that contains information to verify the identity of a
server and establish a secure connection.
• Certificate Authority (CA): an entity that issues and manages SSL/TLS certificates by verifying
the identity of the certificate owner.
• Intermediate Certificate: a type of digital certificate that is issued by a trusted root certificate
authority and is used to establish a chain of trust between the root certificate and end-entity
certificates.
• Private key: an encryption key used to protect confidential information, known only to the
certificate owner.
• Public key: an encryption key used to decrypt information encrypted using the private key,
known to all users.
By understanding these basic concepts, you will be better tooled to understand and implement
SSL/TLS certificates for the captive web portal and RADIUS.
Wildcard certificate is strictly restricted to HTTP, you can’t use this type of certificate for
RADIUS. If you plan to implement certificate for HTTP and RADIUS, we recommend you to use
only one certificate to facilitate management of these.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 296
32.2. You need a certificate
32.2.1. Generate a Certificate Signing Request (CSR)
To implement an SSL/TLS certificate for HTTP (captive web portal + web admin) and/or RADIUS,
the first step is to generate a Certificate Signing Request (CSR). The CSR includes information
about the organization requesting the certificate, the domain name of the captive portal, and the
private key that will be used to encrypt communications.
Generating a CSR from HTTP or RADIUS is strictly the same. If you intend to add
a certificate for both HTTP and RADIUS, you only need one CSR. In this case, you
will need to use the same private key for both HTTP and RADIUS.
NOTE Example: If you generate the CSR through HTTP, copy the HTTPs server private
key to the RADIUS server private key. You will find the private key on the web
admin Configuration → System Configuration → SSL Certificates → Edit HTTP
Certificates
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 297
This capture have been made on PacketFence v13. If you are using a lower
WARNING version (not under v11.2) Subject Alternative Names will be automatically
generated from Common Name field.
• Save the CSR to a secure location, you will need it to renew your certificate.
In the event that you have a choice between several types of certificates, like in the following
example:
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 298
Choose as Certificate (w/ issuer after), PEM encoded:
• Import or open your certificate file (.crt) with a text editor and copy/paste the content into the
"HTTPs Server Certificate" field.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 299
• Turn on the options "Find HTTPs intermediate CA(s) automatically" and "Validate certificate
chain".
• Restart haproxy-admin and haproxy-portal, one server at a time. You can do this through the
web admin page: Status → Services .
Alternatively, you can use the CLI with the following commands:
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 300
systemctl restart packetfence-haproxy-admin
systemctl restart packetfence-haproxy-portal
By following these steps, you can implement an SSL/TLS certificate for HTTP (captive web portal
+ web admin) and provide a secure connection for user authentication.
Wildcard certificate is strictly restricted to HTTP, you can’t use this type of
WARNING
certificate for RADIUS.
To install the SSL/TLS certificate on the RADIUS server, follow these steps:
• Import or open your certificate file (.crt) with a text editor, then copy and paste the key into
the "RADIUS Server Certificate" field.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 301
• Turn on the "Find RADIUS Server intermediate CA(s) automatically" and "Validate certificate
chain" option.
If you are using a private certificate that is not signed by a public certification
NOTE authority, disable "Find RADIUS Server intermediate CA(s) automatically" and add
manually your "Intermediate CA certificate(s)"
• Restart all radiusd services that are running, including radius-auth, radiusd-load-balancer,
radiusd-acct, radiusd-eduroam, and radiusd-cli. Restart them one server at a time. On the
web admin page, go to Status → Services.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 302
Alternatively, you can use the following commands in the command-line interface (CLI):
• Import or open your private key file (.key) and copy/paste the content into the HTTP Server
Private Key field.
• Import or open your private key file (.key) and copy/paste the content into the RADIUS Server
Private Key field.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 303
32.4. Renewal of your certificate if you already have your CSR
When you renew your certificate, you can reuse an existing CSR. There are two use cases:
• You generated your CSR using PacketFence web admin, you need to follow these instructions
under You need a certificate section:
◦ Install the SSL/TLS HTTP Certificate on the Server
◦ Install the SSL/TLS RADIUS Certificate on the Server
• You generated your CSR using another tool, you need to follow these instructions under You
already have an existing certificate section:
◦ Install the SSL/TLS HTTP Certificate on the server
◦ Install the SSL/TLS RADIUS certificate on the server
Extract certificate
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 304
/usr/local/pf/conf/ssl/server.key -passin pass:secret
32.7. Glossary
• .pem (Privacy Enhanced Mail): PEM is a base64-encoded certificate or key that is commonly
used for transporting certificates over the internet or through email. It is a text file that
contains a certificate or a private key in plain text.
• .pfx (Personal Information Exchange): PFX is a binary format used for storing a certificate with
its associated private key. It is often used in Microsoft Windows systems and can also contain
additional intermediate certificates required to establish a chain of trust.
• .crt (Certificate): CRT is a commonly used file extension for a digital certificate. It contains a
public key, along with additional information about the certificate, such as the issuer and
expiration date.
• .key (Key): KEY is a file extension used to indicate a private key. Private keys are used to
decrypt data that has been encrypted using the corresponding public key in a digital
certificate.
Copyright © Inverse inc. 32. PacketFence Certificates (for v11.2 and later) 305
33. Additional Information
For more information, please consult the mailing archives or post your questions to it. For details,
see:
For any questions or comments, do not hesitate to contact us by writing an email to:
[email protected].
Hourly rates or support packages are offered to best suit your needs.
Copyright © Inverse inc. 34. Commercial Support and Contact Information 307
35. GNU Free Documentation License
When executed without any arguments pfcmd returns a basic help message with all main options:
Usage:
pfcmd <command> [options]
Commands
cache | manage the cache subsystem
checkup | perform a sanity checkup and report any
problems
class | view security event classes
configreload | reload the configution
connectionprofileconfig | query/modify connection profile
configuration parameters
fingerbank | Fingerbank related commands
fixpermissions | fix permissions on pf tree
floatingnetworkdeviceconfig | query/modify floating network devices
configuration parameters
generatedockeriptables | generate and apply the rules for docker
images
generatemariadbconfig | generate the MariaDB configuration
generatemonitconfig | generate the monit configuration
generatesyslogconfig | generate the syslog configuration
help | show help for pfcmd commands
import | bulk import of information into the
database
ipmachistory | IP/MAC history
locationhistorymac | Switch/Port history
locationhistoryswitch | Switch/Port history
networkconfig | query/modify network configuration
parameters
node | manipulate node entries
pfconfig | interact with pfconfig
pfcron | run pfcron tasks
pfqueue | query/modify pfqueue tasks and counters
reload | rebuild fingerprint or security events
The node view option shows all information contained in the node database table for a specified
MAC address
First, create a restore directory, move the backup to it and gunzip the backup:
# mkdir /root/backup/restore
# cd /root/backup/restore
# cp ../packetfence-db-dump-innobackup-2016-12-20_00h31.xbstream.gz .
# gunzip packetfence-db-dump-innobackup-2016-12-20_00h31.xbstream.gz
Once done, you should have a lot of files that were extracted in the restore dir. Now, lets place
the xbstream back in the backup directory
# innobackupex --apply-log ./
We will now stop MariaDB, move the existing data directory and replace it by the data that was
extracted:
NOTE Make sure you adjust the commands above to your environment.
For XtraBackup:
For Mariabackup:
Should the service fail to start, make sure you look into the MariaDB logs.
Once done, make sure to configure the firewall policy similar to the following screenshot:
Then, perform a standard PacketFence installation on each Linode. Once completed, from
Linode’s cloud management interface, configure a NodeBalancer for ports 80, 443, 1443, 9090
and 9999 as shown in the following screenshot:
[CLUSTER]
management_ip=172.105.12.210
[cluster-1]
management_ip=192.168.139.40
[cluster-2]
management_ip=192.168.129.9
[cluster-3]
management_ip=192.168.139.254
Then, make sure you mask keepalived so it does not mount a VIP on your server:
Finally, you must configure a secure way to reach your Cloud-hosted version of PacketFence so
that your NAS devices can talk to it in a secure way. One approach is to use a site-to-site VPN.
An other approach is to use the PacketFence Connector.
Starting from v12, PacketFence provides the PacketFence Connector. The PacketFence
• RADIUS MAB
• RADIUS 802.1X
• Captive portal through Web Authentication (no registration or isolation VLAN support)
• Performing access reevaluation through the pfconnector (i.e. RADIUS CoA/Disconnect,
SNMP, etc)
• Performing LDAP queries through the pfconnector to an on-premise LDAP server (including
Active Directory) for portal and admin interface authentication
• Authentication against a RADIUS source through the pfconnector to an on-premise RADIUS
server for portal and admin interface authentication
• Device profiling using the Fingerbank Collector (installed automatically with the pfconnector
on 12.1+)
Current limitations:
• The RADIUS secret used on your NAS devices must be the same as the secret in
/usr/local/pf/conf/local_secret
• The pfconnector cannot be used to connect PacketFence with an Active Directory for NTLM
authentication
Installation
To deploy the PacketFence Connector, first provision on your local network (where NAS devices
reside) a x86_64 Debian 11 virtual machine with minimal resources (2GB of RAM, 1 CPU core
and 10GB of disk space). Then, perform the following commands as root:
When executing the last command, note down the Connector ID.
Then, complete the PacketFence Connector configuration by specifying the secret and the host,
https://NODE_BALANCER_IP:1443/api/v1/pfconnector/tunnel
If you configured a HTTP certificate signed by a public CA on PacketFence webadmin, you can
answer Yes to the next question.
Once your pfconnector is started, you can now point your network equipment to use the
pfconnector’s IP address for RADIUS and the captive portal like you would do with a typical on-
premise PacketFence server. When defining the RADIUS secret in PacketFence and in your
network equipment, always use the value inside /usr/local/pf/conf/local_secret.
In order to upgrade your PacketFence Connector to a packaged version, you need to run
following commands:
PacketFence Connector should have been restarted at end of the process. You can check its
status using: