- Table of Contents
- Related Documents
-
| Title | Size | Download |
|---|---|---|
| 03-MAC authentication commands | 199.23 KB |
Contents
display mac-authentication connection
mac-authentication access-user log enable
mac-authentication authentication-method
mac-authentication carry user-ip
mac-authentication mac-range-account
mac-authentication offline-detect enable
mac-authentication offline-detect mac-address
mac-authentication timer (system view)
mac-authentication user-name-format
reset mac-authentication access-user
reset mac-authentication statistics
MAC authentication commands
display mac-authentication
Use display mac-authentication to display MAC authentication settings and statistics.
Syntax
display mac-authentication [ interface interface-type interface-number ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
interface interface-type interface-number: Specifies a port by its type and number. If the specified port is not enabled with MAC authentication, this command displays only global MAC authentication information.
Usage guidelines
If you do not specify any parameters, this command displays all MAC authentication information including the global settings, port-specific settings, MAC authentication statistics, and online user statistics.
Examples
# Display all MAC authentication settings and statistics.
<Sysname> display mac-authentication
Global MAC authentication parameters:
MAC authentication : Enabled
Authentication method : PAP
M-LAG member configuration conflict : Unknown
Username format : MAC address in lowercase(xx-xx-xx-xx-xx-xx)
Username : mac
Password : Not configured
Offline detect period : 300 s
Quiet period : 60 s
Server timeout : 100 s
Reauth period : 3600 s
User aging period for critical VLAN : 1000 s
User aging period for guest VLAN : 1000 s
Authentication domain : Not configured, use default domain
Online MAC-auth wired users : 1
Silent MAC users:
MAC address VLAN ID From port Port index
HundredGigE1/0/1 is link-up
MAC authentication : Enabled
Carry User-IP : Disabled
Authentication domain : Not configured
Auth-delay timer : Enabled
Auth-delay period : 60 s
Periodic reauth : Enabled
Reauth period : 120 s
Re-auth server-unreachable : Logoff
Guest VLAN : 100
Guest VLAN reauthentication : Enabled
Guest VLAN auth-period : 150 s
Critical VLAN : Not configured
Critical voice VLAN : Disabled
Host mode : Multiple VLAN
Offline detection : Enabled
Authentication order : Parallel
User aging : Enabled
Server-recovery online-user-sync : Enabled
Auto-tag feature : Disabled
VLAN tag configuration ignoring : Disabled
Max online users : 4294967295
Authentication attempts : successful 2, failed 3
Current online users : 1
MAC address Auth state
0001-0000-0000 Authenticated
0001-0000-0001 Unauthenticated
Table 1 Command output
|
Field |
Description |
|
MAC authentication |
Whether MAC authentication is enabled globally. |
|
M-LAG member configuration conflict |
M-LAG member configuration check result: · Conflicted—The configuration on one M-LAG member device conflicts with that on the other M-LAG member device. · Not conflicted—The configuration on one M-LAG member device does not conflict with that on the other M-LAG member device. · Unknown—The system cannot detect whether the configuration on one M-LAG member device conflicts with that on the other M-LAG member device. |
|
Authentication method |
Authentication method for MAC authentication: CHAP or PAP. |
|
Username format |
User account type: MAC-based or shared. · If MAC-based accounts are used, this field displays the format settings for the username. For example, MAC address in lowercase(xx-xx-xx-xx-xx-xx) indicates that the MAC address is in hexadecimal notation and is separated into six sections by hyphen (-). The letters in the MAC address are in lower case. · If a shared account is used, this field displays Fixed account. |
|
Username |
Username for MAC authentication. · If MAC-based accounts are used, this field displays mac. · If a shared account is used, this field displays the username of the shared account for MAC authentication users. By default, the username is mac. |
|
Password |
Password for MAC authentication. · If the MAC address of each user is used as the password or if a shared account is used but no password is configured, this field displays Not configured. · If a password is configured, this field displays a string of asterisks (******). |
|
Offline detect period |
Offline detect timer. |
|
Quiet period |
Quiet timer. This field is not supported in the current software version. |
|
Server timeout |
Server timeout timer. |
|
Reauth period |
Periodic MAC reauthentication timer in seconds. This field is not supported in the current software version. |
|
User aging period for critical VLAN |
Aging timer in seconds for users in critical VLANs. This field is not supported in the current software version. |
|
User aging period for guest VLAN |
Aging timer in seconds for users in guest VLANs. This field is not supported in the current software version. |
|
Authentication domain |
MAC authentication domain specified in system view. If no authentication domain is specified in system view, this field displays Not configured, use default domain. |
|
Online MAC-auth wired users |
Number of wired online MAC authentication users, including users that have passed MAC authentication and users that are performing MAC authentication. |
|
Silent MAC users |
Information about silent MAC addresses, including MAC addresses that have failed MAC authentication and MAC addresses that have been assigned the blackhole MAC attribute from the RADIUS server. This field is not supported in the current software version. |
|
MAC address |
Silent MAC address. This field is not supported in the current software version. |
|
VLAN ID |
ID of the VLAN to which the silent MAC address belongs. This field is not supported in the current software version. |
|
From port |
Name of the port that marks the MAC address as a silent MAC address. This field is not supported in the current software version. |
|
Port index |
Index of the port that marks the MAC address as a silent MAC address. This field is not supported in the current software version. |
|
HundredGigE1/0/1 is link-up |
Status of the link on HundredGigE 1/0/1. In this example, the link is up. |
|
MAC authentication |
Status of MAC authentication on the port: · Enabled. · Disabled. |
|
Carry User-IP |
Whether user IP addresses are included in MAC authentication requests. |
|
Authentication domain |
MAC authentication domain specified for the port. |
|
Auth-delay timer |
Whether MAC authentication delay is enabled on the port. This field is not supported in the current software version. |
|
Auth-delay period |
MAC authentication delay timer. This field is not supported in the current software version. |
|
Periodic reauth |
Whether periodic MAC reauthentication is enabled on the port. This field is not supported in the current software version. |
|
Reauth period |
Periodic MAC reauthentication timer on the port. This field is not supported in the current software version. |
|
Re-auth server-unreachable |
Action taken when no server is reachable for MAC reauthentication: · Logoff—Logs off online MAC authentication users. · Online—Keeps MAC authenticated users online. This field is not supported in the current software version. |
|
Guest VLAN |
MAC authentication guest VLAN configured on the port. If no MAC authentication guest VLAN is configured, this field displays Not configured. This field is not supported in the current software version. |
|
Guest VLAN reauthentication |
Status of guest VLAN reauthentication in MAC authentication, which can be Enabled or Disabled. This field is not supported in the current software version. |
|
Guest VLAN auth-period |
Authentication interval for users in the guest VLAN for MAC authentication on the port. This field is not supported in the current software version. |
|
Critical VLAN |
MAC authentication critical VLAN configured on the port. If no MAC authentication critical VLAN is configured, this field displays Not configured. This field is not supported in the current software version. |
|
Critical voice VLAN |
Whether the MAC authentication critical voice VLAN feature is enabled on the port. This field is not supported in the current software version. |
|
Host mode |
· If multi-VLAN mode is disabled, this field displays Single VLAN. · If multi-VLAN mode is enabled, this field displays Multiple VLAN. This field is not supported in the current software version. |
|
Offline detection |
Status of MAC authentication offline detection: · Enabled. · Disabled. |
|
Authentication order |
If parallel MAC authentication and 802.1X authentication is disabled, this field displays Default. If parallel MAC authentication and 802.1X authentication is enabled, this field displays Parallel. This field is not supported in the current software version. |
|
User aging |
Status of the aging feature for unauthenticated MAC authentication users on a port: · Enabled. · Disabled. This field is not supported in the current software version. |
|
Server-recovery online-user-sync |
Status of online user synchronization for MAC authentication on the port: · Enabled. · Disabled. This field is not supported in the current software version. |
|
Auto-tag feature |
Status of the authorization VLAN auto-tag feature: · Enabled. · Disabled. This field is not supported in the current software version. |
|
VLAN tag configuration ignoring |
Status of the ignore-config mode: · Enabled. · Disabled. This field is not supported in the current software version. |
|
Max online users |
Maximum number of concurrent online users allowed on the port. |
|
Authentication attempts: successful 1, failed 0 |
MAC authentication statistics, including the number of successful and unsuccessful authentication attempts. |
|
MAC address |
MAC address of the online user. |
|
Auth state |
User status: · Authenticated—The user has passed MAC authentication. · Unauthenticated—The user has not passed MAC authentication. |
display mac-authentication connection
Use display mac-authentication connection to display information about online MAC authentication users.
Syntax
display mac-authentication connection [ open ] [ [ m-lag [ local | peer ] ] interface interface-type interface-number | [ m-lag [ local | peer ] ] slot slot-number | user-mac mac-address | [ m-lag [ local | peer ] ] user-name user-name ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
open: Displays information only about MAC authentication users that use nonexistent usernames or incorrect passwords for network access in open authentication mode. If you do not specify this keyword, the command displays information about all online MAC authentication users.
m-lag [ local | peer ]: Specifies online MAC authentication users on M-LAG interfaces. These keywords are applicatble to M-LAG environments. If you do not specify any types of M-LAG interfaces, this command displays online MAC authentication users on M-LAG and non-M-LAG interfaces. If you specify the m-lag keyword without the local or peer keyword, the command displays information about online MAC authentication users on both the local and peer M-LAG member devices.
· local: Displays information about online MAC authentication users on the local M-LAG member device.
· peer: Displays information about online MAC authentication users on the peer M-LAG member device.
interface interface-type interface-number: Specifies a port by its type and number. If you do not specify a port, this command displays information about online MAC authentication users for all ports.
slot slot-number: Specifies the slot number of the device, which is fixed at 1.
user-mac mac-address: Specifies an online MAC authentication user by its MAC address. The mac-address argument represents the MAC address of the user, in the form of H-H-H. If you do not specify an online MAC authentication user, this command displays all online MAC authentication user information.
user-name user-name: Specifies an online MAC authentication user by its username. The user name is a case-sensitive string of 1 to 55 characters, and it can include the domain name. If you do not specify an online MAC authentication user, this command displays all online MAC authentication user information.
Examples
# Display information about all online MAC authentication users.
<Sysname> display mac-authentication connection
Total connections: 1
Slot ID: 0
User MAC address: 0015-e9a6-7cfe
Access interface: HundredGigE1/0/1
Username: ias
User access state: Successful
Authentication domain: macusers
IPv4 address: 192.168.1.1
IPv6 address: 2000:0:0:0:1:2345:6789:abcd
Initial VLAN: 1
Authorization untagged VLAN: 100
Authorization tagged VLAN: N/A
Authorization microsegment ID: N/A
Authorization ACL number/name: 3001
Authorization CAR:
Average input rate: 102400 bps
Peak input rate: 204800 bps
Average output rate: 102400 bps
Peak output rate: 204800 bps
Authorization URL: N/A
Termination action: Radius-request
Session timeout period: 2 sec
Offline detection: 100 sec (server-assigned)
Online from: 2020/01/02 13:14:15
Online duration: 0h 2m 15s
User MAC address: 0015-e9a6-abcd
M-LAG NAS-IP type: Local
M-LAG user state: Active
Access interface: Bridge-Aggregation1
Username: luser
User access state: Successful
Authentication domain: macusers
IPv4 address: 192.168.1.1
IPv6 address: 2000:0:0:0:1:2345:6789:abcd
Initial VLAN: 1
Authorization untagged VLAN: 100
Authorization tagged VLAN: N/A
Authorization microsegment ID: N/A
Authorization ACL number/name: 3001
Authorization CAR:
Average input rate: 102400 bps
Peak input rate: 204800 bps
Average output rate: 102400 bps
Peak output rate: 204800 bps
Authorization URL: N/A
Termination action: Radius-request
Session timeout period: 2 sec
Offline detection: 100 sec (server-assigned)
Online from: 2020/12/02 13:14:15
Online duration: 0h 7m 15s
Table 2 Command output
|
Field |
Description |
|
Total connections |
Total number of online MAC authentication users. |
|
User MAC address |
MAC address of the user. |
|
M-LAG NAS-IP type |
NAS-IP address type for the user if the user is authenticated on a M-LAG interface of the M-LAG system. · Local—Local NAS-IP address. The source IP address of outgoing RADIUS packets is an IP address on the local M-LAG member device. · Peer—Peer NAS-IP address. The source IP address of outgoing RADIUS packets is an IP address on the peer M-LAG member device. |
|
M-LAG user state |
Local state of the user on the M-LAG interface: · Active—The local M-LAG member device exchanges user authentication information with the AAA server. · Inactive—The peer M-LAG member device exchanges user authentication information with the AAA server. |
|
Access interface |
Interface through which the user accesses the device. |
|
User access state |
Access state of the user: · Successful—The user passes MAC authentication and comes online. · Open—The user uses a nonexistent username or an incorrect password to come online in open authentication mode. |
|
Authentication domain |
MAC authentication domain to which the user belongs. |
|
IPv4 address |
IPv4 address of the user. If no user IPv4 address is available, this field is not displayed. |
|
IPv6 address |
IPv6 address of the user. If no user IPv6 address is available, this field is not displayed. |
|
Initial VLAN |
VLAN that holds the user before MAC authentication. |
|
Authorization untagged VLAN |
Untagged VLAN authorized to the user. |
|
Authorization tagged VLAN |
Tagged VLAN authorized to the user. |
|
Authorization microsegment ID |
This field is not supported in the current software version. Microsegment ID authorized to the user. |
|
Authorization ACL number/name |
Number or name of the ACL authorized to the user. If no authorization ACL has been assigned, this field displays N/A. If the ACL authorization fails, this field displays (Not effective) next to the ACL. |
|
Authorization CAR |
Authorization CAR attributes assigned by the server. · Average input rate—Average rate of inbound traffic in bps. · Peak input rate—Peak rate of inbound traffic in bps. · Average output rate—Average rate of outbound traffic in bps. · Peak output rate—Peak rate of outbound traffic in bps. If the device fails to assign the CAR attributes to the user, the Authorization CAR field displays (NOT effective). If the server does not assign the peak rates, the peak rates by default are the same as the assigned average rates. In the current software version, the device does not support exclusive assignment of peak rates from the server. If no authorization CAR attributes are assigned, this field displays N/A. |
|
Authorization URL |
Redirect URL authorized to the user. |
|
Authorization IPv6 URL |
Redirect IPv6 URL authorized to the user. |
|
Termination action |
Action attribute assigned by the server to terminate the user session: · Default—Logs off the online authenticated user when the server-assigned session timeout timer expires. This attribute does not take effect when periodic MAC reauthentication is enabled and the periodic reauthentication timer is shorter than the server-assigned session timeout timer. · Radius-request—Reauthenticates the online user when the server-assigned session timeout timer expires, regardless of whether the periodic MAC reauthentication feature is enabled or not. If the device performs local authentication, this field displays N/A. |
|
Session timeout period |
Session timeout timer assigned by the server. |
|
Offline detection |
Offline detection setting for the user: · Ignore (command-configured)—The device does not perform offline detection for the user. The setting is configured from the CLI. · timer (command-configured)—Represents the offline detect timer. The timer is configured from the CLI, · Ignore (server-assigned)—The device does not perform offline detection for the user. The setting is assigned by a RADIUS server. · timer (server-assigned)—Represents the offline detect timer. The timer is assigned by a RADIUS server. |
|
Online from |
Time from which the MAC authentication user came online. |
|
Online duration |
Online duration of the MAC authentication user. |
mac-authentication
Use mac-authentication to enable MAC authentication globally or on a port.
Use undo mac-authentication to disable MAC authentication globally or on a port.
Syntax
mac-authentication
undo mac-authentication
Default
MAC authentication is disabled globally or on any port.
Views
System view
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Usage guidelines
To use MAC authentication on a port, you must enable the feature both globally and on the port.
Examples
# Enable MAC authentication globally.
<Sysname> system-view
[Sysname] mac-authentication
# Enable MAC authentication on HundredGigE 1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] mac-authentication
Related commands
display mac-authentication
mac-authentication access-user log enable
Use mac-authentication access-user log enable to enable MAC authentication user logging.
Use undo mac-authentication access-user log enable to disable MAC authentication user logging.
Syntax
mac-authentication access-user log enable [ failed-login | logoff | successful-login ] *
undo mac-authentication access-user log enable [ failed-login | logoff | successful-login ] *
Default
MAC authentication user logging is disabled.
Views
System view
Predefined user roles
network-admin
Parameters
failed-login: Logs MAC authentication user login failures.
logoff: Logs MAC authentication user logoffs.
successful-login: Logs successful MAC authentication user logins.
Usage guidelines
To prevent excessive MAC authentication user log entries, use this feature only if you need to analyze abnormal MAC authentication user logins or logouts.
If you do not specify any parameters, this command enables all types of MAC authentication user logs.
Examples
# Enable logging MAC authentication user login failures.
<Sysname> system-view
[Sysname] mac-authentication access-user log enable failed-login
Related commands
info-center source maca logfile deny (System Management Command Reference)
mac-authentication authentication-method
Use mac-authentication authentication-method to specify an authentication method for MAC authentication.
Use undo mac-authentication authentication-method to restore the default.
Syntax
mac-authentication authentication-method { chap | pap }
undo mac-authentication authentication-method
Default
The device uses PAP for MAC authentication.
Views
System view
Predefined user roles
network-admin
Parameters
chap: Configures the access device to use the Challenge Handshake Authentication Protocol (CHAP) to communicate with the RADIUS server.
pap: Configures the access device to use the Password Authentication Protocol (PAP) to communicate with the RADIUS server.
Usage guidelines
RADIUS-based MAC authentication supports the following authentication methods:
· PAP—Transports usernames and passwords in plain text. The authentication method applies to scenarios that do not require high security.
· CHAP—Transports usernames in plain text and passwords in encrypted form over the network. CHAP is more secure than PAP.
Examples
# Configure the device to use CHAP for MAC authentication.
<Sysname> system-view
[Sysname] mac-authentication authentication-method chap
Related commands
mac-authentication carry user-ip
Use mac-authentication carry user-ip to include user IP addresses in MAC authentication requests sent to an IMC server.
Use undo mac-authentication carry user-ip to restore the default.
Syntax
mac-authentication carry user-ip [ exclude-ip acl acl-number ]
undo mac-authentication carry user-ip
Default
A MAC authentication request does not include the user IP address.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
exclude-ip: Specifies an ACL-based filter to identify source IP addresses that can or cannot trigger MAC authentication.
acl acl-number: Specifies a basic ACL. The value range for the acl-number argument is 2000 to 2999.
Usage guidelines
|
IMPORTANT: This command can only operate in conjunction with an IMC server. |
To avoid IP conflicts that result from changes to static IP addresses, use this command on a port that has MAC authentication users with static IP addresses.
This command adds user IP addresses to the MAC authentication requests sent to the authentication server. When MAC authentication is triggered for a user, the device checks the user's IP address for invalidity.
· If the IP address is valid, the device sends a MAC authentication request with the IP address included.
· If the IP address is not a valid host IP address or the triggering packet does not contain an IP address, the device does not initiate MAC authentication.
· If the packet is a DHCP packet with a source IP address of 0.0.0.0, the device sends a MAC authentication request without including the IP address. In this case, the IMC server does not examine the user IP address when it performs authentication.
Upon receipt of the authentication request that includes a user's IP address, the IMC server compares the user's IP and MAC addresses with its IP-MAC mappings.
· If an exact match is found or if no match is found, the user passes MAC authentication. In the latter case, the server creates an IP-MAC mapping for the user.
· If a mapping is found for the MAC address but the IP addresses do not match, the user fails the MAC authentication.
If the user host is configured with IPv6, the device might receive packets that contain an IPv6 link-local address, which starts with fe80. MAC authentication failure will occur if this address is used in MAC authentication. To avoid MAC authentication failure, configure a basic ACL to exclude the IPv6 IP addresses that start with fe80.
When you configure the ACL, follow these guidelines:
· Use permit rules to identify source IP addresses that are valid for MAC authentication. Use deny rules to identify source IP addresses that cannot trigger MAC authentication.
· In the rules, only the action keyword (permit or deny) and the source IP match criterion can take effect.
· As a best practice, configure a deny rule to exclude the IPv6 IP addresses that start with fe80 from triggering MAC authentication.
· If you configure permit rules, add a deny all rule at the bottom of the ACL.
Do not use this command in conjunction with the mac-authentication guest-vlan command on a port. The device cannot perform MAC authentication for a user once that user is added to the guest VLAN for MAC authentication.
Examples
# Include user IP addresses in MAC authentication requests on HundredGigE 1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] mac-authentication carry user-ip
# Include user IP addresses in MAC authentication requests on HundredGigE 1/0/1 and deny users that use IPv6 link-local addresses from performing MAC authentication on the port.
<Sysname> system-view
[Sysname] acl ipv6 basic 2000
[Sysname-acl-ipv6-basic-2000] rule deny source fe80:0::0:0 16
[Sysname-acl-ipv6-basic-2000] quit
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] mac-authentication carry user-ip exclude-ip acl 2000
Related commands
mac-authentication
mac-authentication domain
Use mac-authentication domain to specify a global or port-specific authentication domain.
Use undo mac-authentication domain to restore the default.
Syntax
mac-authentication domain domain-name
undo mac-authentication domain
Default
The system default authentication domain is used. For more information about the default authentication domain, see the domain default enable command in "AAA commands."
Views
System view
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
domain-name: Specifies the name of an ISP domain, a case-insensitive string of 1 to 255 characters.
Usage guidelines
The global authentication domain applies to all MAC authentication-enabled ports. An authentication domain specified in Layer 2 Ethernet interface view or Layer 2 aggregate interface view applies only to the port. You can specify different authentication domains on different ports.
A port chooses an authentication domain for MAC authentication users in the following order:
1. Authentication domain specified on the port.
2. Global authentication domain specified in system view.
3. Default authentication domain.
Examples
# Specify ISP domain domain1 as the global MAC authentication domain.
<Sysname> system-view
[Sysname] mac-authentication domain domain1
# Specify ISP domain aabbcc as the MAC authentication domain on HundredGigE 1/0/1.
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] mac-authentication domain aabbcc
Related commands
display mac-authentication
domain default enable
mac-authentication mac-range-account
Use mac-authentication mac-range-account to configure a username and password for MAC authentication users in a MAC address range.
Use undo mac-authentication mac-range-account to restore the default.
Syntax
mac-authentication mac-range-account mac-address mac-address mask { mask | mask-length } account name password { cipher | simple } string
undo mac-authentication mac-range-account { all | mac-address mac-address }
Default
No username or password is specifically configured for MAC authentication users in a MAC address range. The global user account policy applies to the users.
Views
System view
Predefined user roles
network-admin
Parameters
mac-address mac-address: Specifies a MAC address in the format of H-H-H.
mask mask: Specifies a MAC address mask, in the format of H-H-H. Make sure the most significant bits of the MAC address mask in binary format are consecutive 1s.
mask mask-length: Specifies a MAC address mask length, in the range of 1 to 48.
account name: Specifies a username. The name is a case-sensitive string of 1 to 55 characters, and cannot include the at sign (@).
password: Specifies the user password.
cipher: Specifies a password in encrypted form.
simple: Specifies a password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
string: Specifies the password. Its plaintext form is a case-sensitive string of 1 to 63 characters. Its encrypted form is a case-sensitive string of 1 to 117 characters.
all: Specifies all MAC address ranges.
Usage guidelines
Use this command to configure user account settings for users in a MAC address range (for example, users with a specific OUI). For users in the specified range, this command has higher priority than the mac-authentication user-name-format command.
You can configure a maximum of 16 MAC address ranges. However, you must make sure the MAC address ranges do not overlap.
If you configure user account settings multiple times for the same MAC address range, the most recent configuration overwrites the previous configuration.
The mac-authentication mac-range-account command applies only to unicast MAC addresses.
· If you specify a MAC address range that contains only multicast MAC addresses, execution of this command will fail.
· If you specify a MAC address range that contains both unicast and multicast MAC addresses, the command takes effect only on unicast MAC addresses.
The all-zero MAC address is invalid for MAC authentication. Users with the all-zero MAC address cannot pass MAC authentication.
Examples
# Configure a user account for MAC addresses that start with aaaa. Set the MAC address mask to ffff-0000-0000, the username to user1, and the password to 1234 in plaintext form.
<Sysname> system-view
[Sysname] mac-authentication mac-range-account mac-address aaaa-0000-0000 mask ffff-0000-0000 account user1 password simple 1234
Related commands
display mac-authentication
mac-authentication user-name-format
mac-authentication max-user
Use mac-authentication max-user to set the maximum number of concurrent MAC authentication users on a port.
Use undo mac-authentication max-user to restore the default.
Syntax
mac-authentication max-user max-number
undo mac-authentication max-user
Default
A port allows a maximum of 4294967295 concurrent MAC authentication users.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Parameters
max-number: Sets the maximum number of concurrent MAC authentication users on the port. The value range for this argument is 1 to 4294967295.
Usage guidelines
Set the maximum number of concurrent MAC authentication users on a port to prevent the system resources from being overused. When the maximum number is reached, the port denies subsequent MAC authentication users.
Examples
# Configure HundredGigE 1/0/1 to support a maximum of 32 concurrent MAC authentication users.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] mac-authentication max-user 32
Related commands
display mac-authentication
mac-authentication offline-detect enable
Use mac-authentication offline-detect enable to enable MAC authentication offline detection on a port.
Use undo mac-authentication offline-detect enable to disable MAC authentication offline detection.
Syntax
mac-authentication offline-detect enable
undo mac-authentication offline-detect enable
Default
MAC authentication offline detection is enabled on a port.
Views
Layer 2 Ethernet interface view
Layer 2 aggregate interface view
Predefined user roles
network-admin
Usage guidelines
The MAC authentication offline detection feature monitors the online status of MAC authentication users. This feature uses an offline detect timer to set the interval that the device must wait for traffic from a user before the device determines that the user is idle. If the device has not received traffic from a user before the timer expires, the device logs off that user and requests the accounting server to stop accounting for the user.
To set the offline detect timer, use the mac-authentication timer command.
Examples
# Disable MAC authentication offline detection on HundredGigE 1/0/1.
<Sysname> system-view
[Sysname] interface hundredgige 1/0/1
[Sysname-HundredGigE1/0/1] undo mac-authentication offline-detect enable
Related commands
mac-authentication timer
mac-authentication offline-detect mac-address
Use mac-authentication offline-detect mac-address to configure MAC authentication offline detection for a MAC authentication user.
Use undo mac-authentication offline-detect mac-address to restore the default.
Syntax
mac-authentication offline-detect mac-address mac-address { ignore | timer offline-detect-value [ check-arp-or-nd-snooping ] }
undo mac-authentication offline-detect mac-address mac-address
Default
The offline detection settings configured on access ports take effect and the offline detect timer set in system view is used.
Views
System view
Predefined user roles
network-admin
Parameters
mac-address: Specifies a MAC address in the format of H-H-H, excluding multicast, all-zero, and all-F MAC addresses.
ignore: Skips offline detection for the specified user.
timer offline-detect-value: Specifies the offline detect timer for the specified user. The value range is 60 to 2147483647 seconds.
check-arp-or-nd-snooping: Uses the ARP snooping or ND snooping table in offline detection to determine the offline state of the user.
Usage guidelines
Use this command to set offline detection parameters specific to a MAC authentication user. To have this command take effect, you must make sure MAC authentication offline detection is enabled on the user's access port. The user-specific offline detection settings take effect on the online users immediately after they are configured.
Use this command as follows:
· Set an offline detect timer specific to a user and control whether to use the ARP snooping or ND snooping table to determine the offline state of the user.
¡ If the ARP snooping or ND snooping table is used, the device searches the ARP snooping or ND snooping table before it checks for traffic from the user within the detection interval. If a matching ARP snooping or ND snooping entry is found, the device resets the offline detect timer and the user stays online. If the offline detect timer expires because the device has not found a matching snooping entry for the user or received traffic from the user, the device disconnects the user.
¡ If the ARP or ND snooping table is not used, the device disconnects the user if it has not received traffic from that user before the offline detect timer expires.
When disconnecting the user, the device also notifies the RADIUS server (if any) to stop user accounting.
· Skip offline detection for the user. You can choose this option if the user is a dumb terminal. A dumb terminal might fail to come online again after it is logged off by the offline detection feature.
The device uses the offline detection settings for a user in the following sequence:
1. User-specific offline detection settings.
2. Offline detection settings assigned to the user by the RADIUS server. The settings include the offline detect timer, use of the ARP or ND snooping table in offline detection, and whether to ignore offline detection.
3. Port-based offline detection settings.
Examples
# Disable MAC authentication offline detection for the MAC authentication user with MAC address 000a-eb29-7511.
<Sysname> system-view
[Sysname] mac-authentication offline-detect mac-address 000a-eb29-7511 ignore
# Enable MAC authentication offline detection for the MAC authentication user with MAC address 000a-eb29-7511, and set the offline detect timer to 24 hours.
<Sysname> system-view
[Sysname] mac-authentication offline-detect mac-address 000a-eb29-7511 timer 86400
Related commands
display mac-authentication connection
mac-authentication offline-detect enable
mac-authentication timer (system view)
mac-authentication timer (system view)
Use mac-authentication timer to configure a MAC authentication timer.
Use undo mac-authentication timer to restore the default of a MAC authentication timer.
Syntax
mac-authentication timer { offline-detect offline-detect-value | server-timeout server-timeout-value }
undo mac-authentication timer { offline-detect | server-timeout }
Default
The following MAC authentication timers apply:
· The offline detect timer is 300 seconds.
· The server timeout timer is 100 seconds.
Views
System view
Predefined user roles
network-admin
Parameters
offline-detect offline-detect-value: Sets the offline detect timer. The value range is 60 to 2147483647 seconds.
server-timeout server-timeout-value: Sets the server timeout timer. The value range is 100 to 300 seconds.
Usage guidelines
MAC authentication uses the following timers:
· Offline detect timer—Sets the interval that the device must wait for traffic from a user before the device determines that the user is idle. If the device has not received traffic from a user before the timer expires, the device logs off that user and requests the accounting server to stop accounting for the user. This timer takes effect only when the MAC authentication offline detection feature is enabled.
As a best practice, set the MAC address aging timer to the same value as the offline detect timer. This operation prevents a MAC authenticated user from being logged off within the offline detect interval because of MAC address entry expiration.
· Server timeout timer—Sets the interval that the device waits for a response from a RADIUS server before the device determines that the RADIUS server is unavailable. If the timer expires during MAC authentication, the user fails MAC authentication.
To avoid forced logoff before the server timeout timer expires, set the server timeout timer to a value that is lower than or equal to the product of the following values:
¡ The maximum number of RADIUS packet transmission attempts set by using the retry command in RADIUS scheme view.
¡ The RADIUS server response timeout timer set by using the timer response-timeout command in RADIUS scheme view.
For information about setting the maximum number of RADIUS packet transmission attempts and the RADIUS server response timeout timer, see AAA configuration in User Access and Authentication Configuration Guide.
Examples
# Set the server timeout timer to 150 seconds.
<Sysname> system-view
[Sysname] mac-authentication timer server-timeout 150
Related commands
display mac-authentication
retry
timer response-timeout (RADIUS scheme view)
mac-authentication user-name-format
Use mac-authentication user-name-format to configure the type of user accounts for MAC authentication users.
Use undo mac-authentication user-name-format to restore the default.
Syntax
mac-authentication user-name-format { fixed [ account name ] | mac-address [ { with-hyphen [ six-section | three-section ] | without-hyphen } [ lowercase | uppercase ] ] } [ password { cipher | simple } string ]
undo mac-authentication user-name-format
Default
The MAC address of each user is used as both the username and password for MAC authentication. The MAC addresses are in hexadecimal notation without hyphens, and letters are in lower case.
Views
System view
Predefined user roles
network-admin
Parameters
fixed: Uses a shared account for all MAC authentication users.
account name: Specifies the username for the shared account. The name is a case-sensitive string of 1 to 55 characters, excluding the at sign (@). If you do not specify a username, the default name mac applies.
mac-address: Uses MAC-based user accounts for MAC authentication users.
with-hyphen: Includes hyphens in a MAC address.
six-section: Specifies the six-section format. For example, xx-xx-xx-xx-xx-xx or XX-XX-XX-XX-XX-XX.
three-section: Specifies the three-section format. For example, xxxx-xxxx-xxxx or XXXX-XXXX-XXXX.
without-hyphen: Excludes hyphens from a MAC address, for example, xxxxxxxxxxxx.
lowercase: Specifies letters in lower case.
uppercase: Specifies letters in upper case.
password: Specifies the user password. If you do not specify a password for MAC-based user accounts, the device uses the MAC address of each user in the specified format as the password. If you do not specify a password for the shared account, the shared account does not have a password.
cipher: Specifies a password in encrypted form.
simple: Specifies a password in plaintext form. For security purposes, the password specified in plaintext form will be stored in encrypted form.
string: Specifies the password. Its plaintext form is a case-sensitive string of 1 to 63 characters. Its encrypted form is a case-sensitive string of 1 to 117 characters.
Usage guidelines
If you do not specify the six-section or three-section keyword, the MAC addresses in MAC-based user accounts are in six-section format.
If you specify the MAC-based user account format, the device uses the MAC address of a user as the username for MAC authentication of the user. This user account type ensures high authentication security. However, you must create on the authentication server a user account for each user, using the MAC address of the user as the username.
If you specify a shared user account, the device uses the specified username and password for MAC authentication of all users. Because all MAC authentication users use a single account for authentication, you only need to create one account on the authentication server. This user account type is suitable for trusted networks.
Examples
# Configure a shared account for MAC authentication users, and set the username to abc and password to plaintext string of xyz.
<Sysname> system-view
[Sysname] mac-authentication user-name-format fixed account abc password simple xyz
# Use the MAC address of each user as both the username and password for MAC authentication. The MAC addresses are in hexadecimal notation without hyphens, and letters are in upper case.
<Sysname> system-view
[Sysname] mac-authentication user-name-format mac-address without-hyphen uppercase
display mac-authentication
reset mac-authentication access-user
Use reset mac-authentication access-user to log off MAC authentication users.
Syntax
reset mac-authentication access-user [ interface interface-type interface-number | mac mac-address | username username | vlan vlan-id ]
Views
User view
Predefined user roles
network-admin
Parameters
interface interface-type interface-number: Specifies a port by its type and number.
mac mac-address: Specifies a MAC authentication user by its MAC address. The mac-address argument is in the format of H-H-H.
username username: Specifies a MAC authentication user by its name. The username argument is a case-sensitive string of 1 to 253 characters.
vlan vlan-id: Specifies a VLAN by its VLAN ID. The value range for the vlan-id argument is 1 to 4094.
Usage guidelines
Use this command to log off the specified MAC authentication users and clear information about these users from the device. These users must perform MAC authentication to come online again.
With a VLAN specified, this command logs off the following MAC authentication users:
· Users that have passed MAC authentication and have been assigned the specified VLAN as their authorization VLAN by the server.
· Users that stay in the specified VLAN after they have passed MAC authentication, because they have not been assigned an authorization VLAN yet.
· Users that are performing MAC authentication in the specified VLAN.
To identify the VLAN in which a user is staying, use the display mac-address command.
If you do not specify any parameters, the reset mac-authentication access-user command logs off all MAC authentication users on the device.
Examples
# Log off all MAC authentication users on HundredGigE 1/0/1.
<Sysname> reset mac-authentication access-user interface hundredgige 1/0/1
Related commands
display mac-authentication connection
reset mac-authentication statistics
Use reset mac-authentication statistics to clear MAC authentication statistics.
Syntax
reset mac-authentication statistics [ interface interface-type interface-number ]
Views
User view
Predefined user roles
network-admin
Parameters
interface interface-type interface-number: Specifies a port by its type and number. If you do not specify a port, this command clears both global and port-specific MAC authentication statistics.
Examples
# Clear MAC authentication statistics on HundredGigE 1/0/1.
<Sysname> reset mac-authentication statistics interface hundredgige 1/0/1
Related commands
display mac-authentication
