03-MAC地址認證命令
本章節下載: 03-MAC地址認證命令 (116.78 KB)
目 錄
1.1.1 display mac-authentication
1.1.3 mac-authentication domain
1.1.4 mac-authentication max-user
1.1.5 mac-authentication timer
1.1.6 mac-authentication user-name-format
1.1.7 reset mac-authentication statistics
【命令】
display mac-authentication [ interface interface-list ]
【視圖】
任意視圖
【缺省級別】
2:係統級
【參數】
interface interface-list:以太網端口列表,表示多個以太網端口,表示方式為interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>。其中,interface-type為端口類型,interface-number為端口號。&<1-10>表示前麵的參數最多可以輸入10次。起始端口類型必須和終止端口類型一致,並且終止端口號必須大於起始端口號。
【描述】
display mac-authentication命令用來顯示全局或指定端口的MAC地址認證信息。
【舉例】
# 顯示全局的MAC地址認證信息。
<Sysname> display mac-authentication
MAC address authentication is enabled.
User name format is MAC address in lowercase, like xxxxxxxxxxxx
Fixed username:mac
Fixed password:not configured
Offline detect period is 300s
Quiet period is 60s.
Server response timeout value is 100s
the max allowed user number is 2048 per slot
Current user number amounts to 0
Current domain: not configured, use default domain
Silent Mac User info:
MAC Addr From Port Port Index
GigabitEthernet2/0/1 is link-up
MAC address authentication is enabled
Authenticate success: 0, failed: 0
Max number of on-line users is 0
Current online user number is 0
MAC Addr Authenticate state Auth Index
……(略)
表1-1 display mac-authentication命令顯示信息描述表
|
域名 |
描述 |
|
MAC address authentication is enabled |
MAC地址認證特性已經開啟 |
|
User name format is MAC address in lowercase, like xxxxxxxxxxxx |
用戶名格式為不帶連字符的MAC地址,形如xxxxxxxxxxxx 若配置MAC地址形式的用戶名格式帶連字符,則顯示“like xx-xx-xx-xx-xx-xx”,其中字母為小寫 |
|
Fixed username: |
固定用戶名 |
|
Fixed password: |
固定用戶名的密碼 |
|
Offline detect period |
下線檢測定時器的時間間隔 |
|
Quiet period |
靜默定時器的時間間隔 |
|
Server response timeout value |
服務器連接超時定時器的值 |
|
The max allowed user number |
設備每板最大支持的MAC地址認證用戶數 |
|
Current user number amounts |
當前用戶數 |
|
Current domain: not configured, use default domain |
當前認證域沒有配置,使用缺省域 |
|
Silent Mac User info |
靜默用戶信息 |
|
GigabitEthernet2/0/1 is link-up |
端口GigabitEthernet2/0/1鏈路處於UP狀態 |
|
MAC address authentication is enabled |
端口GigabitEthernet2/0/1MAC地址認證特性已開啟 |
|
Authenticate success: 0, failed: 0 |
端口上MAC地址認證的統計信息,包括認證通過和認證失敗的數目 |
|
Max number of on-line users |
端口最多可容納的接入用戶數 如果端口沒有開啟MAC地址認證,則顯示0 |
|
Current online user number |
端口當前的接入用戶數 |
|
MAC Addr |
MAC地址 |
|
Authenticate state |
端口接入用戶的狀態,共有四種: l CONNECTING:正在連接 l SUCCESS:認證通過 l FAILURE:認證失敗 l LOGOFF:已下線 |
|
Auth Index |
認證體索引號 |
【命令】
在係統視圖下:
mac-authentication [ interface interface-list ]
undo mac-authentication [ interface interface-list ]
在以太網端口視圖下:
mac-authentication
undo mac-authentication
【視圖】
係統視圖/以太網端口視圖
【缺省級別】
2:係統級
【參數】
interface interface-list:以太網端口列表,表示多個以太網端口,表示方式為interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>。其中,interface-type為端口類型,interface-number為端口號。&<1-10>表示前麵的參數最多可以輸入10次。
【描述】
mac-authentication命令用來開啟指定端口上或全局的MAC地址認證特性。undo mac-authentication命令用來關閉指定端口上或全局的MAC地址認證特性。
缺省情況下,所有端口及全局的MAC地址認證特性都處於關閉狀態。
需要注意的是:
l 在係統視圖下使用該命令時,如果不輸入可選項interface interface-list,則表示開啟全局的MAC地址認證特性;如果指定了interface interface-list,則表示開啟指定端口的MAC地址認證特性。在以太網端口視圖下使用該命令時,不能指定參數interface-list,隻能開啟當前端口的MAC地址認證特性。
l MAC地址認證特性啟動前後,都可以使用命令來配置全局或端口的MAC地址認證特性參數。如果在開啟全局MAC地址認證特性前,沒有配置全局或端口的MAC地址認證特性參數,則這些參數在運行時均為缺省值。
l 各端口的MAC地址認證狀態在全局MAC地址認證沒有開啟之前可以配置,但不起作用;在全局MAC地址認證啟動後,各端口的MAC地址認證配置會立即生效。
【舉例】
# 開啟全局的MAC地址認證特性。
<Sysname> system-view
[Sysname] mac-authentication
Mac-auth is enabled globally.
# 開啟以太網端口GigabitEthernet2/0/1上的MAC地址認證特性。
<Sysname> system-view
[Sysname] mac-authentication interface gigabitethernet2/0/1
Mac-auth is enabled on port GigabitEthernet2/0/1.
或者
<Sysname> system-view
[Sysname] interface gigabitethernet2/0/1
[Sysname-GigabitEthernet2/0/] mac-authentication
Mac-auth is enabled on port GigabitEthernet2/0/1.
【命令】
mac-authentication domain isp-name
undo mac-authentication domain
【視圖】
係統視圖
【缺省級別】
2:係統級
【參數】
isp-name:ISP域名,為1~24個字符的字符串,不區分大小寫,且不能包括“/”、“:”、“*”、“?”、“<”、“>”以及“@”等特殊字符。
【描述】
mac-authentication domain命令用來配置MAC地址認證用戶所使用的ISP域。undo mac-authentication domain命令用來恢複缺省情況。
缺省情況下,MAC地址認證用戶使用缺省ISP域。關於缺省ISP域的介紹請參見“安全分冊/AAA命令”中的命令domain default enable。
【舉例】
# 配置MAC地址認證使用的域為domain1。
<Sysname> system-view
[Sysname] mac-authentication domain domain1
【命令】
mac-authentication max-user user-number
undo mac-authentication max-user
【視圖】
以太網端口視圖
【缺省級別】
2:係統級
【參數】
user-number:端口同時可容納接入用戶數量的最大值,取值範圍為1~1024。
【描述】
mac-authentication max-user命令用來配置端口同時可容納接入的MAC地址認證用戶數量的最大值。undo mac-authentication max-user命令用來恢複該值的缺省值。
缺省情況下,端口同時可容納接入用戶數量的最大值為1024。
【舉例】
# 設置端口GigabitEthernet2/0/1最多同時可容納32個MAC地址認證用戶接入。
<Sysname> system-view
[Sysname] interface gigabitethernet2/0/1
[Sysname-GigabitEthernet2/0/1] mac-authentication max-user 32
【命令】
mac-authentication timer { offline-detect offline-detect-value | quiet quiet-value | server-timeout server-timeout-value }
undo mac-authentication timer { offline-detect | quiet | server-timeout }
【視圖】
係統視圖
【缺省級別】
2:係統級
【參數】
offline-detect offline-detect-value:表示下線檢測定時器。其中,offline-detect-value表示下線檢測定時器的值,取值範圍60~65535,單位為秒。
quiet quiet-value:表示靜默定時器。其中quiet-value表示靜默定時器的值,取值範圍1~3600,單位為秒。
server-timeout server-timeout-value:表示服務器超時定時器。其中,server-timeout-value表示服務器超時定時器的值,取值範圍為100~300,單位為秒。
【描述】
mac-authentication timer命令用來配置MAC地址認證的各項定時器參數。undo mac-authentication timer命令用來將指定的定時器恢複為缺省情況。
缺省情況下,下線定時器的值為300秒,靜默定時器的值為60秒,服務器的超時定時器的值為100秒。
MAC地址認證過程受以下定時器的控製:
l 下線檢測定時器(offline-detect):用來設置用戶空閑超時的時間間隔。如果在兩個時間間隔之內,沒有來自用戶的流量通過,設備將切斷用戶的連接,同時通知RADIUS服務器,停止對該用戶的計費。
l 靜默定時器(quiet):用來設置用戶認證失敗以後,設備需要等待的時間間隔。在靜默期間,設備不處理該用戶的認證功能,靜默之後設備再重新對用戶發起認證。
l 服務器超時定時器(server-timeout):用來設置設備同RADIUS服務器的連接超時時間。在用戶的認證過程中,如果服務器超時定時器超時,設備將在相應的端口上禁止此用戶訪問網絡。
相關配置可參考命令display mac-authentication。
【舉例】
# 設置服務器超時定時器時長為150秒。
<Sysname> system-view
[Sysname] mac-authentication timer server-timeout 150
【命令】
mac-authentication user-name-format { fixed [ account name ] [ password { cipher | simple } password ] | mac-address [ { with-hyphen | without-hyphen } [ lowercase | uppercase ] ] }
undo mac-authentication user-name-format
【視圖】
係統視圖
【缺省級別】
2:係統級
【參數】
fixed:表示采用固定用戶名格式。
account name:指定用戶名。其中name為用戶名,為1~55個字符的字符串,不區分大小寫,缺省為mac。
password { cipher | simple } password:指定固定用戶名的密碼。其中,cipher表示密文顯示密碼,simple表示明文顯示密碼,password表示用戶密碼。無缺省值。
l 密文顯示的情況下,可輸入1~63個字符的明文字符串密碼,也可輸入長度為24或88個字符的密文字符串密碼;
l 明文顯示的情況下,隻能輸入1~63個字符的明文字符串。
mac-address:表示使用用戶的源MAC地址為用戶名。
with-hyphen:帶連字符“-”的MAC地址格式,例如xx-xx-xx-xx-xx-xx。
without-hyphen:不帶連字符“-”的MAC地址格式,例如xxxxxxxxxxxx。
lowercase:MAC地址中的字母為小寫。
uppercase:MAC地址中的字母為大寫。
【描述】
mac-authentication user-name-format命令用來配置MAC地址認證的用戶名和密碼。undo mac-authentication user-name-format命令用來恢複缺省情況。
缺省情況下,使用用戶的不帶連字符“-”的源MAC地址做用戶名和密碼,其中字母為小寫。
需要注意的是:
l 若指定用戶的源MAC地址為用戶名,則用戶密碼也為用戶的源MAC地址。
l 在cipher方式下,長度小於等於16的明文密碼會被加密為長度是24的密文,長度大於16且小於等於63的明文密碼會被加密為長度是88的密文。當用戶輸入長度為24的密碼時,如果密碼能夠被係統解密,則按密文密碼處理;若不能被解密,則按明文密碼處理。
相關配置可參考命令display mac-authentication。
【舉例】
# 配置MAC認證的用戶名為abc,密碼是明文顯示的xyz。
<Sysname> system-view
[Sysname] mac-authentication user-name-format fixed account abc password simple xyz
# 配置用戶的源MAC地址為用戶名,使用帶連字符“-”的MAC地址格式,其中字母大寫。
<Sysname> system-view
[Sysname] mac-authentication user-name-format mac-address with-hyphen uppercase
【命令】
reset mac-authentication statistics [ interface interface-list ]
【視圖】
用戶視圖
【缺省級別】
2:係統級
【參數】
interface interface-list:以太網端口列表,表示多個以太網端口,表示方式為interface-list = { interface-type interface-number [ to interface-type interface-number ] }&<1-10>。其中,interface-type為端口類型,interface-number為端口號。&<1-10>表示前麵的參數最多可以輸入10次。
【描述】
reset mac-authentication statistics命令用來清除MAC認證的統計信息。
需要注意的是:
l 如果不指定端口類型和端口號,則清除設備上的全局及所有端口的MAC認證統計信息;
l 如果指定端口類型和端口號,則清除指定端口上的MAC認證統計信息。
相關配置可參考命令display mac-authentication。
【舉例】
# 清除以太網端口GigabitEthernet2/0/1上的MAC認證統計信息。
<Sysname> reset mac-authentication statistics interface gigabitethernet2/0/1
不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!
