Every device that connects to your network is a potential entry point for attackers. Network Access Control (NAC) ensures that only authorized, compliant devices can access your network resources. Enterprise NAC solutions from Cisco (ISE), Aruba (ClearPass), and Fortinet cost tens of thousands of dollars. This guide covers powerful open-source, self-hosted alternatives that deliver comparable security at zero licensing cost.
What Is Network Access Control?
Network Access Control (NAC) is a security approach that restricts network access based on device identity, health status, and user authentication. NAC systems enforce policies like:
- Device registration — new devices must be approved before accessing the network
- 802.1X authentication — port-level authentication for wired and wireless networks
- Compliance checking — verify devices have up-to-date antivirus, patches, and configurations
- Role-based access — assign different network privileges based on device type and user role
- Captive portals — web-based authentication for guest and BYOD devices
- Quarantine — isolate non-compliant devices in a restricted network segment
Comparison Table
| Feature | PacketFence | OpenNAC | Gatekeeper |
|---|---|---|---|
| Stars | 1,623+ | N/A (FreeRADIUS-based) | 17+ |
| Language | Perl/JS | FreeRADIUS + Python | Go |
| 802.1X Support | Full | Full | Basic |
| Captive Portal | Built-in | Via components | Basic |
| BYOD Management | Comprehensive | Basic | Simple |
| Device Fingerprinting | Yes | Limited | No |
| VLAN Assignment | Dynamic | Dynamic | Static |
| Integration | Active Directory, LDAP, RADIUS | FreeRADIUS, LDAP | LDAP |
| Web UI | Full admin portal | Limited | Minimal |
| Docker Support | Available | Manual | Available |
| Best For | Enterprise NAC | Custom FreeRADIUS setups | Simple self-hosted services |
PacketFence
GitHub: inverse-inc/packetfence (1,623+ stars)
PacketFence is the most comprehensive open-source NAC solution available. Developed by Inverse Inc. (the same company behind SOGo), it supports wired, wireless, and VPN access control with a rich feature set that rivals commercial products.
Key Features
- Multi-tenant support — manage multiple organizations from a single instance
- Device fingerprinting — identify device types via DHCP fingerprinting, SNMP, and passive analysis
- 802.1X with EAP-TLS/PEAP/TTLS — full port-based authentication
- Captive portal — customizable web portal for guest and BYOD registration
- Integration with Active Directory, LDAP, SAML — enterprise identity sources
- REST API — programmatic management and automation
- Reporting and compliance — audit trails and compliance reports
Docker Compose
| |
Installation (Native)
| |
Configuration Workflow
- Define network equipment — add switches, APs, and routers with SNMP credentials
- Configure connection profiles — specify authentication methods per network segment
- Set up registration — configure captive portal or 802.1X for device onboarding
- Define policies — create rules for compliance checking and access levels
- Monitor and enforce — use the dashboard to track connected devices and policy violations
When to Use PacketFence
- Enterprise environments — full-featured NAC with AD integration
- BYOD programs — comprehensive device registration and compliance
- Guest access management — professional captive portal with sponsor workflows
- Compliance requirements — audit trails and reporting for regulations
OpenNAC (FreeRADIUS-Based NAC)
OpenNAC refers to building a NAC system using FreeRADIUS as the authentication engine combined with network switch configuration for 802.1X enforcement. This approach gives you maximum flexibility and control.
Core Architecture
| |
FreeRADIUS Configuration for 802.1X
| |
Dynamic VLAN Assignment
| |
Docker Compose for FreeRADIUS
| |
When to Use OpenNAC
- Custom NAC requirements — build exactly what you need with FreeRADIUS modules
- Budget-conscious deployments — zero licensing cost, only hardware needed
- Learning NAC concepts — understand the underlying protocols by configuring them
- Smaller networks — where PacketFence’s full feature set is overkill
Gatekeeper
GitHub: Tomasinjo/gatekeeper (17+ stars)
Gatekeeper is a simple, modern network access control system designed specifically for self-hosted services. It provides a lightweight alternative to full NAC platforms, focusing on controlling access to individual services rather than entire network segments.
How It Works
Gatekeeper acts as a reverse proxy that authenticates users before granting access to backend services:
| |
Installation
| |
Configuration
| |
When to Use Gatekeeper
- Self-hosted service protection — control access to individual web applications
- Small teams — lightweight authentication without full NAC overhead
- Microservices environments — per-service access control
- Homelabs — simple, easy-to-understand access management
Why Self-Host Your Network Access Control?
Zero Licensing Cost
Commercial NAC solutions charge per port or per device. Cisco ISE costs $50-150 per endpoint, Aruba ClearPass $40-100 per device. PacketFence provides equivalent functionality with no per-device licensing — your only cost is the server hardware.
Complete Visibility Into Every Connected Device
Self-hosted NAC gives you a real-time inventory of every device on your network: who connected, when, from which port, and what access level they received. This visibility is critical for security incident response and compliance auditing.
Policy Enforcement at the Network Edge
Unlike firewalls that filter traffic after it enters the network, NAC enforces policies at the point of connection. Unauthorized devices never reach your internal network — they’re either blocked entirely or placed in a quarantine VLAN.
| |
Integration With Existing Infrastructure
Self-hosted NAC integrates with your existing LDAP/Active Directory, SIEM, ticketing systems, and configuration management tools. No proprietary APIs or vendor lock-in.
Building a Complete Network Security Stack
NAC is one layer of a defense-in-depth strategy. After controlling network access at the edge, protect traffic with firewall rules (firewall management guide), authenticate services with proper identity providers (OIDC SSO guide), and secure email with authentication protocols (email authentication guide).
Choosing the Right NAC Solution
| Scenario | Recommended Solution | Reason |
|---|---|---|
| Enterprise with 500+ devices | PacketFence | Full-featured, multi-tenant, AD integration |
| Small office (50-200 devices) | FreeRADIUS-based NAC | Flexible, cost-effective, sufficient features |
| Homelab / small team | Gatekeeper | Lightweight, simple configuration |
| Guest/BYOD management | PacketFence | Best-in-class captive portal |
| Custom authentication flows | FreeRADIUS-based NAC | Unlimited module flexibility |
FAQ
What is 802.1X and why is it important for NAC?
802.1X is an IEEE standard for port-based Network Access Control. It requires devices to authenticate before the switch port or wireless AP grants network access. Unlike MAC address filtering (easily spoofed), 802.1X uses cryptographic authentication (EAP-TLS certificates or PEAP username/password). It’s the foundation of enterprise NAC — without it, you can only control access at the firewall level, not at the network edge.
Can PacketFence replace Cisco ISE?
For most use cases, yes. PacketFence supports 802.1X authentication, captive portals, device fingerprinting, BYOD management, VLAN assignment, and Active Directory integration — the core features of Cisco ISE. The main differences are: PacketFence lacks Cisco’s Threat-Centric NAC (integration with Cisco security products), has a steeper learning curve, and community support versus enterprise SLA. For organizations without existing Cisco security investments, PacketFence is a viable alternative.
How do I handle devices that don’t support 802.1X?
Many devices (printers, IoT sensors, cameras) don’t support 802.1X. NAC systems handle these through MAC Authentication Bypass (MAB) — the device’s MAC address is checked against an authorized list. In PacketFence, register the device through the admin portal or a self-registration workflow. In FreeRADIUS, add MAC addresses to the users file:
| |
Is a captive portal secure enough for guest access?
Captive portals are suitable for guest access when combined with VLAN isolation. Guests authenticate via the portal and are placed in a guest VLAN that has Internet access but no access to internal resources. For higher security, require sponsor approval (an internal user must approve each guest registration) and set time-limited access that expires automatically.
How does device fingerprinting work in NAC?
Device fingerprinting identifies device types by analyzing network behavior patterns: DHCP option fingerprints (different OS send different DHCP options), HTTP user-agent strings, SNMP system descriptions, MAC address OUI lookups, and passive traffic analysis. PacketFence combines multiple techniques for accurate identification — distinguishing between Windows laptops, iPhones, Android phones, printers, and IoT devices. This enables automatic policy assignment: printers go to the printer VLAN, phones get VoIP priority, unknown devices get quarantined.
Can NAC protect against insider threats?
NAC provides several layers of insider threat protection: it prevents unauthorized devices from connecting to the network, limits access based on user role (principle of least privilege), quarantines non-compliant devices (missing patches, disabled antivirus), and provides audit logs of all connection events. However, NAC alone isn’t sufficient — combine it with endpoint detection, DLP (Data Loss Prevention), and user behavior analytics for comprehensive insider threat protection.