Understanding 802.1X Authentication
Understanding 802.1X Authentication
1X
Authentication
Issue 01
Date 2019-05-20
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,
and recommendations in this document are provided "AS IS" without warranties, guarantees or
representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: http://e.huawei.com
Contents
Definition
802.1X defines a port-based network access control and authentication protocol that prevents
unauthorized clients from connecting to a LAN through publicly accessible ports unless they
are properly authenticated.
Benefits
l 802.1X is a Layer 2 protocol and does not involve Layer 3 processing. It does not require
high performance of access devices, reducing network construction costs.
l Authentication packets and data packets are transmitted through different logical
interfaces, improving network security.
l The client is usually a user terminal. The user triggers 802.1X authentication using client
software. The client must support Extensible Authentication Protocol over LAN
(EAPoL).
l The access device is usually a network device that supports the 802.1X protocol. It
provides a port, either physical or logical, for the client to access the LAN.
l The authentication server, typically a RADIUS server, carries out authentication,
authorization, and accounting on users.
Overview
In the 802.1X authentication system, the client, access device, and authentication server
exchange information using the Extensible Authentication Protocol (EAP). EAP can run
without an IP address over various bottom layers, including the data link layer and upper-
layer protocols (such as UDP and TCP). This offers great flexibility to 802.1X authentication.
l The EAP packets transmitted between the client and access device are encapsulated in
EAPoL format and transmitted across the LAN.
l You can determine to use either of the following authentication modes between the
access device and authentication server based on the client support and network security
requirements:
– EAP termination mode: The access device terminates EAP packets and
encapsulates them into RADIUS packets. The authentication server then uses the
standard RADIUS protocol to implement authentication, authorization, and
accounting.
– EAP relay mode: The access device directly encapsulates the received EAP packets
into RADIUS using EAP over RADIUS (EAPoR) packets, and then transmits these
packets over a complex network to the authentication server.
EAP Packet
Data Zero or multiple The format of the Data field is determined by the
bytes Code field.
l When the value of the Code field is 1 or 2, the
EAP data packet is a Request or Response
packet, and the Data field contains the Type and
Type Data fields, as shown in the preceding
figure. The Type field is one byte long and
indicates the type of the Request or Response
packet. The Type Data field is multiple bytes
long and its value is determined by the Type
field.
l When the value of the Code field is 3 or 4, the
EAP data packet is a Success or Failure packet
and does not have the Data field.
EAPoL Packet
EAPoL is a packet encapsulation format defined by the 802.1X protocol. EAPoL is mainly
used to transmit EAP packets over a LAN between the client and access device. The
following figure shows the format of an EAPoL packet.
PAE Ethernet 2 Indicates the protocol type. The value is fixed at 0x888E.
Type
Length 2 Indicates the data length, that is, the length of the Packet
Body field, in bytes. The value 0 indicates that the Packet
Body field does not exist. For the EAPoL-Start and
EAPoL-Logoff packets, the values of the Length field are
both 0.
EAPoR
To support EAP relay, the following attributes are added to the RADIUS protocol:
l EAP-Message: is used to encapsulate EAP packets.
l Message-Authenticator: is used to authenticate and verify authentication packets to
protect against spoofing of invalid packets.
The following figure shows the format of an EAPoR packet.
1. To access an extranet, a user starts the 802.1X client program, enters the applied and
registered user name and password, and initiates a connection request. At this time, the
client sends an EAPoL-Start packet to the access device to start the authentication
process.
2. After receiving the EAPoL-Start packet, the access device returns an EAP-Request/
Identity packet to the client for its identity.
3. Upon receipt of the EAP-Request/Identity packet, the client sends an EAP-Response/
Identity packet that contains the user name to the access device.
4. The access device encapsulates the EAP-Response/Identity packet into a RADIUS
Access-Request packet and sends the RADIUS packet to the authentication server.
5. After receiving the user name forwarded by the access device, the RADIUS server
searches the user name table in the database for the corresponding password, encrypts
the password with a randomly generated MD5 challenge, and sends a RADIUS Access-
Challenge packet containing the MD5 challenge to the access device.
6. The access device forwards the MD5 challenge sent by the RADIUS server to the client.
7. Upon receipt of the MD5 challenge, the client encrypts the password with the MD5
challenge, generates an EAP-Response/MD5-Challenge packet, and sends the packet to
the access device.
8. The access device encapsulates the EAP-Response/MD5-Challenge packet into a
RADIUS Access-Request packet and sends the RADIUS packet to the RADIUS server.
9. The RADIUS server compares the received encrypted password with the locally
encrypted password. If the two passwords match, the user is considered to be valid and
the RADIUS server sends a RADIUS Access-Accept packet (authentication is
successful) to the access device.
10. After receiving the RADIUS Access-Accept packet, the access device sends an EAP-
Success packet to the client, changes the port state to authorized, and allows the user to
access the network through the port.
11. When the user is online, the access device periodically sends a handshake packet to the
client to monitor the user.
12. After receiving a handshake packet, the client sends a response packet to the access
device, indicating that the user is still online. By default, the access device disconnects
the user if it does not receive any response from the client after sending two consecutive
handshake packets. The handshake mechanism allows the access device to detect
unexpected user disconnections.
13. To go offline, the client sends an EAPoL-Logoff packet to the access device.
14. The access device changes the port state from authorized to unauthorized and sends an
EAP-Failure packet to the client.
In EAP termination mode, the MD5 challenge for encrypting the user password is randomly
generated by the access device, instead of the authentication server in EAP relay mode.
Besides, in EAP termination mode, the access device uses the CHAP protocol to encapsulate
the user name, challenge, and password encrypted by the client into standard RADIUS
packets and sends them to the authentication server for authentication. In EAP relay mode, in
contrast, the access device is only responsible for encapsulating EAP packets into RADIUS
packets and transparently transmitting them to the authentication server.
4 802.1X Authorization
Authentication checks whether the identity of the user who attempts to access the network is
valid. Authorization specifies the network access rights that the authorized user can have, that
is, the resources that the authorized user can access. VLANs, ACLs, and UCLs are often used
for authorization. RADIUS authorization is used as an example. For details about other
authorization methods and more authorization parameters, see 授权方案.
VLAN
To prevent unauthenticated users from accessing restricted network resources, the restricted
network resources and unauthenticated users are allocated to different VLANs. After a user is
authenticated, the authentication server returns an authorized VLAN to the user. The access
device then changes the VLAN to which the user belongs to the authorized VLAN, with the
interface configuration remaining unchanged. The authorized VLAN takes precedence over
the VLAN configured on the interface. That is, the authorized VLAN takes effect after the
authentication succeeds, and the configured VLAN takes effect after the user goes offline.
When the RADIUS server assigns an authorized VLAN, the following standard RADIUS
attributes must be used together:
ACL
After a user is authenticated, the authentication server assigns an ACL to the user. Then, the
access device controls the user packets according to the ACL.
l If the user packets match the permit rule in the ACL, the packets are allowed to pass
through.
l If the user packets match the deny rule in the ACL, the packets are discarded.
The RADIUS server can assign an ACL to a user in either of the following modes:
l Static ACL assignment: The RADIUS server uses the standard RADIUS attribute Filter-
Id to assign an ACL ID to the user. In this mode, the ACL and corresponding rules are
configured on the access device in advance.
l Dynamic ACL assignment: The RADIUS server uses the RADIUS attribute HW-Data-
Filter extended by Huawei to assign an ACL ID and corresponding rules to the user. In
this mode, the ACL ID and ACL rules are configured on the RADIUS server.
UCL
A User Control List (UCL) is a collection of network terminals such as PCs and smartphones.
The administrator can add users having the same network access requirements to a UCL, and
configure a network access policy for the UCL, greatly reducing the administrator's workload.
The RADIUS server assigns a UCL to a specified user in either of the following modes:
l Assigns the UCL name through the standard RADIUS attribute Filter-Id.
l Assigns the UCL ID through the RADIUS attribute HW-UCL-Group extended by
Huawei.
You must configure the UCL and its network access policy on the access device in advance
regardless of the UCL authorization mode used.
Free Rule
A free rule allows users to obtain certain network access rights before they are authenticated,
to meet basic network access requirements.
You can configure either a common free rule or an ACL-defined free rule. A common free
rule is determined by parameters such as the IP address, MAC address, interface, and VLAN,
while an ACL-defined free rule is determined by ACL rules. Both the rules can specify the
destination IP address that users can access before being authenticated. An ACL-based free
rule can also define the name of a destination domain that users can access before being
authenticated.
Sometimes, defining a free rule by domain name is simpler and more convenient than
defining a free rule by IP address. This is because a domain name is easier to remember. For
example, some users who do not have an authentication account must first log in to the
official website of a carrier and apply for a member account, or log in using a third-party
account such as a Twitter or Facebook account. In this case, you can configure ACL-defined
free rules to specify domain names of the websites that users can access before they are
authenticated.
5 802.1X Re-authentication
Table 5-2 Methods of configuring re-authentication for users in abnormal authentication state
User State Configuration Command
When users go offline but the access device and RADIUS server do not detect the offline
events, the following problems may occur:
l The RADIUS server still performs accounting for the users, causing incorrect
accounting.
l Unauthorized users may spoof IP addresses and MAC addresses of authorized users to
access the network.
l If there are many offline users, these users are still counted as access users of the device.
As a result, other users may fail to access the network.
The access device needs to detect user logout immediately, delete the user entry, and instruct
the RADIUS server to stop accounting.
A user may log out in the following scenarios: The user proactively logs out on the client, the
access device controls user logout, and the RADIUS server logs out the user.
Assume that the handshake period of a user is 3T, which can be set by running the
authentication timer handshake-period handshake-period command. Here, T = handshake-
period/3.
1. The user sends any packet to trigger 802.1X authentication, and the detection timer
starts.
2. Within several T periods, the access device receives traffic from the client and the user
keeps online.
3. The user sends the last packet. When the current T period expires, the access device
determines that the user is online because traffic is still received from the client, and
resets the detection timer.
4. The access device does not receive traffic from the client within a T period, and sends
the first ARP request packet. The client does not respond.
5. The access device does not receive traffic from the client within another T period, and
sends the second ARP request packet. The client does not respond.
6. The access device does not receive traffic from the client within a third T period. The
access device determines that ARP probing fails and deletes the user entry.
7 802.1X Timers
802.1X relies on several timers to control the number of packet retransmission times and
timeout interval. This section outlines the timers on the device that are relevant to the 802.1X
authentication process.
Figure 7-1 Timeout timer for EAP-Request/Identity packets when MAC address bypass
authentication is not configured
Figure 7-2 shows the operation of the timer when MAC address bypass authentication is
configured. The device performs 802.1X authentication first and starts the timer defined by
the dot1x timer mac-bypass-delay delay-time-value command. If 802.1X authentication is
not successful before the timer expires, the device performs MAC address authentication for
terminals. In this situation, the interval at which the device resends an EAP-Request/Identity
packet is the integer of the result calculated as follows: delay-time-value/(max-retry-value+1).
Figure 7-2 Timeout timer for EAP-Request/Identity packets when MAC address bypass
authentication is not configured
As shown in Figure 7-3, EAP-Request/MD5 Challenge packets time out, and then the device
sends an EAP Failure packet to the client and starts a failover mechanism (MAC address
authentication, Portal authentication, or granting specified access permissions) if configured.
The total time it takes for EAP-Request/MD5 Challenge packets to time out is determined by
the following formula:
Quiet Timer
This section discusses the timer that controls when 802.1X restarts after the number of failed
802.1X authentication attempts within 60 seconds reaches the value specified by the dot1x
quiet-times fail-times command.
If 802.1X fails and there are no failover mechanisms enabled, the device waits for a period of
time known as the quiet-period (configured by the dot1x timer quiet-period quiet-period-
value command). During this period of time, the device discards users' 802.1X authentication
request packets, avoiding frequent authentication failures.