802.1x Wired Authentication With Cisco IOS - Part II (Authenticator - Switch Configuration)
802.1x Wired Authentication With Cisco IOS - Part II (Authenticator - Switch Configuration)
In part I, we have configured client and server for our wired 802.1x authentication. Now we will configure the
remaining part which is the configuration of authenticator/switch. We are using Cisco switch with IOS version
15.
We are testing only dot1x authentication. There is no traffic filtering applied between client and guest vlan. When a client is
placed into vlan 246 (client) or guest (246) by dot1x, it has the same level of network access. Here we are testing
authentication of a wired clients using 802.1x, not access to the network using firewall rules.
Our authentication policy is that if the user behind computer "Client-W10" gives proper username/password,
he/she will be granted access to VLAN 246 (client VLAN). In all other circumstances (failed
authentication), the user will be placed in VLAN 247 (guest VLAN). Another important thing is that - upon
successful authentication, switch port will get it's access VLAN from the radius/NPS server. In other words,
switch ports where clients are connected will get their VLAN assigned by radius server.
Even though in our setup the Router just does routing functionality, I am giving it's configuration below if
someone is interested how the whole network looks like. For us, the fun begins when we start configuring
the Switch.
Router configuration
hostname Router
interface GigabitEthernet0/0
no ip address
no shutdown
!
interface GigabitEthernet0/0.245
encapsulation dot1Q 245
ip address 172.16.245.1 255.255.255.0
!
interface GigabitEthernet0/0.246
encapsulation dot1Q 246
ip address 172.16.246.1 255.255.255.0
ip helper-address 172.16.245.11
!
interface GigabitEthernet0/0.247
encapsulation dot1Q 247
ip address 172.16.247.1 255.255.255.0
ip helper-address 172.16.245.11
!
interface GigabitEthernet0/0.250
encapsulation dot1Q 250
ip address 172.16.250.1 255.255.255.0
!
Switch configuration
hostname Switch
interface Vlan250
!
!!!Assign the defined radius server to a "aaa group"
aaa group server radius nps-servers
Now we will configure the switch port where the actual client is connected which is ethernet1/1. Let's
discuss some behavior of an access port in Cisco's 802.1X implementation. In a Cisco switch, an access port
where 802.1X is enabled, it disables the port's access until the switch has determined what to do with it by
802.1X. So, there will be no mac-address learning or any activity on the port until the port has gone through
802.1X authentication. Let's look at an example -
interface Ethernet1/1
switchport mode access
switchport access vlan 246
authentication port-control auto
dot1x pae authenticator
In above configuration, even though the port is placed in VLAN 246, it will not be granted access to the
VLAN until it has passed 802.1X authentication. We will not see a mac-address associated with that port. If
the client connected with the port passes authentication, we will see mac-address associated with that
port.
So, with Cisco if we define access vlan under interface configuration, that means client will be granted
access to that VLAN upon successful authentication. And if we do not define any access VLAN under
interface, then upon successful authentication, the port will assign it's VLAN from radius server. In our case
we will use this variant, no access vlan under interface configuration, it will we assigned by the
radius/NPS server.
Now we will configure 802.1X at interface level where the client is connected.
interface Ethernet1/1
!!!Port is not assigned to a access VLAN, VLAN is assigned by Radius.
switchport mode access
!!!802.1x usually configured on access ports.
!!! Enabling portfast will reduce STP convergence time of the port.
spanning-tree portfast
!!!Enables 802.1X for an interface
authentication port-control auto
dot1x pae authenticator
!!!If authentication fails, port is placed into vlan 247, default retry is 2 times
authentication event fail retry 2 action authorize vlan 247
!!!If radius server is not reachable, port is placed into vlan 247
authentication event server dead action authorize vlan 247
!!!After a radius server dead event, when the server comes backup again,
!!!initiates re-authentication of connected clients.
authentication event server alive action reinitialize
!!!If connected host is not running 802.1X client, port is placed into vlan 247
authentication event no-response action authorize vlan 247
!!!Only one device connected to the port, needs to pass authentication.
!!!Useful when we are running also VM, from the connected host.
authentication host-mode multi-host
!!!Enables periodic authentication which is triggered every 1 hour
authentication periodic
authentication timer reauthenticate 3600
dot1x timeout tx-period 10
dot1x timeout quiet-period 15
end
If required we can adjust different timers for authentication and 802.1X, their explanation is out of scope of
this article -
Switch(config)#int e1/1
Switch(config-if)#authentication timer ?
inactivity Interval in seconds after which if there is no activity from
the client then it will be unauthorized (default OFF)
reauthenticate Time in seconds after which an automatic re-authentication
should be initiated (default 1 hour)
restart Interval in seconds after which an attempt should be made to
authenticate an unauthorized port (default 60 sec)
unauthorized Time in seconds after which an unauthorized session will get
deleted
Switch(config-if)#dot1x timeout ?
auth-period Timeout for authenticator reply
held-period Timeout for authentication retries
quiet-period QuietPeriod in Seconds
ratelimit-period Ratelimit Period in seconds
server-timeout Timeout for Radius Retries
start-period Timeout for EAPOL-start retries
supp-timeout Timeout for supplicant reply
tx-period Timeout for supplicant retries
Verification
If we have configured everything properly, then when we connect "Client-W10" with switch port "e1/1", we
will see that Windows is asking for username/password. If we enter correct username/password, the port will
be placed in vlan 246 (client vlan) and granted network access.
Switch#show dot1x
Sysauthcontrol Enabled
Dot1x Protocol Version 3
We can see an individual port's dot1x timers, EAP protocol used (PEAP), client's mac-address
(5000.0004.0000), authentication state (AUTHENTICATED) etc. from the output below.
By using command below we can find authentication information like, client's mac and ip address, username,
server policies (radius assigned vlan) etc.
Local Policies:
Service Template: DEFAULT_LINKSEC_POLICY_SHOULD_SECURE (priority 150)
Security Policy: Should Secure
Security Status: Link Unsecure
Server Policies:
Vlan Group: Vlan: 246
Now let's see what happens when authentication fails because of entering wrong username/password. We
have entered an unknown user named "sdfsf", then from the output below we can see that port is placed in
VLAN 247 by the switch (local policies), authentication has failed.
Local Policies:
Service Template: AUTH_FAIL_VLAN_Et1/1 (priority 150)
Vlan Group: Vlan: 247
debug dot1x
debug authentication
debug radius
We can test whether a client connected to a switch port can has the necessary client software or EAPOL
capable -
We can also test the radius server connectivity and settings from the switch by commands -
USER ATTRIBUTES
service-type 0 2 [Framed]
tunnel-medium-type 0 6 [ALL_802]
tunnel-private-group 0 "246"
tunnel-type 0 13 [vlan]
References