A 24-person accounting firm in Heraklion that holds the tax files, payroll and bank details of a few hundred businesses, and doubles its pace every spring. Six seasonal staff arrive in March; a client sits in the meeting room every hour. We build it on Cisco in 11 tested steps around one idea: the network decides what a device may reach from who the device is, proven by a certificate, and keeps working when the server that checks it doesn't.
Full network · all steps built
highlighted = lines added in the selected step · earlier steps shown plain · later steps hidden
Download the full config: MikroTik .rsc · Cisco IOS .txt — illustrative, review before use
This is part 14 of the Build series. The law firm and the clinic each turned on 802.1X in one step; here it is the whole design. The office is small enough that one Windows server does everything, and that is the constraint that shapes every choice: NPS as RADIUS, an enterprise CA for the certificates, and an honest plan for what NPS can't do.
The order is the lesson. Build the network static, introduce identity in monitor mode, enforce it, and only then write the firewall rules between the VLANs that identity now fills.
01
A fictional but typical firm: three partners, 21 staff, about 400 business clients, two floors above a shop in the city centre.
The firm keeps its clients' tax filings, payroll, accounts and bank details on one Windows server in a comms cupboard, with the accounting software on a second server that seasonal staff use through Remote Desktop. Partners handle payroll exports and the firm's own finances. From March to May six seasonal accountants join on loaner laptops. Clients drop by all day and wait in the meeting room. Everything has to keep working through the tax-season deadlines, when an hour of downtime is an hour of late filings.
| Requirement | Where it comes from, and what it forces |
|---|---|
| R1 Only the firm's devices inside | Professional secrecy and GDPR: client financial data is reachable only from devices the firm owns and manages. A personal laptop on a desk socket gets nothing. |
| R2 Partners apart | Payroll and the partners' files are separated from staff, and staff PCs can't reach partner PCs at all. |
| R3 Tax season can't stop | If the authentication server is down, the firm keeps filing. Strangers still don't get in. |
| R4 Seasonal staff | Three months of access, no client data on their laptops, and it ends by itself on the agreed date. |
| R5 Phones and printers | Devices without 802.1X work on any desk, and only in their own VLANs. |
| R6 Clients in the meeting room | Internet only, never the firm's network, never the firm's authentication server. |
| R7 No Monday-morning outage | Rolling out network authentication must not lock thirty people out on the first day. |
| R8 Evidence | GDPR breach reporting within 72 hours: which device was on which port, when. |
| R9 Leavers | Someone who leaves loses network access the same day. |
02
All four start from the server the firm already has.
Every firm PC gets a machine certificate from the firm's own CA through auto-enrolment, and authenticates with EAP-TLS before anyone logs in. Personal devices can't get a certificate, so R1 holds without asking anyone to type anything.
NPS returns the VLAN with the authorisation: partner PCs to 10, staff to 20, seasonal laptops to 25, printers to 40. Every desk socket is the same, and the firewall rules are written per VLAN, so the identity decision and the access decision are made in two simple places.
IBNS 2.0 policies run the same authentication in open mode and closed mode; only one line differs. A week in open mode finds every device that would have been locked out, while nobody is.
Critical authentication puts new sessions into a VLAN that reaches only the domain controller and the accounting share, both of which still ask for credentials. Work continues; a stranger gets nothing usable.
03
10.60.<vlan>.0/24 for every VLAN, gateway .1 on R1. Only the servers and management are static.
| VLAN · subnet | Who lands here, and how |
|---|---|
| 10 PARTNERS · 10.60.10.0/24 | Partner PCs and laptops. NPS policy PARTNER-PCS (EAP-TLS, group Partner-PCs). |
| 12 SERVERS · 10.60.12.0/24 | DC1 (AD, DNS, DHCP, NTP, CA, NPS) .10 · FILES-ACCT .20 · RDS host .25. Static ports in the comms room. |
| 20 STAFF · 10.60.20.0/24 | Staff PCs. NPS policy STAFF-PCS. |
| 25 TEMP · 10.60.25.0/24 | Seasonal loaner laptops. NPS policy SEASONAL-PCS. Reach only the RDS host. |
| 30 VOICE · 10.60.30.0/24 | Desk phones, MAB, voice domain. SIP trunk to the provider. |
| 40 PRINT · 10.60.40.0/24 | Multifunction printers, MAB. Scan-to-folder on FILES-ACCT. |
| 50 GUEST · 10.60.50.0/24 | MEETING Wi-Fi only. DHCP from R1, internet only. |
| 60 CRIT · 10.60.60.0/24 | Critical auth while NPS is unreachable. DC1 and FILES-ACCT only. |
| 99 MGMT · 10.60.99.0/24 | R1 .1 · SW1 .11 · SW2 .12 · EWC .20. Native VLAN on the AP trunks. |
| 999 PARKING | No subinterface on R1: the access VLAN of every desk port in closed mode. |
04
Rows start, columns receive. Default deny. Which row a device is in is decided by NPS.
Two rows carry the design. Seasonal reaches one host on one port: the accounting software runs on the RDS host and the client files never leave the server. Critical exists only while NPS is down and reaches only what the office needs to keep filing.
04b
Every requirement from the brief, the steps that implement it, the config that does it, and the test that proves it.
| Requirement | Implemented in | Key config | Proven by |
|---|---|---|---|
| R1 Only firm devices | step 3 · step 6 | auto-enrolled machine certs; EAP-TLS; access-session closed; DENY-ALL | "Personal laptop" drill, section 16 |
| R2 Partners apart | step 6 · step 10 | NPS VLAN 10 vs 20; no zone-pair between them | "Sideways" drill |
| R3 Tax season can't stop | step 4 · step 8 | automate-tester; CRIT-DATA service template; CRIT zone-pair | "NPS down" drill |
| R4 Seasonal staff | step 10 · step 11 | VLAN 25 → RDS 3389 only; account expiry | "Season over" drill |
| R5 Phones and printers | step 7 | MAB accounts in AD; device-traffic-class=voice; multi-domain | "Spoofed printer" drill |
| R6 Meeting room | step 9 · step 10 | MEETING WPA3-SAE → VLAN 50; GUEST-OUTSIDE web only | "Client in the meeting room" drill |
| R7 No Monday outage | step 5 | open mode for a week before access-session closed | Monitor-week log review |
| R8 Evidence | step 4 · step 11 | RADIUS accounting; epm logging; NTP; syslog | "Who was on port 9" drill |
| R9 Leavers | step 6 · step 11 | Session-Timeout 8 h + server reauth; clear access-session | "Leaver" drill |
The build
Static network first, identity second, policy last. Every step ends with a checkpoint.
Eleven steps: the switches, the router, the CA and NPS, AAA on the switches, monitor mode, closed mode, phones and printers, critical authentication, Wi-Fi, the firewall between VLANs, and finally seasonal staff, leavers and logging. Each step that adds equipment opens with the topology: built parts solid, the step's additions in orange, later steps faded.
05 · Step 1 of 11
Two access switches, one per floor. Every desk port gets a phone VLAN and a temporary data VLAN until NPS takes over.
▲ Show step 1 in the interactive topology · see what this step adds, and click any device for its config
Partners and the comms room are on the ground floor; staff, the seasonal desks and the meeting room are upstairs. Each floor has one 24-port PoE switch, chained over a 1G trunk. Every desk carries a phone with a PC behind it, so each desk port has an access VLAN for the PC and a voice VLAN for the phone.
hostname SW1 ! keeps its own VLAN list; ignores VTP from the wire vtp mode transparent spanning-tree mode rapid-pvst vlan 10 name PARTNERS vlan 12 name SERVERS vlan 20 name STAFF vlan 25 name TEMP vlan 30 name VOICE vlan 40 name PRINT vlan 50 name GUEST vlan 60 name CRIT vlan 99 name MGMT vlan 999 name PARKING ! only the uplinks may answer DHCP; a laptop running a DHCP server is ignored ip dhcp snooping vlan 10,20,25,30,40,60 no ip dhcp snooping information option ip dhcp snooping interface GigabitEthernet1/1/1 description UPLINK to R1 Gi0/0/1 switchport mode trunk switchport nonegotiate switchport trunk allowed vlan 10,12,20,25,30,40,50,60,99 ip dhcp snooping trust interface GigabitEthernet1/1/2 description DOWNLINK to SW2 Gi1/1/1 switchport mode trunk switchport nonegotiate switchport trunk allowed vlan 10,12,20,25,30,40,50,60,99 ip dhcp snooping trust ! comms room: locked, so the servers' ports are static interface range GigabitEthernet1/0/21 - 23 description SERVERS (DC-NPS-CA, FILES-ACCT, RDS) switchport mode access switchport access vlan 12 spanning-tree portfast interface GigabitEthernet1/0/24 description AP (EWC on the ground floor AP) switchport mode trunk switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,25,50,99 spanning-tree portfast trunk ! desks: phone + PC. TEMPORARY static VLAN 20, replaced by RADIUS in step 6 interface range GigabitEthernet1/0/1 - 20 description DESK (phone + PC) switchport mode access switchport access vlan 20 switchport voice vlan 30 spanning-tree portfast spanning-tree bpduguard enable interface Vlan99 ip address 10.60.99.11 255.255.255.0 ip default-gateway 10.60.99.1
/system identity set name=SW1
/interface bridge add name=bridge vlan-filtering=no
/interface bridge port
add bridge=bridge interface=sfp-sfpplus1 comment="UPLINK to R1" trusted=yes
add bridge=bridge interface=sfp-sfpplus2 comment="DOWNLINK to SW2" trusted=yes
add bridge=bridge interface=ether21 pvid=12 comment="DC-NPS-CA"
add bridge=bridge interface=ether22 pvid=12 comment="FILES-ACCT"
add bridge=bridge interface=ether23 pvid=12 comment="RDS"
/interface bridge vlan
add bridge=bridge vlan-ids=10,12,20,25,30,40,50,60,99 \
tagged=bridge,sfp-sfpplus1,sfp-sfpplus2
# desks: TEMPORARY untagged STAFF, replaced by RADIUS in step 6
:for i from=1 to=20 do={ /interface bridge port add bridge=bridge \
interface=("ether" . $i) pvid=20 comment="DESK" }
# DHCP snooping: only 'trusted' ports may answer
/interface bridge set bridge dhcp-snooping=yes
/interface vlan add name=mgmt interface=bridge vlan-id=99
/ip address add address=10.60.99.11/24 interface=mgmt
/interface bridge set bridge vlan-filtering=yesSW2 is the same template without the server ports, uplinked to SW1's Gi1/1/2. The desk ports start in STAFF (VLAN 20) on purpose: nobody notices the switches going in, and the real decision about which VLAN a desk lands in moves to NPS in step 6.
DHCP snooping builds the binding table of which MAC holds which IP on which port, and blocks rogue DHCP servers on untrusted ports. 802.1X doesn't need it to authenticate anyone, but the session table, accounting and anything that later wants to know a client's IP rely on that table or on device-tracking. Turning it on in step 1, while every port is still static, means its effect can be checked before identity is layered on top.
show vlan brief on both switches: the ten VLANs, desk ports in 20.show interfaces trunk: Gi1/1/1 on SW1 and SW2 trunking the same nine VLANs.show ip dhcp snooping statistics counts its offers as dropped.06 · Step 2 of 11
Small office, one router: every VLAN's gateway is a subinterface on R1, so every packet between VLANs passes the firewall in step 10.
▲ Show step 2 in the interactive topology · see what this step adds, and click any device for its config
With 30 people there is no need for a layer-3 core. R1 routes for every VLAN on one trunk, which is exactly what makes the policy matrix enforceable: no VLAN can reach another without going through R1's zone firewall. DHCP comes from the domain controller through ip helper-address, except for guests, who are served by R1 itself and never talk to the domain controller.
hostname R1
interface GigabitEthernet0/0/0
description WAN fibre (static /30)
ip address 203.0.113.18 255.255.255.252
ip nat outside
interface GigabitEthernet0/0/1
description TRUNK to SW1 Gi1/1/1
no shutdown
interface GigabitEthernet0/0/1.10
encapsulation dot1Q 10
description PARTNERS
ip address 10.60.10.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.12
encapsulation dot1Q 12
description SERVERS
ip address 10.60.12.1 255.255.255.0
ip nat inside
interface GigabitEthernet0/0/1.20
encapsulation dot1Q 20
description STAFF
ip address 10.60.20.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.25
encapsulation dot1Q 25
description TEMP
ip address 10.60.25.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.30
encapsulation dot1Q 30
description VOICE
ip address 10.60.30.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.40
encapsulation dot1Q 40
description PRINT
ip address 10.60.40.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.50
encapsulation dot1Q 50
description GUEST
ip address 10.60.50.1 255.255.255.0
ip nat inside
interface GigabitEthernet0/0/1.60
encapsulation dot1Q 60
description CRIT
ip address 10.60.60.1 255.255.255.0
ip helper-address 10.60.12.10
ip nat inside
interface GigabitEthernet0/0/1.99
encapsulation dot1Q 99 native
description MGMT
ip address 10.60.99.1 255.255.255.0
ip nat inside
! guests get DHCP from the router, never from the domain controller
ip dhcp excluded-address 10.60.50.1 10.60.50.9
ip dhcp pool GUEST
network 10.60.50.0 255.255.255.0
default-router 10.60.50.1
dns-server 9.9.9.9 149.112.112.112
lease 0 4
ip access-list standard NAT-IN
permit 10.60.0.0 0.0.255.255
ip nat inside source list NAT-IN interface GigabitEthernet0/0/0 overload
ip route 0.0.0.0 0.0.0.0 203.0.113.17/system identity set name=R1
/interface vlan
add name=v10-partners interface=sfp-sfpplus1 vlan-id=10
add name=v20-staff interface=sfp-sfpplus1 vlan-id=20
# ...and 12, 25, 30, 40, 50, 60, 99 the same way
/ip address
add address=203.0.113.18/30 interface=ether1
add address=10.60.10.1/24 interface=v10-partners
add address=10.60.20.1/24 interface=v20-staff
/ip dhcp-relay
add name=relay-partners interface=v10-partners dhcp-server=10.60.12.10 \
local-address=10.60.10.1 disabled=no
/ip pool add name=guest ranges=10.60.50.10-10.60.50.250
/ip dhcp-server add name=guest interface=v50-guest address-pool=guest lease-time=4h
/ip route add dst-address=0.0.0.0/0 gateway=203.0.113.17
/ip firewall nat add chain=srcnat out-interface=ether1 action=masqueradeUntil step 10 R1 routes freely between VLANs. That is fine while the network is still static and the users are the same people as yesterday; the order matters because identity (steps 3 to 9) decides which VLAN a device is in, and only then does it make sense to write rules between VLANs.
show ip dhcp relay on R1 counts the relayed packets.07 · Step 3 of 11
The decision of who is who lives on the domain controller: a certificate authority that hands every firm PC a certificate, and NPS that checks it.
▲ Show step 3 in the interactive topology · see what this step adds, and click any device for its config
The office already runs a Windows domain for its accounting software and file shares. That makes the natural RADIUS server NPS (Network Policy Server, free with Windows Server), and the natural identity a machine certificate issued by an enterprise CA and auto-enrolled to every domain-joined PC through Group Policy. A PC proves it belongs to the firm by holding a private key the firm's CA signed. There is no password for anyone to phish, share or type into a personal laptop.
# on DC1 (Windows Server 2025): domain controller, DHCP, DNS, NTP — and now CA and NPS Install-WindowsFeature ADCS-Cert-Authority, NPAS -IncludeManagementTools Install-AdcsCertificationAuthority -CAType EnterpriseRootCA -CACommonName "OFFICE-ROOT-CA" ` -KeyLength 4096 -HashAlgorithmName SHA256 -ValidityPeriod Years -ValidityPeriodUnits 10 # duplicate the 'Workstation Authentication' template as OFFICE-MACHINE: # Domain Computers: Read + Enroll + Autoenroll; publish it; then a GPO on the PCs: # Computer Config > Windows Settings > Security Settings > Public Key Policies > # Certificate Services Client - Auto-Enrollment = Enabled (renew, update) Add-CATemplate -Name "OFFICE-MACHINE" -Force # NPS needs its own server certificate (RAS and IAS Server template) and to sit in AD netsh nps add registeredserver New-NpsRadiusClient -Name SW1 -Address 10.60.99.11 -SharedSecret '********' New-NpsRadiusClient -Name SW2 -Address 10.60.99.12 -SharedSecret '********' New-NpsRadiusClient -Name EWC -Address 10.60.99.20 -SharedSecret '********'
# the PCs' wired supplicant: a GPO under Computer Config > Windows Settings > # Security Settings > Wired Network (IEEE 802.3) Policies # Authentication: Microsoft: Smart Card or other certificate (EAP-TLS) # Authentication mode: Computer authentication # Trusted root: OFFICE-ROOT-CA only; verify the server name NPS1.office.local # and the service that runs it, set to start automatically: Set-Service -Name dot3svc -StartupType Automatic
NPS decides in its network policies, evaluated top to bottom; the first match wins. The order below is the whole access model of the office:
| # | NPS network policy | Match | Returns |
|---|---|---|---|
| 1 | PARTNER-PCS | EAP-TLS · computer in group Partner-PCs | VLAN 10 (Tunnel-Type VLAN, Tunnel-Medium-Type 802, Tunnel-Private-Group-ID 10) |
| 2 | SEASONAL-PCS | EAP-TLS · computer in group Seasonal-PCs | VLAN 25 · Session-Timeout 28800 |
| 3 | STAFF-PCS | EAP-TLS · computer in group Staff-PCs | VLAN 20 · Session-Timeout 28800 |
| 4 | PHONES-MAB | PAP/MAB · user in group MAB-Phones | cisco-av-pair = device-traffic-class=voice |
| 5 | PRINTERS-MAB | PAP/MAB · user in group MAB-Printers | VLAN 40 |
| 6 | DENY-ALL | anything else | Access-Reject |
PEAP-MSCHAPv2 is quicker to set up and it is still what many offices run. It is also crackable offline from a captured exchange, and it lets any device that knows a staff password onto the network, including a personal laptop at home that will be brought in during tax season. EAP-TLS with a machine certificate ties access to a device the firm owns and manages, and the key never leaves it (put it in the TPM with the template's Key Storage Provider setting).
NPS has no MAC address list. A MAB request arrives as a PAP login whose user name and password are both the device's MAC, so NPS checks it against Active Directory: each phone and printer needs a user account named after its MAC, with the MAC as its password, in a group the policy matches. Put those accounts in their own OU, deny them interactive logon, and expect a fine-grained password policy to be needed because a 12-hex-digit password fails the domain's complexity rules. It works for ten printers and phones; at a hundred, it is the reason people buy ISE or ClearPass.
certutil -store My on a firm PC after a gpupdate: a certificate from OFFICE-ROOT-CA with Client Authentication in its EKU.08 · Step 4 of 11
The switches learn where NPS is, what to send it, and what to do when it stops answering.
▲ Show step 4 in the interactive topology · see what this step adds, and click any device for its config
! local admin first: aaa new-model applies to the console too username netadmin privilege 15 algorithm-type scrypt secret ******** aaa new-model radius server NPS1 address ipv4 10.60.12.10 auth-port 1812 acct-port 1813 key ******** ! a test login every few minutes, so a recovered NPS is noticed (step 8) automate-tester username radius-probe idle-time 1 probe-on aaa group server radius NPS server name NPS1 ip radius source-interface Vlan99 aaa authentication login default local aaa authentication dot1x default group NPS aaa authorization network default group NPS aaa accounting identity default start-stop group NPS ! three silent tries in five seconds = dead; retry after three minutes radius-server dead-criteria time 5 tries 3 radius-server deadtime 3 radius-server attribute 6 on-for-login-auth radius-server attribute 8 include-in-access-req radius-server attribute 25 access-request include radius-server vsa send authentication radius-server vsa send accounting dot1x system-auth-control ! learns each client's IP for the session table and accounting device-tracking policy DT-NAC tracking enable
/radius add service=dot1x,wireless address=10.60.12.10 secret="********" \
src-address=10.60.99.11 accounting-port=1813 authentication-port=1812 timeout=1s
# NPS sends no CoA, so the incoming listener stays off (see step 11)
/radius incoming set accept=noThe attribute lines make the switches send what NPS and later investigations need: the calling MAC in every request (attribute 31, the MAC, is sent by default; 8 adds the client's IP once it is known; 25 echoes the Class that NPS returned when a session re-authenticates), and Cisco VSAs so NPS can return device-traffic-class=voice in step 7.
aaa new-model takes effect immediately, including on the console and the VTY lines. With no local user and aaa authentication login default local, the next login fails. The order in the block above is the safe one: local account, then aaa new-model, then the RADIUS server. Keep the SSH session open and test a second login before closing it.
When NPS stops answering, the switch marks it dead for deadtime minutes and then tries again only when a real request arrives. With automate-tester it sends its own test login for a non-existent user (radius-probe), every minute with idle-time 1 (the default is an hour); an Access-Reject proves NPS is alive and raises the aaa-available event that step 8 depends on.
test aaa group NPS radius-probe x legacy: User rejected, which proves the round trip works.show aaa servers: NPS1 UP, with the probe's requests counted.09 · Step 5 of 11
Turn 802.1X on everywhere, on a Friday, and change nothing that anybody will notice on Monday.
▲ Show step 5 in the interactive topology · see what this step adds, and click any device for its config
IBNS 2.0 describes authentication as a policy: what to do when a session starts, when dot1x fails, when a supplicant suddenly appears. The policy below is the standard one for desks: try 802.1X first, fall back to MAB if nothing answers EAPOL, and retry after a minute on any failure.
class-map type control subscriber match-all DOT1X_NO_RESP match method dot1x match result-type method dot1x agent-not-found class-map type control subscriber match-all DOT1X_FAILED match method dot1x match result-type method dot1x authoritative class-map type control subscriber match-all MAB_FAILED match method mab match result-type method mab authoritative policy-map type control subscriber OFFICE-NAC event session-started match-all 10 class always do-until-failure 10 authenticate using dot1x priority 10 ! entry 10 is left free: step 8 puts 'NPS is down' there, ahead of these event authentication-failure match-first 20 class DOT1X_NO_RESP do-until-failure 10 terminate dot1x 20 authenticate using mab priority 20 30 class DOT1X_FAILED do-until-failure 10 terminate dot1x 20 authentication-restart 60 40 class MAB_FAILED do-until-failure 10 terminate mab 20 authentication-restart 60 50 class always do-until-failure 10 terminate dot1x 20 terminate mab 30 authentication-restart 60 event agent-found match-all 10 class always do-until-failure 10 terminate mab 20 authenticate using dot1x priority 10 interface range GigabitEthernet1/0/1 - 20 device-tracking attach-policy DT-NAC dot1x pae authenticator ! no answer to 2 x 7 s of EAPOL = not a supplicant: try MAB after ~20 s, not 90 dot1x timeout tx-period 7 dot1x max-reauth-req 2 mab access-session host-mode multi-domain access-session port-control auto ! no 'access-session closed' yet: open mode, everything still works while we watch service-policy type control subscriber OFFICE-NAC
# RouterOS has no open mode: a dot1x server on a port enforces from the start. # Monitor the safe way: failures land in STAFF (as today) while you read the logs. :for i from=1 to=20 do={ /interface dot1x server add interface=("ether" . $i) \ auth-types=dot1x,mac-auth reject-vlan-id=20 accounting=yes interim-update=1h } /system logging add topics=dot1x
Without access-session closed the ports are in open mode: traffic flows before and after authentication, exactly as in step 1, but every device is authenticated and every result is logged. That turns the week after this step into an inventory: the PCs that haven't got a certificate yet, the phone model that sends EAPOL and confuses everything, the forgotten label printer behind the reception desk.
show access-session on both switches every morning. Every firm PC should show dot1x with an authorised status. Anything that shows mab but isn't a phone or printer is either a PC without a certificate (fix the GPO) or a device nobody knew about (find it). In NPS, every DENY-ALL hit is a device that would be cut off in closed mode.
show access-session interface Gi1/0/3 details: method dot1x, status Authorized, the VLAN NPS sent (still ignored in open mode).10 · Step 6 of 11
One line per port turns the inventory into enforcement. From now on, the certificate decides the VLAN.
▲ Show step 6 in the interactive topology · see what this step adds, and click any device for its config
interface range GigabitEthernet1/0/1 - 20 ! an authenticated session with no VLAN from NPS lands in PARKING, not in STAFF switchport access vlan 999 ! from now on, nothing but EAPOL until the session is authorised access-session closed ! re-check every session when NPS's Session-Timeout says so (8 h) authentication periodic authentication timer reauthenticate server
# closed: a failure now lands in PARKING (999), which goes nowhere /interface dot1x server set [find] reject-vlan-id=999 # VLANs arrive from NPS (Tunnel-Private-Group-ID); vlan-filtering must be on /interface bridge set bridge vlan-filtering=yes
In closed mode a port passes nothing but EAPOL until the session is authorised, then puts it in the VLAN NPS returned: 10 for a partner's PC, 20 for staff. The same wall socket gives a different network depending on whose machine is plugged in, so hot desks during tax season need no repatching.
The configured access VLAN changes meaning: it is now what a session gets if NPS authorises it without naming a VLAN, which only happens if a policy is misconfigured. Pointing it at PARKING turns that mistake into "no access" rather than "staff access".
Older designs send failures to a guest or auth-fail VLAN. Here a laptop that fails 802.1X and MAB gets nothing at all, and the policy retries every 60 seconds so the port recovers by itself once the device is enrolled. Clients who need internet use the MEETING Wi-Fi (step 9), not a wall socket in an office full of client files.
show access-session shows it failing MAB, NPS logs DENY-ALL.11 · Step 7 of 11
Phones and printers have no supplicant. They get in by MAC, and only into the VLAN that suits what they are.
▲ Show step 7 in the interactive topology · see what this step adds, and click any device for its config
! phones learn VLAN 30 by LLDP-MED; NPS's device-traffic-class=voice opens it lldp run ! MAB sends the MAC as the user name: aabbccddeeff, no separators, lower case mab request format attribute 1 groupsize 12 separator - lowercase ! printers and phones are normal desk ports: same policy, MAB after dot1x times out
# phones learn voice VLAN 30 from LLDP-MED /ip neighbor discovery-settings set protocol=lldp lldp-med-net-policy-vlan=30 # MAB user name: the MAC with no separators, lower case, matches the NPS account /interface dot1x server set [find] mac-auth-mode=mac-as-username \ radius-mac-format=xxxxxxxxxxxx
Each phone and printer has an AD account named after its MAC (see the NPS gotcha in step 3). When dot1x times out, the switch sends that MAC as user name and password; NPS matches it to PHONES-MAB or PRINTERS-MAB. For a phone NPS returns device-traffic-class=voice, which tells the switch to admit the phone on the port's voice VLAN; host-mode multi-domain lets the phone and the PC behind it each have their own session on the same port.
Anyone can read a printer's MAC off its label and set it on a laptop. That is why PRINT is its own VLAN with the narrowest rules in the office (step 10): a spoofed printer reaches the file server's scan folder over SMB and nothing else. Printers also get a DHCP reservation, and an alert on a second device with the same MAC is cheap to add on the DHCP server.
show access-session interface Gi1/0/5: two sessions, the phone via MAB in the VOICE domain and the PC via dot1x in DATA.12 · Step 8 of 11
A RADIUS server that reboots for updates on 30 April must not stop thirty people filing tax returns.
▲ Show step 8 in the interactive topology · see what this step adds, and click any device for its config
Without this step, a session that needs to authenticate while NPS is unreachable fails, and the port stays closed. That is the right answer for a bank and the wrong one for an office whose whole year depends on six weeks. Critical authentication decides what happens instead.
service-template CRIT-DATA vlan 60 class-map type control subscriber match-all AAA_DOWN_UNAUTHD match result-type aaa-timeout match authorization-status unauthorized class-map type control subscriber match-all AAA_DOWN_AUTHD match result-type aaa-timeout match authorization-status authorized class-map type control subscriber match-any IN_CRIT match activated-service-template CRIT-DATA match activated-service-template DEFAULT_CRITICAL_VOICE_TEMPLATE policy-map type control subscriber OFFICE-NAC event authentication-failure match-first ! NPS unreachable, new device: CRIT VLAN for data, voice keeps working 10 class AAA_DOWN_UNAUTHD do-until-failure 10 activate service-template CRIT-DATA 20 activate service-template DEFAULT_CRITICAL_VOICE_TEMPLATE 30 authorize 40 pause reauthentication ! NPS unreachable at reauth time: keep what it already granted 15 class AAA_DOWN_AUTHD do-until-failure 10 pause reauthentication 20 authorize event aaa-available match-all ! NPS is back: throw out the critical sessions so they authenticate properly 10 class IN_CRIT do-until-failure 10 clear-session 20 class always do-until-failure 10 resume reauthentication
# NPS unreachable: new sessions go to CRIT (60) instead of being rejected
/interface dot1x server set [find] server-fail-vlan-id=60Sessions that were already authorised before NPS went away keep their VLAN when their reauthentication fails. New sessions, a PC that was rebooted or a laptop that arrived, go to CRIT (VLAN 60), which can reach only the domain controller and the accounting file server. Phones keep their voice VLAN. When the probe from step 4 gets an answer again, clear-session throws every critical session out so it authenticates properly.
While NPS is down the switch can't tell a firm PC from a stranger: everyone who connects gets CRIT. That is why CRIT reaches two servers and no internet, and why both servers still require a domain login; a stranger in CRIT finds a domain controller that asks for Kerberos and a share that asks for credentials. A second NPS on another host would make this rare, and is the first upgrade worth buying.
show access-session shows nothing left in CRIT; the rebooted PC is back in VLAN 20.13 · Step 9 of 11
Laptops use the same certificate on Wi-Fi, and NPS gives them the same VLAN as on a cable. Clients in the meeting room get a passphrase and the internet.
▲ Show step 9 in the interactive topology · see what this step adds, and click any device for its config
Two Catalyst 9115AX access points, one per floor; one of them runs the Embedded Wireless Controller, so there is no separate controller to buy. The OFFICE network is WPA3-Enterprise: the laptop presents the same machine certificate it uses on a cable, NPS answers with the same policy, and aaa-override lets NPS's VLAN replace the default.
! the Embedded Wireless Controller runs on the ground-floor C9115AXI aaa authentication dot1x NPS-DOT1X group NPS wlan OFFICE 1 OFFICE no security wpa wpa2 no security wpa akm dot1x security wpa wpa3 security wpa akm dot1x-sha256 security pmf mandatory security dot1x authentication-list NPS-DOT1X no shutdown wlan MEETING 2 MEETING no security wpa wpa2 no security wpa akm dot1x security wpa wpa3 security wpa akm sae security pmf mandatory security wpa psk set-key ascii 0 ******** no shutdown ! NPS chooses the VLAN per user, exactly as on the wired ports wireless profile policy OFFICE-POL aaa-override vlan 20 no shutdown wireless profile policy MEETING-POL vlan 50 no shutdown wireless tag policy OFFICE-TAG wlan OFFICE policy OFFICE-POL wlan MEETING policy MEETING-POL
/interface wifi security
add name=office authentication-types=wpa3-eap management-protection=required \
eap-accounting=yes
add name=meeting authentication-types=wpa3-psk passphrase="********" \
management-protection=required
/interface wifi configuration
add name=office ssid=OFFICE security=office datapath.vlan-id=20
add name=meeting ssid=MEETING security=meeting datapath.vlan-id=50 \
datapath.client-isolation=yesThe EWC also needs the same AAA and RADIUS lines as the switches (step 4) and an entry as a RADIUS client in NPS (done in step 3). Add a wireless network policy to the PCs' GPO alongside the wired one: SSID OFFICE, WPA3-Enterprise, EAP-TLS, computer authentication, the same trusted root.
MEETING is a WPA3 passphrase that reception gives to clients, changed monthly. It lands in VLAN 50, which R1 serves itself, and the firewall lets it out to the web and nowhere else. Keeping guests away from RADIUS entirely means a guest problem can never become an NPS problem during the busiest week of the year.
14 · Step 10 of 11
Identity decided which VLAN each device is in. Now R1 decides what each VLAN may start.
▲ Show step 10 in the interactive topology · see what this step adds, and click any device for its config
Every VLAN is its own zone on R1, and each allowed arrow in the policy matrix is a zone-pair with one ACL. Anything without a zone-pair is dropped. The generated config is long because it is explicit; it is also easy to review, because each block answers one question: "may A start a connection to B, and on what?"
zone security PARTNERS zone security SERVERS zone security STAFF zone security TEMP zone security VOICE zone security PRINT zone security GUEST zone security CRIT zone security MGMT zone security OUTSIDE ip access-list extended PARTNERS-SERVERS permit ip any 10.60.12.0 0.0.0.255 class-map type inspect match-any PARTNERS-SERVERS match access-group name PARTNERS-SERVERS policy-map type inspect PARTNERS-SERVERS class type inspect PARTNERS-SERVERS inspect class class-default drop log zone-pair security PARTNERS-SERVERS source PARTNERS destination SERVERS service-policy type inspect PARTNERS-SERVERS ip access-list extended PARTNERS-PRINT permit tcp any 10.60.40.0 0.0.0.255 eq 9100 permit tcp any 10.60.40.0 0.0.0.255 eq 631 permit tcp any 10.60.40.0 0.0.0.255 eq 443 class-map type inspect match-any PARTNERS-PRINT match access-group name PARTNERS-PRINT policy-map type inspect PARTNERS-PRINT class type inspect PARTNERS-PRINT inspect class class-default drop log zone-pair security PARTNERS-PRINT source PARTNERS destination PRINT service-policy type inspect PARTNERS-PRINT ip access-list extended PARTNERS-OUTSIDE permit ip any any class-map type inspect match-any PARTNERS-OUTSIDE match access-group name PARTNERS-OUTSIDE policy-map type inspect PARTNERS-OUTSIDE class type inspect PARTNERS-OUTSIDE inspect class class-default drop log zone-pair security PARTNERS-OUTSIDE source PARTNERS destination OUTSIDE service-policy type inspect PARTNERS-OUTSIDE ip access-list extended STAFF-SERVERS remark not the RDS host: that is for temps deny ip any host 10.60.12.25 permit ip any 10.60.12.0 0.0.0.255 class-map type inspect match-any STAFF-SERVERS match access-group name STAFF-SERVERS policy-map type inspect STAFF-SERVERS class type inspect STAFF-SERVERS inspect class class-default drop log zone-pair security STAFF-SERVERS source STAFF destination SERVERS service-policy type inspect STAFF-SERVERS ip access-list extended STAFF-PRINT permit tcp any 10.60.40.0 0.0.0.255 eq 9100 permit tcp any 10.60.40.0 0.0.0.255 eq 631 permit tcp any 10.60.40.0 0.0.0.255 eq 443 class-map type inspect match-any STAFF-PRINT match access-group name STAFF-PRINT policy-map type inspect STAFF-PRINT class type inspect STAFF-PRINT inspect class class-default drop log zone-pair security STAFF-PRINT source STAFF destination PRINT service-policy type inspect STAFF-PRINT ip access-list extended STAFF-OUTSIDE permit ip any any class-map type inspect match-any STAFF-OUTSIDE match access-group name STAFF-OUTSIDE policy-map type inspect STAFF-OUTSIDE class type inspect STAFF-OUTSIDE inspect class class-default drop log zone-pair security STAFF-OUTSIDE source STAFF destination OUTSIDE service-policy type inspect STAFF-OUTSIDE ip access-list extended TEMP-SERVERS remark temps work on the RDS host; client files never reach their laptop permit tcp any host 10.60.12.25 eq 3389 permit udp any host 10.60.12.25 eq 3389 permit udp any host 10.60.12.10 eq domain class-map type inspect match-any TEMP-SERVERS match access-group name TEMP-SERVERS policy-map type inspect TEMP-SERVERS class type inspect TEMP-SERVERS inspect class class-default drop log zone-pair security TEMP-SERVERS source TEMP destination SERVERS service-policy type inspect TEMP-SERVERS ip access-list extended TEMP-OUTSIDE permit tcp any any eq 443 permit tcp any any eq www class-map type inspect match-any TEMP-OUTSIDE match access-group name TEMP-OUTSIDE policy-map type inspect TEMP-OUTSIDE class type inspect TEMP-OUTSIDE inspect class class-default drop log zone-pair security TEMP-OUTSIDE source TEMP destination OUTSIDE service-policy type inspect TEMP-OUTSIDE ip access-list extended PRINT-SERVERS remark scan-to-folder only permit tcp any host 10.60.12.20 eq 445 permit udp any host 10.60.12.10 eq domain class-map type inspect match-any PRINT-SERVERS match access-group name PRINT-SERVERS policy-map type inspect PRINT-SERVERS class type inspect PRINT-SERVERS inspect class class-default drop log zone-pair security PRINT-SERVERS source PRINT destination SERVERS service-policy type inspect PRINT-SERVERS ip access-list extended VOICE-OUTSIDE remark SIP trunk provider only permit udp any 192.0.2.0 0.0.0.255 class-map type inspect match-any VOICE-OUTSIDE match access-group name VOICE-OUTSIDE policy-map type inspect VOICE-OUTSIDE class type inspect VOICE-OUTSIDE inspect class class-default drop log zone-pair security VOICE-OUTSIDE source VOICE destination OUTSIDE service-policy type inspect VOICE-OUTSIDE ip access-list extended GUEST-OUTSIDE permit tcp any any eq 443 permit tcp any any eq www permit udp any any eq domain class-map type inspect match-any GUEST-OUTSIDE match access-group name GUEST-OUTSIDE policy-map type inspect GUEST-OUTSIDE class type inspect GUEST-OUTSIDE inspect class class-default drop log zone-pair security GUEST-OUTSIDE source GUEST destination OUTSIDE service-policy type inspect GUEST-OUTSIDE ip access-list extended CRIT-SERVERS remark NPS down: domain controller and the accounting files, nothing else permit ip any host 10.60.12.10 permit ip any host 10.60.12.20 class-map type inspect match-any CRIT-SERVERS match access-group name CRIT-SERVERS policy-map type inspect CRIT-SERVERS class type inspect CRIT-SERVERS inspect class class-default drop log zone-pair security CRIT-SERVERS source CRIT destination SERVERS service-policy type inspect CRIT-SERVERS ip access-list extended SERVERS-OUTSIDE remark updates and the off-site backup permit tcp any any eq 443 class-map type inspect match-any SERVERS-OUTSIDE match access-group name SERVERS-OUTSIDE policy-map type inspect SERVERS-OUTSIDE class type inspect SERVERS-OUTSIDE inspect class class-default drop log zone-pair security SERVERS-OUTSIDE source SERVERS destination OUTSIDE service-policy type inspect SERVERS-OUTSIDE ip access-list extended MGMT-SERVERS remark RADIUS, syslog, NTP from switches and the EWC permit udp any host 10.60.12.10 eq 1812 permit udp any host 10.60.12.10 eq 1813 permit udp any host 10.60.12.10 eq syslog permit udp any host 10.60.12.10 eq ntp class-map type inspect match-any MGMT-SERVERS match access-group name MGMT-SERVERS policy-map type inspect MGMT-SERVERS class type inspect MGMT-SERVERS inspect class class-default drop log zone-pair security MGMT-SERVERS source MGMT destination SERVERS service-policy type inspect MGMT-SERVERS interface GigabitEthernet0/0/1.10 zone-member security PARTNERS interface GigabitEthernet0/0/1.12 zone-member security SERVERS interface GigabitEthernet0/0/1.20 zone-member security STAFF interface GigabitEthernet0/0/1.25 zone-member security TEMP interface GigabitEthernet0/0/1.30 zone-member security VOICE interface GigabitEthernet0/0/1.40 zone-member security PRINT interface GigabitEthernet0/0/1.50 zone-member security GUEST interface GigabitEthernet0/0/1.60 zone-member security CRIT interface GigabitEthernet0/0/1.99 zone-member security MGMT interface GigabitEthernet0/0/0 zone-member security OUTSIDE
/interface list add name=TO-INTERNET
/interface list member
add list=TO-INTERNET interface=v10-partners
add list=TO-INTERNET interface=v20-staff
add list=TO-INTERNET interface=v50-guest
/ip firewall address-list
add list=servers address=10.60.12.0/24
add list=printers address=10.60.40.0/24
/ip firewall filter
add chain=forward connection-state=established,related action=accept
add chain=forward connection-state=invalid action=drop
add chain=forward in-interface=v10-partners dst-address-list=servers action=accept
add chain=forward in-interface=v20-staff dst-address=10.60.12.25 action=drop \
comment="RDS host is for temps"
add chain=forward in-interface=v20-staff dst-address-list=servers action=accept
add chain=forward in-interface=v25-temp dst-address=10.60.12.25 protocol=tcp \
dst-port=3389 action=accept
add chain=forward in-interface=v40-print dst-address=10.60.12.20 protocol=tcp \
dst-port=445 action=accept comment="scan-to-folder"
add chain=forward in-interface=v60-crit dst-address=10.60.12.10 action=accept
add chain=forward in-interface=v60-crit dst-address=10.60.12.20 action=accept
add chain=forward out-interface=ether1 in-interface-list=TO-INTERNET action=accept
add chain=forward action=drop comment="every other zone pair"The switches source RADIUS from VLAN 99 and NPS lives in VLAN 12, so MGMT → SERVERS must allow 1812 and 1813, or the moment ZBF is applied every new session hits critical auth. Apply the zone-pairs before the zone-member lines, and apply MGMT and SERVERS first.
There is no zone-pair between VLAN 10 and VLAN 20, in either direction. Payroll and the partners' files live on the file server behind share permissions; the network adds that no staff PC can reach a partner's PC at all, so a compromised staff laptop can't move sideways to the machine that holds the payroll export.
show policy-map type inspect zone-pair sessions: sessions only on the pairs in the matrix.Test-NetConnection 10.60.12.25 -Port 3389 fails; from a seasonal PC it succeeds.15 · Step 11 of 11
Six extra people for three months, someone leaving in the middle of it, and the question every incident starts with: which device was on which port?
▲ Show step 11 in the interactive topology · see what this step adds, and click any device for its config
Seasonal staff get firm-owned loaner laptops, joined to the domain and placed in the Seasonal-PCs group, so they receive a certificate and land in VLAN 25. From there they can reach exactly one thing inside: the RDS host, where the accounting software runs. Client files stay on the server; nothing is ever saved to a loaner. The seasonal computer and user accounts are created with an expiry date of 31 May, so on 1 June their certificates still exist but NPS rejects the disabled accounts, with nobody having to remember.
! interim accounting: where each session is, every 24 h and on any change aaa accounting update newinfo periodic 1440 ! session start, success, failure and the reason, to syslog epm logging clock timezone EET 2 0 clock summer-time EEST recurring last Sun Mar 3:00 last Sun Oct 4:00 service timestamps log datetime msec localtime show-timezone ntp server 10.60.12.10 logging host 10.60.12.10 logging trap informational archive log config logging enable notify syslog contenttype plaintext
/system clock set time-zone-name=Europe/Athens /system ntp client set enabled=yes servers=10.60.12.10 /system logging action add name=dc target=remote remote=10.60.12.10 /system logging add topics=dot1x action=dc /system logging add topics=info,!debug action=dc
With ISE or ClearPass, disabling an account can immediately push a Change of Authorization that kicks the live session. NPS can't initiate CoA. The session lasts until its next reauthentication, which is why policies 2 and 3 return Session-Timeout 28800 and step 6 enables authentication timer reauthenticate server: at most eight hours after an account is disabled, the next check fails. When someone leaves on bad terms, don't wait: disable the computer account, then clear access-session interface on their port and the session re-authenticates and fails at once.
A data breach must be reported to the authority within 72 hours, and the first question is always which device was where. Here three logs answer it together: NPS's accounting (machine, MAC, switch, port, start and stop), the switches' EPM log at the DC's syslog, and DHCP leases. All timestamps come from the same NTP source. Keep them for at least a year and test the search before you need it.
clear access-session interface Gi1/0/9: the session fails and the NPS log says the account is disabled or expired.16
Run these in February, before the seasonal staff arrive. Keep the results: they are the evidence that the controls exist.
| Drill (requirement) | What must happen |
|---|---|
| Personal laptop (R1) | A personal laptop on every kind of desk socket gets no address and no traffic; NPS logs DENY-ALL each time. |
| Sideways (R2) | From a staff PC, a scan of 10.60.10.0/24 finds nothing; from a partner PC, 10.60.20.0/24 the same. |
| NPS down (R3) | Stop NPS, reboot a staff PC: it lands in CRIT, opens the accounting share, can't browse. Start NPS: it is back in VLAN 20 within about a minute. |
| Season over (R4) | Expire a seasonal account: the next reauthentication fails. From a seasonal laptop, only RDP to 10.60.12.25 works. |
| Spoofed printer (R5) | A laptop with a printer's MAC lands in VLAN 40 and reaches only SMB on FILES-ACCT. |
| Client in the meeting room (R6) | On MEETING: internet works, nothing in 10.60.0.0/16 answers. |
| Leaver (R9) | Disable a computer account, clear access-session on its port: it gets nothing. |
| Who was on port 9 (R8) | Pick an hour last week: name every device on SW2 from NPS accounting, EPM logs and DHCP leases. |
17
Where the residual risk sits once every port asks for a certificate.
18
Packet Tracer can show the switching and routing; the identity layer needs real or virtual Windows and Catalyst images.
| This post | In Packet Tracer |
|---|---|
| VLANs, trunks, DHCP snooping, router-on-a-stick, NAT | All work (2960 or 3650 for the switches, ISR4331 for R1). |
| RADIUS and 802.1X | Packet Tracer has a basic RADIUS server and port-based 802.1X with a single VLAN; no IBNS 2.0 policies, no dynamic VLAN, no MAB fallback. |
| ZBF | Partially, on ISR images; build the full matrix on CML or EVE-NG with Cat8000v. |
| Identity layer | Use CML or EVE-NG with Cat9000v switches and a Windows Server VM running AD CS and NPS, and a Windows client VM as the supplicant. |
19
Indicative EU street prices, late 2026, excluding VAT.
| Item | Indicative (EUR, ex VAT) |
|---|---|
| 2× C9200L-24P-4G + Network Essentials / DNA term | 3,200 – 4,400 |
| R1 · C8200-1N-4T | 1,600 – 2,200 |
| 2× C9115AXI (one runs EWC) | 1,200 – 1,600 |
| Windows Server licences, CALs for 30 devices (if not already owned) | 1,500 – 2,500 |
| UPS for the comms cupboard | 500 – 800 |
| Network total | ≈ 8,000 – 11,500, plus the servers, cabling, and the RDS licences for the seasonal staff |
Appendix
Same VLANs, same NPS, same certificates. The MikroTik tabs above show each step; this is what changes underneath.
| Role | This post → MikroTik |
|---|---|
| SW1, SW2 | 2× C9200L-24P-4G → 2× CRS328-24P-4S+ (802.1X server per port) |
| R1 | C8200-1N-4T → RB5009UG+S+ |
| Wi-Fi | 2× C9115AXI with EWC → 2× cAP ax with CAPsMAN |
| Indicative total | ≈ 8,000 – 11,500 → ≈ 1,500 – 2,000 EUR ex VAT |
| Feature | This post → MikroTik |
|---|---|
| Open mode for monitoring | access-session without closed → none; temporarily set reject-vlan-id to the old VLAN |
| Closed mode | access-session closed → reject-vlan-id pointing at a dead VLAN |
| dot1x → MAB fallback | IBNS 2.0 policy → auth-types=dot1x,mac-auth on the same port |
| Critical auth | service template + aaa-available event → server-fail-vlan-id (no automatic clear when NPS returns) |
| Voice VLAN for phones | device-traffic-class=voice + multi-domain → LLDP-MED network policy; one session per port is the safer assumption |
| Firewall between VLANs | ZBF zone-pairs → stateful forward chain on the RB5009 |
There is no monitor mode, so the rollout uses the reject-VLAN trick instead and the inventory comes from the dot1x log. Critical sessions don't clear themselves when NPS returns; schedule a script that resets them, or accept that they stay in CRIT until the next reauthentication. Check the dot1x properties used in the MikroTik panes against your RouterOS version, as several were added during the 7.x series.
Takeaways
clear access-session cover the gap.This is part 14 of the Build series. Earlier: the ferry port, the law firm, the medical clinic.
I design and roll out network access control that admits the firm's devices and nothing else, and test it the way an auditor or an intruder would.
Book a Discovery Call →