802.1X Port Security & Dynamic VLAN Assignment via RADIUS / Windows NPS
Before you begin
- Applies to:802.1X switch port authentication and dynamic VLAN assignment with RADIUS and Windows NPS.
- Where to start:Start with the NPS server and an approved pilot switch port. Keep an independent management path available.
- What you need:Have the switch and NPS access, pilot client, authorized VLAN mapping, and the organizationβs approved authentication settings.
Guide tools
Scope, Threat Model & Defensive Overview
Open, unauthenticated Ethernet ports in conference rooms, lobby jacks, and unmonitored desks represent an immediate physical attack vector. Anyone connecting an unmanaged device can obtain a DHCP lease and probe internal infrastructure.
IEEE 802.1X Network Access Control (NAC) enforces identity-driven port access:
- Ports remain in an unauthorized state; all frames are blocked except for EAPOL authentication.
- Corporate Domain Machines: Authenticate via Machine/User Certificate or credentials β Dynamically assigned to
VLAN 30 (Users). - Corporate IP Phones: Authenticate via MAC Authentication Bypass (MAB) β Assigned to
VLAN 40 (VoIP). - Unmanaged / Guest Devices: Authentication fails β Automatically dumped into
VLAN 50 (Guest)with internet-only egress.
[Workstation Plugged In] βββΊ [Switchport: Closed] β βΌ (EAPOL / RADIUS Challenge) [Windows Server 2022/2025 NPS] β ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββ βΌ (Access-Accept + VLAN 30) βΌ (Access-Reject)[Authorized Corporate PC: VLAN 30] [Guest / Rogue Device: VLAN 50]Windows Server 2022/2025 NPS Configuration
Run on the Domain Controller or member server running the Network Policy Server (NPS) role (DC-01 / NPS-01).
Register Switch as RADIUS Client in NPS
NPS SetupIn nps.msc, register the core or access switch as an authorized RADIUS client and configure a high-entropy shared secret.
1. Open Network Policy Server (nps.msc).2. Right-click RADIUS Clients -> New: - Friendly Name: SW-ACCESS-01 - Address (IP or FQDN): 10.10.10.2 (Switch Management IP) - Shared Secret: RadiusSharedSecret2026!Configure Network Policy for Dynamic VLAN Assignment
RADIUS PolicyCreate a network policy targeting corporate computers and return the standard RADIUS RFC attributes that tell the switch to drop the port into VLAN 30.
Policy Name: POL-8021X-Corporate-ComputersConditions: - NAS-Port-Type: Ethernet - Windows Groups: CORP\Domain ComputersConstraints: - Authentication: Microsoft: Protected EAP (PEAP) or EAP-TLSStandard RADIUS Return Attributes: - Tunnel-Type: Virtual LANs (VLAN) (Value: 13) - Tunnel-Medium-Type: 802 (Includes all 802 media plus Ethernet) (Value: 6) - Tunnel-Private-Group-ID: 30 (Target VLAN string)Cisco Catalyst / IOS-XE Switch Configuration
Configure on Cisco Catalyst switches (SW-ACCESS-01):
Enable AAA Subsystem & Define RADIUS Group
Cisco AAAInitialize AAA, register the Windows Server NPS instance, and activate 802.1X globally across the switch.
configure terminal
# 1. Enable AAA subsystemaaa new-model
# 2. Configure RADIUS Server Groupradius server NPS-SERVER-01 address ipv4 10.10.10.10 auth-port 1812 acct-port 1813 key RadiusSharedSecret2026!exit
# 3. Define AAA Authentication & Authorization listsaaa group server radius RADIUS-GROUP-NPS server name NPS-SERVER-01exit
aaa authentication dot1x default group RADIUS-GROUP-NPSaaa authorization network default group RADIUS-GROUP-NPSaaa accounting dot1x default start-stop group RADIUS-GROUP-NPS
# 4. Globally enable 802.1Xdot1x system-auth-controlConfigure Access Switchports for 802.1X & MAB
Cisco PortsApply multi-domain authentication, enable MAC Authentication Bypass for non-802.1X hardware, and set the fallback Guest VLAN to 50.
interface range GigabitEthernet1/0/1 - 40 description 802.1X-SECURED-ACCESS-PORT switchport mode access switchport access vlan 50
# Enable 802.1X and MAC Authentication Bypass authentication order dot1x mab authentication priority dot1x mab authentication port-control auto dot1x pae authenticator
# Host Mode: Multi-Domain (Permits 1 PC + 1 IP Phone on same jack) authentication host-mode multi-domain
# Fallback Actions: authentication event fail action authorize vlan 50 authentication event no-response action authorize vlan 50
# Critical Auth Survivability: If NPS is unreachable, authorize corporate VLAN authentication event server dead action authorize vlan 30 exitwrite memoryFortinet FortiSwitch Configuration
Configure via FortiGate controller CLI:
Configure RADIUS Server in FortiOS
FortiOS RADIUSDefine the Windows NPS RADIUS server profile with MS-CHAPv2 authentication within FortiOS.
config user radius edit "RADIUS-NPS" set server "10.10.10.10" set secret RadiusSharedSecret2026! set auth-type ms_chap_v2 nextendCreate 802.1X Security Policy & Port Binding
FortiSwitch PolicyDefine the MAC-based 802.1X security policy with guest failover and bind it to managed access ports.
# 1. Create policyconfig switch-controller security-policy 802-1X edit "8021X-POLICY-CORP" set security-mode 802.1X-mac-based set user-group "RADIUS-NPS" set guest-vlan enable set guest-vlan-id 50 set auth-fail-vlan enable set auth-fail-vlan-id 50 nextend
# 2. Apply to access portsconfig switch-controller managed-switch edit "FSW-ACCESS-01" config ports edit "port1" set port-security-policy "8021X-POLICY-CORP" next end nextendOperational Verification & Emergency Rollback Bypass
Validate Active Authentications on Switch & NPS Event Log
VerificationConfirm the switch displays an Authorized status with Dynamic VLAN Policy 30, and verify NPS Event ID 6272 success records.
# On Cisco Catalyst:show authentication sessions interface GigabitEthernet1/0/1 detailsβ― Illustrative Output (Results Vary)
Interface: GigabitEthernet1/0/1 MAC Address: 0050.56a1.b2c3 IPv4 Address: 10.10.30.55 User Name: host/ws-eng-042.corp.internal Status: Authorized Domain: DATA Oper host mode: multi-domain Authorized By: Authentication Server Vlan Policy: 30 Method status: DOT1X - SuccessEmergency Switchport Bypass & Force-Authorization
RollbackIf the RADIUS/NPS server experiences total hardware failure and endpoints cannot authenticate, execute force-authorization across all ports to immediately restore corporate connectivity.
# On Cisco Catalyst:configure terminalinterface range GigabitEthernet1/0/1 - 40 authentication port-control force-authorized switchport access vlan 30exitYour feedback keeps these production procedures accurate and battle-tested.