Configuring 802.1x Port-Based Authentication
This chapter describes how to configure IEEE 802.1x port-based authentication on the Catalyst 3560 switch. As LANs extend to hotels, airports, and corporate lobbies and create insecure environments, 802.1x prevents unauthorized devices (clients) from gaining access to the network.
Note
For complete syntax and usage information for the commands used in this chapter, see the command reference for this release.
This chapter consists of these sections:
•
Understanding 802.1x Port-Based Authentication
•
Configuring 802.1x Authentication
•
Displaying 802.1x Statistics and Status
Understanding 802.1x Port-Based Authentication
The IEEE 802.1x standard defines a client-server-based access control and authentication protocol that prevents unauthorized clients from connecting to a LAN through publicly accessible ports unless they are properly authenticated. The authentication server authenticates each client connected to a switch port before making available any services offered by the switch or the LAN.
Until the client is authenticated, 802.1x access control allows only Extensible Authentication Protocol over LAN (EAPOL), Cisco Discovery Protocol (CDP), and Spanning Tree Protocol (STP) traffic through the port to which the client is connected. After authentication is successful, normal traffic can pass through the port.
These sections describe 802.1x port-based authentication:
•
Device Roles
•
Authentication Initiation and Message Exchange
•
Ports in Authorized and Unauthorized States
•
802.1x Accounting
•
802.1x Host Mode
•
Using 802.1x with Port Security
•
Using 802.1x with Voice VLAN Ports
•
Using 802.1x with VLAN Assignment
•
Using 802.1x with Guest VLAN
•
Using 802.1x with Per-User ACLs
Device Roles
With 802.1x port-based authentication, the devices in the network have specific roles as shown in Figure 8-1.
Figure 8-1 802.1x Device Roles
•
Client—the device (workstation) that requests access to the LAN and switch services and responds to requests from the switch. The workstation must be running 802.1x-compliant client software such as that offered in the Microsoft Windows XP operating system. (The client is the supplicant in the IEEE 802.1x specification.)
Note
To resolve Windows XP network connectivity and 802.1x authentication issues, read the Microsoft Knowledge Base article at this URL: http://support.microsoft.com/support/kb/articles/Q303/5/97.ASP
•
Authentication server—performs the actual authentication of the client. The authentication server validates the identity of the client and notifies the switch whether or not the client is authorized to access the LAN and switch services. Because the switch acts as the proxy, the authentication service is transparent to the client. In this release, the RADIUS security system with Extensible Authentication Protocol (EAP) extensions is the only supported authentication server. It is available in Cisco Secure Access Control Server Version 3.0 or later. RADIUS operates in a client/server model in which secure authentication information is exchanged between the RADIUS server and one or more RADIUS clients.
•
Switch (edge switch or wireless access point)—controls the physical access to the network based on the authentication status of the client. The switch acts as an intermediary (proxy) between the client and the authentication server, requesting identity information from the client, verifying that information with the authentication server, and relaying a response to the client. The switch includes the RADIUS client, which is responsible for encapsulating and decapsulating the EAP frames and interacting with the authentication server.
When the switch receives EAPOL frames and relays them to the authentication server, the Ethernet header is stripped and the remaining EAP frame is re-encapsulated in the RADIUS format. The EAP frames are not modified during encapsulation, and the authentication server must support EAP within the native frame format. When the switch receives frames from the authentication server, the server's frame header is removed, leaving the EAP frame, which is then encapsulated for Ethernet and sent to the client.
The devices that can act as intermediaries include the Catalyst 3750, Catalyst 3560, Catalyst 3550, Catalyst 2970, Catalyst 2955, Catalyst 2950, Catalyst 2940 switches, or a wireless access point. These devices must be running software that supports the RADIUS client and 802.1x.
Authentication Initiation and Message Exchange
The switch or the client can initiate authentication. If you enable authentication on a port by using the dot1x port-control auto interface configuration command, the switch initiates authentication when the link state changes from down to up or periodically as long as the port remains up and unauthenticated. The switch sends an EAP-request/identity frame to the client to request its identity. Upon receipt of the frame, the client responds with an EAP-response/identity frame.
However, if during bootup, the client does not receive an EAP-request/identity frame from the switch, the client can initiate authentication by sending an EAPOL-start frame, which prompts the switch to request the client's identity.
Note
If 802.1x is not enabled or supported on the network access device, any EAPOL frames from the client are dropped. If the client does not receive an EAP-request/identity frame after three attempts to start authentication, the client sends frames as if the port is in the authorized state. A port in the authorized state effectively means that the client has been successfully authenticated. For more information, see the "Ports in Authorized and Unauthorized States" section.
When the client supplies its identity, the switch begins its role as the intermediary, passing EAP frames between the client and the authentication server until authentication succeeds or fails. If the authentication succeeds, the switch port becomes authorized. For more information, see the "Ports in Authorized and Unauthorized States" section.
The specific exchange of EAP frames depends on the authentication method being used. Figure 8-2 shows a message exchange initiated by the client using the One-Time-Password (OTP) authentication method with a RADIUS server.
Figure 8-2 Message Exchange
Ports in Authorized and Unauthorized States
Depending on the switch port state, the switch can grant a client access to the network. The port starts in the unauthorized state. While in this state, the port that is not configured as a voice VLAN port disallows all ingress and egress traffic except for 802.1x, CDP, and STP packets. When a client is successfully authenticated, the port changes to the authorized state, allowing all traffic for the client to flow normally. If the port is configured as a voice VLAN port, the port allows VoIP traffic and 802.1x protocol packets before the client is successfully authenticated.
If a client that does not support 802.1x connects to an unauthorized 802.1x port, the switch requests the client's identity. In this situation, the client does not respond to the request, the port remains in the unauthorized state, and the client is not granted access to the network.
In contrast, when an 802.1x-enabled client connects to a port that is not running the 802.1x standard, the client initiates the authentication process by sending the EAPOL-start frame. When no response is received, the client sends the request for a fixed number of times. Because no response is received, the client begins sending frames as if the port is in the authorized state.
You control the port authorization state by using the dot1x port-control interface configuration command and these keywords:
•
force-authorized—disables 802.1x authentication and causes the port to change to the authorized state without any authentication exchange required. The port sends and receives normal traffic without 802.1x-based authentication of the client. This is the default setting.
•
force-unauthorized—causes the port to remain in the unauthorized state, ignoring all attempts by the client to authenticate. The switch cannot provide authentication services to the client through the port.
•
auto—enables 802.1x authentication and causes the port to begin in the unauthorized state, allowing only EAPOL frames to be sent and received through the port. The authentication process begins when the link state of the port changes from down to up or when an EAPOL-start frame is received. The switch requests the identity of the client and begins relaying authentication messages between the client and the authentication server. Each client attempting to access the network is uniquely identified by the switch by using the client MAC address.
If the client is successfully authenticated (receives an Accept frame from the authentication server), the port state changes to authorized, and all frames from the authenticated client are allowed through the port. If the authentication fails, the port remains in the unauthorized state, but authentication can be retried. If the authentication server cannot be reached, the switch can resend the request. If no response is received from the server after the specified number of attempts, authentication fails, and network access is not granted.
When a client logs off, it sends an EAPOL-logoff message, causing the switch port to change to the unauthorized state.
If the link state of a port changes from up to down, or if an EAPOL-logoff frame is received, the port returns to the unauthorized state.
802.1x Accounting
The IEEE 802.1x standard defines how users are authorized and authenticated for network access but does not keep track of network usage. 802.1x accounting is disabled by default. You can enable 802.1x accounting to monitor this activity on 802.1x-enabled ports:
•
User successfully authenticates.
•
User logs off.
•
Link-down occurs.
•
Re-authentication successfully occurs.
•
Re-authentication fails.
The switch does not log 802.1x accounting information. Instead, it sends this information to the RADIUS server, which must be configured to log accounting messages.
802.1x Host Mode
You can configure an 802.1x port for single-host or for multiple-hosts mode. In single-host mode (see Figure 8-1), only one client can be connected to the 802.1x-enabled switch port. The switch detects the client by sending an EAPOL frame when the port link state changes to the up state. If a client leaves or is replaced with another client, the switch changes the port link state to down, and the port returns to the unauthorized state.
In multiple-hosts mode, you can attach multiple hosts to a single 802.1x-enabled port. Figure 8-3 shows 802.1x port-based authentication in a wireless LAN. In this mode, only one of the attached clients must be authorized for all clients to be granted network access. If the port becomes unauthorized (re-authentication fails or an EAPOL-logoff message is received), the switch denies network access to all of the attached clients. In this topology, the wireless access point is responsible for authenticating the clients attached to it, and it also acts as a client to the switch.
With the multiple-hosts mode enabled, you can use 802.1x to authenticate the port and port security to manage network access for all MAC addresses, including that of the client.
Figure 8-3 Multiple Host Mode Example
Using 802.1x with Port Security
You can configure an 802.1x port with port security in either single-host or multiple-hosts mode. (You also must configure port security on the port by using the switchport port-security interface configuration command.) When you enable port security and 802.1x on a port, 802.1x authenticates the port, and port security manages network access for all MAC addresses, including that of the client. You can then limit the number or group of clients that can access the network through an 802.1x port.
These are some examples of the interaction between 802.1x and port security on the switch:
•
When a client is authenticated, and the port security table is not full, the client MAC address is added to the port security list of secure hosts. The port then proceeds to come up normally.
When a client is authenticated and manually configured for port security, it is guaranteed an entry in the secure host table (unless port security static aging has been enabled).
A security violation occurs if the client is authenticated, but the port security table is full. This can happen if the maximum number of secure hosts has been statically configured or if the client ages out of the secure host table. If the client address is aged, its place in the secure host table can be taken by another host.
If the security violation is caused by the first authenticated host, the port becomes error-disabled and immediately shuts down.
The port security violation modes determine the action for security violations. For more information, see the "Security Violations" section.
•
When you manually remove an 802.1x client address from the port security table by using the no switchport port-security mac-address mac-address interface configuration command, you should re-authenticate the 802.1x client by using the dot1x re-authenticate interface interface-id privileged EXEC command.
•
When an 802.1x client logs off, the port changes to an unauthenticated state, and all dynamic entries in the secure host table are cleared, including the entry for the client. Normal authentication then takes place.
•
If the port is administratively shut down, the port becomes unauthenticated, and all dynamic entries are removed from the secure host table.
•
Port security and a voice VLAN can be configured simultaneously on an 802.1x port that is in either single-host or multiple-hosts mode. Port security applies to both the voice VLAN identifier (VVID) and the port VLAN identifier (PVID).
For more information about enabling port security on your switch, see the "Configuring Port Security" section.
Using 802.1x with Voice VLAN Ports
A voice VLAN port is a special access port associated with two VLAN identifiers:
•
VVID to carry voice traffic to and from the IP phone. The VVID is used to configure the IP phone connected to the port.
•
PVID to carry the data traffic to and from the workstation connected to the switch through the IP phone. The PVID is the native VLAN of the port.
The IP phone uses the VVID for its voice traffic, regardless of the authorization state of the port. This allows the phone to work independently of 802.1x authentication.
In single-host mode, only the IP phone is allowed on the voice VLAN. In multiple-hosts mode, additional clients can send traffic on the voice VLAN after a supplicant is authenticated on the PVID. When multiple-hosts mode is enabled, the supplicant authentication affects both the PVID and the VVID.
A voice VLAN port becomes active when there is a link, and the device MAC address appears after the first CDP message from the IP phone. Cisco IP phones do not relay CDP messages from other devices. As a result, if several IP phones are connected in series, the switch recognizes only the one directly connected to it. When 802.1x is enabled on a voice VLAN port, the switch drops packets from unrecognized IP phones more than one hop away.
When 802.1x is enabled on a port, you cannot configure a port VLAN that is equal to a voice VLAN.
Note
If you enable 802.1x on an access port on which a voice VLAN is configured and to which a Cisco IP Phone is connected, the Cisco IP phone loses connectivity to the switch for up to 30 seconds.
For more information about voice VLANs, see "Configuring Voice VLAN."
Using 802.1x with VLAN Assignment
The RADIUS server sends the VLAN assignment to configure the switch port. The RADIUS server database maintains the username-to-VLAN mappings, assigning the VLAN based on the username of the client connected to the switch port. You can use this feature to limit network access for certain users.
When configured on the switch and the RADIUS server, 802.1x with VLAN assignment has these characteristics:
•
If no VLAN is supplied by the RADIUS server or if 802.1x authorization is disabled, the port is configured in its access VLAN after successful authentication.
•
If 802.1x authorization is enabled but the VLAN information from the RADIUS server is not valid, the port returns to the unauthorized state and remains in the configured access VLAN. This prevents ports from appearing unexpectedly in an inappropriate VLAN because of a configuration error.
Configuration errors could include specifying a VLAN for a routed port, a malformed VLAN ID, a nonexistent or internal (routed port) VLAN ID, or an attempted assignment to a voice VLAN ID.
•
If 802.1x authorization is enabled and all information from the RADIUS server is valid, the port is placed in the specified VLAN after authentication.
•
If the multiple-hosts mode is enabled on an 802.1x port, all hosts are placed in the same VLAN (specified by the RADIUS server) as the first authenticated host.
•
If 802.1x and port security are enabled on a port, the port is placed in the RADIUS server-assigned VLAN.
•
If 802.1x is disabled on the port, it is returned to the configured access VLAN.
When the port is in the force authorized, force unauthorized, unauthorized, or shutdown state, it is put into the configured access VLAN.
If an 802.1x port is authenticated and put in the RADIUS server-assigned VLAN, any change to the port access VLAN configuration does not take effect.
The 802.1x with VLAN assignment feature is not supported on trunk ports, dynamic ports, or with dynamic-access port assignment through a VLAN Membership Policy Server (VMPS).
To configure VLAN assignment you need to perform these tasks:
•
Enable AAA authorization by using the network keyword to allow interface configuration from the RADIUS server.
•
Enable 802.1x. (The VLAN assignment feature is automatically enabled when you configure 802.1x on an access port).
•
Assign vendor-specific tunnel attributes in the RADIUS server. The RADIUS server must return these attributes to the switch:
–
[64] Tunnel-Type = VLAN
–
[65] Tunnel-Medium-Type = 802
–
[81] Tunnel-Private-Group-ID = VLAN name or VLAN ID
Attribute [64] must contain the value VLAN (type 13). Attribute [65] must contain the value 802 (type 6). Attribute [81] specifies the VLAN name or VLAN ID assigned to the 802.1x-authenticated user.
For examples of tunnel attributes, see the "Configuring the Switch to Use Vendor-Specific RADIUS Attributes" section.
Using 802.1x with Guest VLAN
You can configure a guest VLAN for each 802.1x port on the switch to provide limited services to clients, such as downloading the 802.1x client. These clients might be upgrading their system for 802.1x authentication, and some hosts, such as Windows 98 systems, might not be 802.1x-capable.
When you enable a guest VLAN on an 802.1x port, the switch assigns clients to a guest VLAN when the authentication server does not receive a response to its EAPOL request/identity frame or when EAPOL packets are not sent by the client.
Before Cisco IOS Release 12.2(25)SE, the switch did not maintain the EAPOL packet history and allowed clients that failed authentication access to the guest VLAN, regardless of whether EAPOL packets had been detected on the interface. You can enable this optional behavior by using the dot1x guest-vlan supplicant global configuration command.
With Cisco IOS Release 12.2(25)SE and later, the switch maintains the EAPOL packet history. If another EAPOL packet is detected on the interface during the lifetime of the link, network access is denied. The EAPOL history is reset upon loss of the link.
Any number of 802.1x-incapable clients are allowed access when the switch port is moved to the guest VLAN. If an 802.1x-capable client joins the same port on which the guest VLAN is configured, the port is put into the unauthorized state in the user-configured access VLAN, and authentication is restarted.
Guest VLANs are supported on 802.1x ports in single-host or multiple-hosts mode.
You can configure any active VLAN except an RSPAN VLAN, private VLAN, or a voice VLAN as an 802.1x guest VLAN. The guest VLAN feature is not supported on internal VLANs (routed ports) or trunk ports; it is supported only on access ports.
For more information, see the "Configuring a Guest VLAN" section.
Using 802.1x with Per-User ACLs
You can enable per-user access control lists (ACLs) to provide different levels of network access and service to an 802.1x-authenticated user. When the RADIUS server authenticates a user connected to an 802.1x port, it retrieves the ACL attributes based on the user identity and sends them to the switch. The switch applies the attributes to the 802.1x port for the duration of the user session. The switch removes the per-user ACL configuration when the session is over, if authentication fails, or if a link-down condition occurs. The switch does not save RADIUS-specified ACLs in the running configuration. When the port is unauthorized, the switch removes the ACL from the port.
You can configure router ACLs and input port ACLs on the same switch. However, a port ACL takes precedence over a router ACL. If you apply input port ACL to an interface that belongs to a VLAN, the port ACL takes precedence over an input router ACL applied to the VLAN interface. Incoming packets received on the port to which a port ACL is applied are filtered by the port ACL. Incoming routed packets received on other ports are filtered by the router ACL. Outgoing routed packets are filtered by the router ACL. To avoid configuration conflicts, you should carefully plan the user profiles stored on the RADIUS server.
RADIUS supports per-user attributes, including vendor-specific attributes. These vendor-specific attributes (VSAs) are in octet-string format and are passed to the switch during the authentication process. The VSAs used for per-user ACLs are inacl#<
n> for the ingress direction and outacl#<
n> for the egress direction. MAC ACLs are supported only in the ingress direction. The switch supports VSAs only in the ingress direction. It does not support port ACLs in the egress direction on Layer 2 ports. For more information, see "Configuring Network Security with ACLs."
Use only the extended ACL syntax style to define the per-user configuration stored on the RADIUS server. When the definitions are passed from the RADIUS server, they are created by using the extended naming convention. However, if you use the Filter-Id attribute, it can point to a standard ACL.
You can use the Filter-Id attribute to specify an inbound or outbound ACL that is already configured on the switch. The attribute contains the ACL number followed by .in for ingress filtering or .out for egress filtering. If the RADIUS server does not allow the .in or .out syntax, the access list is applied to the outbound ACL by default. Because of limited support of Cisco IOS access lists on the switch, the Filter-Id attribute is supported only for IP ACLs numbered 1 to 199 and 1300 to 2699 (IP standard and IP extended ACLs).
Only one 802.1x-authenticated user is supported on a port. If the multiple-hosts mode is enabled on the port, the per-user ACL attribute is disabled for the associated port.
The maximum size of the per-user ACL is 4000 ASCII characters.
For examples of vendor-specific attributes, see the "Configuring the Switch to Use Vendor-Specific RADIUS Attributes" section. For more information about configuring ACLs, see "Configuring Network Security with ACLs."
To configure per-user ACLs, you need to perform these tasks:
•
Enable AAA authentication.
•
Enable AAA authorization by using the network keyword to allow interface configuration from the RADIUS server.
•
Enable 802.1x.
•
Configure the user profile and VSAs on the RADIUS server.
•
Configure the 802.1x port for single-host mode.
Configuring 802.1x Authentication
These sections describe how to configure 802.1x port-based authentication on your switch:
•
Default 802.1x Configuration
•
802.1x Configuration Guidelines
•
Configuring 802.1x Authentication (required)
•
Configuring the Switch-to-RADIUS-Server Communication (required)
•
Configuring Periodic Re-Authentication (optional)
•
Manually Re-Authenticating a Client Connected to a Port (optional)
•
Changing the Quiet Period (optional)
•
Changing the Switch-to-Client Retransmission Time (optional)
•
Setting the Switch-to-Client Frame-Retransmission Number (optional)
•
Setting the Re-Authentication Number (optional)
•
Configuring the Host Mode (optional)
•
Configuring a Guest VLAN (optional)
•
Resetting the 802.1x Configuration to the Default Values (optional)
•
Configuring 802.1x Accounting (optional)
Default 802.1x Configuration
Table 8-1 shows the default 802.1x configuration.
Table 8-1 Default 802.1x Configuration
|
|
AAA |
Disabled. |
RADIUS server • IP address • UDP authentication port • Key |
• None specified. • 1812. • None specified. |
Switch 802.1x enable state |
Disabled. |
Per-port 802.1x enable state |
Disabled (force-authorized). The port sends and receives normal traffic without 802.1x-based authentication of the client. |
Periodic re-authentication |
Disabled. |
Number of seconds between re-authentication attempts |
3600 seconds. |
Re-authentication number |
2 times (number of times that the switch restarts the authentication process before the port changes to the unauthorized state). |
Quiet period |
60 seconds (number of seconds that the switch remains in the quiet state following a failed authentication exchange with the client). |
Retransmission time |
30 seconds (number of seconds that the switch should wait for a response to an EAP request/identity frame from the client before resending the request). |
Maximum retransmission number |
2 times (number of times that the switch will send an EAP-request/identity frame before restarting the authentication process). |
Host mode |
Single-host mode. |
Guest VLAN |
None specified. |
Client timeout period |
30 seconds (when relaying a request from the authentication server to the client, the amount of time the switch waits for a response before resending the request to the client.) |
Authentication server timeout period |
30 seconds (when relaying a response from the client to the authentication server, the amount of time the switch waits for a reply before resending the response to the server. This setting is not configurable.) |
802.1x Configuration Guidelines
These are the 802.1x authentication configuration guidelines:
•
When 802.1x is enabled, ports are authenticated before any other Layer 2 or Layer 3 features are enabled.
•
The 802.1x protocol is supported on Layer 2 static-access ports, voice VLAN ports, and Layer 3 routed ports, but it is not supported on these port types:
–
Trunk port—If you try to enable 802.1x on a trunk port, an error message appears, and 802.1x is not enabled. If you try to change the mode of an 802.1x-enabled port to trunk, an error message appears, and the port mode is not changed.
–
Dynamic ports—A port in dynamic mode can negotiate with its neighbor to become a trunk port. If you try to enable 802.1x on a dynamic port, an error message appears, and 802.1x is not enabled. If you try to change the mode of an 802.1x-enabled port to dynamic, an error message appears, and the port mode is not changed.
–
Dynamic-access ports—If you try to enable 802.1x on a dynamic-access (VLAN Query Protocol [VQP]) port, an error message appears, and 802.1x is not enabled. If you try to change an 802.1x-enabled port to dynamic VLAN assignment, an error message appears, and the VLAN configuration is not changed.
–
EtherChannel port—Do not configure a port that is an active or a not-yet-active member of an EtherChannel as an 802.1x port. If you try to enable 802.1x on an EtherChannel port, an error message appears, and 802.1x is not enabled.
Note
In software releases earlier than Cisco IOS Release 12.2(18)SE, if 802.1x is enabled on a not-yet active port of an EtherChannel, the port does not join the EtherChannel.
–
Switched Port Analyzer (SPAN) and Remote SPAN (RSPAN) destination ports—You can enable 802.1x on a port that is a SPAN or RSPAN destination port. However, 802.1x is disabled until the port is removed as a SPAN or RSPAN destination port. You can enable 802.1x on a SPAN or RSPAN source port.
•
You can configure any VLAN except an RSPAN VLAN, private VLAN, or a voice VLAN as an 802.1x guest VLAN. The guest VLAN feature is not supported on internal VLANs (routed ports) or trunk ports; it is supported only on access ports.
•
When 802.1x is enabled on a port, you cannot configure a port VLAN that is equal to a voice VLAN.
•
The 802.1x with VLAN assignment feature is not supported on private-VLAN ports, trunk ports, dynamic ports, or with dynamic-access port assignment through a VMPS.
•
You can configure 802.1x on a private-VLAN port, but do not configure 802.1x with port security, voice VLAN, guest VLAN, or a per-user ACL on private-VLAN ports.
•
Before globally enabling 802.1x on a switch by entering the dot1x system-auth-control global configuration command, remove the EtherChannel configuration from the interfaces on which 802.1x and EtherChannel are configured.
•
If you are using a device running the Cisco Access Control Server (ACS) application for 802.1x authentication with EAP-Transparent LAN Services (TLS) and EAP-MD5 and your switch is running Cisco IOS Release 12.1(14)EA1, make sure that the device is running ACS Version 3.2.1 or later.
•
After you configure a guest VLAN for an 802.1x port to which a DHCP client is connected, you might need to get a host IP address from a DHCP server. You can also change the settings for restarting the 802.1x authentication process on the switch before the DHCP process on the client times out and tries to get a host IP address from the DHCP server. Decrease the settings for the 802.1x authentication process (802.1x quiet period and switch-to-client transmission time).
Configuring 802.1x Authentication
To configure 802.1x port-based authentication, you must enable authentication, authorization, and accounting (AAA) and specify the authentication method list. A method list describes the sequence and authentication method to be queried to authenticate a user.
To allow per-user ACLs or VLAN assignment, you must enable AAA authorization to configure the switch for all network-related service requests.
This is the 802.1x AAA process:
Step 1
A user connects to a port on the switch.
Step 2
Authentication is performed.
Step 3
VLAN assignment is enabled, as appropriate, based on the RADIUS server configuration.
Step 4
The switch sends a start message to an accounting server.
Step 5
Re-authentication is performed, as necessary.
Step 6
The switch sends an interim accounting update to the accounting server that is based on the result of re-authentication.
Step 7
The user disconnects from the port.
Step 8
The switch sends a stop message to the accounting server.
Beginning in privileged EXEC mode, follow these steps to configure 802.1x port-based authentication:
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
aaa new-model |
Enable AAA. |
Step 3 |
aaa authentication dot1x {default} method1 |
Create an 802.1x authentication method list. To create a default list that is used when a named list is not specified in the authentication command, use the default keyword followed by the method that is to be used in default situations. The default method list is automatically applied to all ports. For method1, enter the group radius keywords to use the list of all RADIUS servers for authentication. Note Though other keywords are visible in the command-line help string, only the group radius keywords are supported. |
Step 4 |
dot1x system-auth-control |
Enable 802.1x authentication globally on the switch. |
Step 5 |
aaa authorization network {default} group radius |
(Optional) Configure the switch for user RADIUS authorization for all network-related service requests, such as per-user ACLs or VLAN assignment. Note For per-user ACLs, single-host mode must be configured. This setting is the default. |
Step 6 |
interface interface-id |
Specify the port connected to the client that is to be enabled for 802.1x authentication, and enter interface configuration mode. |
Step 7 |
dot1x port-control auto |
Enable 802.1x authentication on the port. For feature interaction information, see the "802.1x Configuration Guidelines" section. |
Step 8 |
end |
Return to privileged EXEC mode. |
Step 9 |
show dot1x |
Verify your entries. |
Step 10 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Configuring the Switch-to-RADIUS-Server Communication
RADIUS security servers are identified by their host name or IP address, host name and specific UDP port numbers, or IP address and specific UDP port numbers. The combination of the IP address and UDP port number creates a unique identifier, which enables RADIUS requests to be sent to multiple UDP ports on a server at the same IP address. If two different host entries on the same RADIUS server are configured for the same service—for example, authentication—the second host entry configured acts as the fail-over backup to the first one. The RADIUS host entries are tried in the order that they were configured.
Beginning in privileged EXEC mode, follow these steps to configure the RADIUS server parameters on the switch. This procedure is required.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
radius-server host {hostname | ip-address} auth-port port-number key string |
Configure the RADIUS server parameters. For hostname | ip-address, specify the host name or IP address of the remote RADIUS server. For auth-port port-number, specify the UDP destination port for authentication requests. The default is 1812. The range is 0 to 65536. For key string, specify the authentication and encryption key used between the switch and the RADIUS daemon running on the RADIUS server. The key is a text string that must match the encryption key used on the RADIUS server. Note Always configure the key as the last item in the radius-server host command syntax because leading spaces are ignored, but spaces within and at the end of the key are used. If you use spaces in the key, do not enclose the key in quotation marks unless the quotation marks are part of the key. This key must match the encryption used on the RADIUS daemon. If you want to use multiple RADIUS servers, re-enter this command. |
Step 3 |
end |
Return to privileged EXEC mode. |
Step 4 |
show running-config |
Verify your entries. |
Step 5 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To delete the specified RADIUS server, use the no radius-server host {hostname | ip-address} global configuration command.
This example shows how to specify the server with IP address 172.20.39.46 as the RADIUS server, to use port 1612 as the authorization port, and to set the encryption key to rad123, matching the key on the RADIUS server:
Switch(config)# radius-server host 172.l20.39.46 auth-port 1612 key rad123
You can globally configure the timeout, retransmission, and encryption key values for all RADIUS servers by using the radius-server host global configuration command. If you want to configure these options on a per-server basis, use the radius-server timeout, radius-server retransmit, and the radius-server key global configuration commands. For more information, see the "Configuring Settings for All RADIUS Servers" section.
You also need to configure some settings on the RADIUS server. These settings include the IP address of the switch and the key string to be shared by both the server and the switch. For more information, see the RADIUS server documentation.
Configuring Periodic Re-Authentication
You can enable periodic 802.1x client re-authentication and specify how often it occurs. If you do not specify a time period before enabling re-authentication, the number of seconds between re-authentication attempts is 3600.
Beginning in privileged EXEC mode, follow these steps to enable periodic re-authentication of the client and to configure the number of seconds between re-authentication attempts. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
dot1x reauthentication |
Enable periodic re-authentication of the client, which is disabled by default. |
Step 4 |
dot1x timeout reauth-period seconds |
Set the number of seconds between re-authentication attempts. The range is 1 to 65535; the default is 3600 seconds. This command affects the behavior of the switch only if periodic re-authentication is enabled. |
Step 5 |
end |
Return to privileged EXEC mode. |
Step 6 |
show dot1x interface interface-id |
Verify your entries. |
Step 7 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To disable periodic re-authentication, use the no dot1x reauthentication interface configuration command. To return to the default number of seconds between re-authentication attempts, use the no dot1x timeout reauth-period interface configuration command.
This example shows how to enable periodic re-authentication and set the number of seconds between re-authentication attempts to 4000:
Switch(config-if)# dot1x reauthentication
Switch(config-if)# dot1x timeout reauth-period 4000
Manually Re-Authenticating a Client Connected to a Port
You can manually re-authenticate the client connected to a specific port at any time by entering the dot1x re-authenticate interface interface-id privileged EXEC command. This step is optional. If you want to enable or disable periodic re-authentication, see the "Configuring Periodic Re-Authentication" section.
This example shows how to manually re-authenticate the client connected to a port:
Switch# dot1x re-authenticate interface gigabitethernet0/1
Changing the Quiet Period
When the switch cannot authenticate the client, the switch remains idle for a set period of time and then tries again. The dot1x timeout quiet-period interface configuration command controls the idle period. A failed authentication of the client might occur because the client provided an invalid password. You can provide a faster response time to the user by entering a smaller number than the default.
Beginning in privileged EXEC mode, follow these steps to change the quiet period. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
dot1x timeout quiet-period seconds |
Set the number of seconds that the switch remains in the quiet state following a failed authentication exchange with the client. The range is 1 to 65535 seconds; the default is 60. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To return to the default quiet time, use the no dot1x timeout quiet-period interface configuration command.
This example shows how to set the quiet time on the switch to 30 seconds:
Switch(config-if)# dot1x timeout quiet-period 30
Changing the Switch-to-Client Retransmission Time
The client responds to the EAP-request/identity frame from the switch with an EAP-response/identity frame. If the switch does not receive this response, it waits a set period of time (known as the retransmission time) and then resends the frame.
Note
You should change the default value of this command only to adjust for unusual circumstances such as unreliable links or specific behavioral problems with certain clients and authentication servers.
Beginning in privileged EXEC mode, follow these steps to change the amount of time that the switch waits for client notification. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
dot1x timeout tx-period seconds |
Set the number of seconds that the switch waits for a response to an EAP-request/identity frame from the client before resending the request. The range is 15 to 65535 seconds; the default is 30. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1xinterface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To return to the default retransmission time, use the no dot1x timeout tx-period interface configuration command.
This example shows how to set 60 as the number of seconds that the switch waits for a response to an EAP-request/identity frame from the client before resending the request:
Switch(config-if)# dot1x timeout tx-period 60
Setting the Switch-to-Client Frame-Retransmission Number
In addition to changing the switch-to-client retransmission time, you can change the number of times that the switch sends an EAP-request/identity frame (assuming no response is received) to the client before restarting the authentication process.
Note
You should change the default value of this command only to adjust for unusual circumstances such as unreliable links or specific behavioral problems with certain clients and authentication servers.
Beginning in privileged EXEC mode, follow these steps to set the switch-to-client frame-retransmission number. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
dot1x max-req count |
Set the number of times that the switch sends an EAP-request/identity frame to the client before restarting the authentication process. The range is 1 to 10; the default is 2. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To return to the default retransmission number, use the no dot1x max-req interface configuration command.
This example shows how to set 5 as the number of times that the switch sends an EAP-request/identity request before restarting the authentication process:
Switch(config-if)# dot1x max-req 5
Setting the Re-Authentication Number
You can also change the number of times that the switch restarts the authentication process before the port changes to the unauthorized state.
Note
You should change the default value of this command only to adjust for unusual circumstances such as unreliable links or specific behavioral problems with certain clients and authentication servers.
Beginning in privileged EXEC mode, follow these steps to set the re-authentication number. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
dot1x max-reauth-req count |
Set the number of times that the switch restarts the authentication process before the port changes to the unauthorized state. The range is 1 to 10; the default is 2. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To return to the default re-authentication number, use the no dot1x max-reauth-req interface configuration command.
This example shows how to set 4 as the number of times that the switch restarts the authentication process before the port changes to the unauthorized state:
Switch(config-if)# dot1x max-reauth-req 4
Configuring the Host Mode
Beginning in privileged EXEC mode, follow these steps to allow multiple hosts (clients) on an 802.1x-authorized port that has the dot1x port-control interface configuration command set to auto. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to which multiple hosts are indirectly attached, and enter interface configuration mode. |
Step 3 |
dot1x host-mode multi-host |
Allow multiple hosts (clients) on an 802.1x-authorized port. Make sure that the dot1x port-control interface configuration command set is set to auto for the specified interface. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To disable multiple hosts on the port, use the no dot1x host-mode multi-host interface configuration command.
This example shows how to enable 802.1x and to allow multiple hosts:
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# dot1x port-control auto
Switch(config-if)# dot1x host-mode multi-host
Configuring a Guest VLAN
When you configure a guest VLAN, clients that are not 802.1x-capable are put into the guest VLAN when the server does not receive a response to its EAPOL request/identity frame. Clients that are 802.1x-capable but fail authentication are not granted access to the network. The switch supports guest VLANs in single-host or multiple-hosts mode.
Beginning in privileged EXEC mode, follow these steps to configure a guest VLAN. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. For the supported port types, see the "802.1x Configuration Guidelines" section. |
Step 3 |
dot1x guest-vlan vlan-id |
Specify an active VLAN as an 802.1x guest VLAN. The range is 1 to 4094. You can configure any active VLAN except an internal VLAN (routed port), an RSPAN VLAN, private VLAN, or a voice VLAN as an 802.1x guest VLAN. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To disable and remove the guest VLAN, use the no dot1x guest-vlan interface configuration command. The port returns to the unauthorized state.
This example shows how to enable VLAN 2 as an 802.1x guest VLAN:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)# dot1x guest-vlan 2
This example shows how to set 3 as the quiet time on the switch, to set 15 as the number of seconds that the switch waits for a response to an EAP-request/identity frame from the client before resending the request, and to enable VLAN 2 as an 802.1x guest VLAN when an 802.1x port is connected to a DHCP client:
Switch(config-if)# dot1x timeout quiet-period 3
Switch(config-if)# dot1x timeout tx-period 15
Switch(config-if)# dot1x guest-vlan 2
You can enable optional guest VLAN behavior by using the dot1x guest-vlan supplicant global configuration command. When enabled, the switch does not maintain the EAPOL packet history and allows clients that fail authentication access to the guest VLAN, regardless of whether EAPOL packets had been detected on the interface.
Beginning in privileged EXEC mode, follow these steps to enable the optional guest VLAN behavior and to configure a guest VLAN. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
dot1x guest-vlan supplicant |
Enable the optional guest VLAN behavior globally on the switch. |
Step 3 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. For the supported port types, see the "802.1x Configuration Guidelines" section. |
Step 4 |
dot1x guest-vlan vlan-id |
Specify an active VLAN as an 802.1x guest VLAN. The range is 1 to 4094. You can configure any active VLAN except an internal VLAN (routed port), an RSPAN VLAN, private VLAN, or a voice VLAN as an 802.1x guest VLAN. |
Step 5 |
end |
Return to privileged EXEC mode. |
Step 6 |
show dot1x interface interface-id |
Verify your entries. |
Step 7 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
To disable the optional guest VLAN behavior, use the no dot1x guest-vlan supplicant global configuration command. To remove the guest VLAN, use the no dot1x guest-vlan interface configuration command. The port returns to the unauthorized state.
This example shows how enable the optional guest VLAN behavior and to specify VLAN 5 as an 802.1x guest VLAN:
Switch(config)# dot1x guest-vlan supplicant
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# dot1x guest-vlan 5
Resetting the 802.1x Configuration to the Default Values
Beginning in privileged EXEC mode, follow these steps to reset the 802.1x configuration to the default values. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Enter interface configuration mode, and specify the port to be configured. |
Step 3 |
dot1x default |
Reset the configurable 802.1x parameters to the default values. |
Step 4 |
end |
Return to privileged EXEC mode. |
Step 5 |
show dot1x interface interface-id |
Verify your entries. |
Step 6 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Configuring 802.1x Accounting
Enabling AAA system accounting with 802.1x accounting allows system reload events to be sent to the accounting RADIUS server for logging. The server can then infer that all active 802.1x sessions are closed.
Because RADIUS uses the unreliable UDP transport protocol, accounting messages might be lost due to poor network conditions. If the switch does not receive the accounting response message from the RADIUS server after a configurable number of retransmissions of an accounting request, this system message appears:
Accounting message %s for session %s failed to receive Accounting Response.
When the stop message is not sent successfully, this message appears:
00:09:55: %RADIUS-3-NOACCOUNTINGRESPONSE: Accounting message Start for session
172.20.50.145 sam 11/06/03 07:01:16 11000002 failed to receive Accounting Response.
Note
You must configure the RADIUS server to perform accounting tasks, such as logging start, stop, and interim-update messages and time stamps. To turn on these functions, enable logging of "Update/Watchdog packets from this AAA client" in your RADIUS server Network Configuration tab. Next, enable "CVS RADIUS Accounting" in your RADIUS server System Configuration tab.
Beginning in privileged EXEC mode, follow these steps to configure 802.1x accounting after AAA is enabled on your switch. This procedure is optional.
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Specify the port to be configured, and enter interface configuration mode. |
Step 3 |
aaa accounting dot1x default start-stop group radius |
Enable 802.1x accounting using the list of all RADIUS servers. |
Step 4 |
aaa accounting system default start-stop group radius |
(Optional) Enables system accounting (using the list of all RADIUS servers) and generates system accounting reload event messages when the switch reloads. |
Step 5 |
end |
Return to privileged EXEc mode. |
Step 6 |
show running-config |
Verify your entries. |
Step 7 |
copy running-config startup-config |
(Optional) Saves your entries in the configuration file. |
Use the show radius statistics privileged EXEC command to display the number of RADIUS messages that do not receive the accounting response message.
This example shows how to configure 802.1x accounting. The first command configures the RADIUS server, specifying 1813 as the UDP port for accounting:
Switch(config)# radius-server host 172.120.39.46 auth-port 1812 acct-port 1813 key rad123
Switch(config)# aaa accounting dot1x default start-stop group radius
Switch(config)# aaa accounting system default start-stop group radius
Displaying 802.1x Statistics and Status
To display 802.1x statistics for all ports, use the show dot1x all statistics privileged EXEC command. To display 802.1x statistics for a specific port, use the show dot1x statistics interface interface-id privileged EXEC command.
To display the 802.1x administrative and operational status for the switch, use the show dot1x all privileged EXEC command. To display the 802.1x administrative and operational status for a specific port, use the show dot1x interface interface-id privileged EXEC command.
For detailed information about the fields in these displays, see the command reference for this release.