Tutorials · Security
How to Use RADIUS Dynamic VLANs and Change of Authorization (CoA) for NAC
Put each user and device in the right network automatically: return VLANs and ACLs from RADIUS, then use Change of Authorization to move or disconnect a device the moment its status changes.
Quick answer
Network access control (NAC) places every connection in the right segment based on who or what it is. RADIUS returns the VLAN, and optionally an ACL, when a device authenticates. Change of Authorization (CoA, RFC 5176) lets the policy server change that decision later, without the user reconnecting.
Typical uses are moving a laptop to a quarantine VLAN when it fails a security check, upgrading a guest after sponsor approval, or disconnecting a stolen device.
Key terms
- Dynamic VLAN
- A VLAN chosen by the RADIUS server at login using the Tunnel-Type, Tunnel-Medium-Type and Tunnel-Private-Group-ID attributes.
- CoA-Request
- A message from the RADIUS server to the switch or controller that changes an active session's policy. It uses UDP port 3799.
- Disconnect-Request
- A message that ends a session. The device usually re-authenticates and receives the new policy.
- Posture
- The security state of a device, such as updated OS, running endpoint protection and disk encryption.
Before you start
- 802.1X or MAC authentication working on switches or Wi-Fi
- A RADIUS / NAC server that can send CoA
- The VLANs (staff, IoT, guest, quarantine) already created on all switches
Step by step
Plan the segments
Define a VLAN or role per group: staff, contractors, IoT/CCTV, guests and quarantine. Write down the ACL each one needs.
Return the VLAN from RADIUS
Add the three tunnel attributes to the policy for each group.
# FreeRADIUS users / policy example DEFAULT Ldap-Group == "Staff" Tunnel-Type = VLAN, Tunnel-Medium-Type = IEEE-802, Tunnel-Private-Group-ID = "20"
Enable dynamic authorization on the switch or controller
Allow CoA only from your RADIUS servers, with the same shared secret.
aaa server radius dynamic-author client 10.99.0.20 server-key <shared-secret> port 3799
Allow CoA through firewalls
Open UDP 3799 from the RADIUS servers to the switches and controllers only.
Create the trigger
On the NAC server, connect an event to a CoA action, for example a failed posture check, an EDR alert, or a sponsor approving a guest.
Test a move and a disconnect
Send a CoA to a test port and check that the device lands in the new VLAN within seconds.
echo "User-Name=test01,NAS-Port-Id=Gi1/0/5" | radclient -x 10.99.0.11:3799 disconnect <shared-secret>
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Use 'reauthenticate' CoA for wired ports. Bouncing a port can break VoIP phones daisy-chained to a PC.
- Keep printers, cameras and other headless devices on MAC authentication bypass with tight ACLs. Profile them and let CoA quarantine any whose behaviour changes.
- Log every CoA with its reason. It is your evidence trail when a user asks why they lost access.
Standards and references
Last reviewed:
FAQ
Frequently asked questions
What port does RADIUS CoA use?
UDP 3799, defined in RFC 5176 for CoA-Request and Disconnect-Request messages.
Do I need 802.1X for dynamic VLANs?
No. MAC authentication bypass can also return a VLAN, but 802.1X is stronger because MAC addresses can be spoofed.
What is the difference between a VLAN and a downloadable ACL?
A VLAN changes the network segment. An ACL filters traffic within the port. Many designs use both.
Keep learning
Related guides
802.1X port authentication
Read more →Segment IoT and CCTV
Read more →Evolution of NAC
Read more →How to Enable 802.1X Port Authentication on Switches
Stop unknown devices from using your network ports: configure 802.1X with RADIUS and MAC-authentication bypass for printers and cameras.
Read more →How to Secure the Management of Switches, Routers and Access Points
A hardening checklist for every network device: strong credentials, SSH only, a management VLAN, access lists and logging.
Read more →How to Segment IoT and CCTV Devices From Your Main Network
Put cameras, smart TVs, sensors and building systems in their own VLANs so one compromised device cannot reach your business systems.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.