• 產品與解決方案
  • 行業解決方案
  • 服務
  • 支持
  • 合作夥伴
  • 關於我們

H3C S5100-SI[EI]係列以太網交換機 命令手冊-Release 220X係列(V1.05)

16-MAC地址認證命令

本章節下載  (162.21 KB)

16-MAC地址認證命令


1 MAC地址認證配置命令

1.1  MAC地址認證基本功能配置命令

1.1.1  display mac-authentication

【命令】

display mac-authentication [ interface interface-list ]

【視圖】

任意視圖

【參數】

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.

 Authentication mode is UsernameAsMacAddress

 Usernameformat:with-hyphen lowercase

 Fixed password:not configured

         Offline detect period is 300s

         Quiet period is 60 second(s).

         Server response timeout value  is 100s

         Guest VLAN re-authenticate period is 30s 

         Max allowed user number is 1024

         Current user number amounts to  1

         Current domain: not configured, use default domain

Silent Mac User info:

          MAC ADDR             From Port               Port Index

          --- On unit 1, 1 silent mac address(es) found. ---

          0016-e0be-e201       GigabitEthernet1/0/2              1(vlan:1)

          --- 1 silent mac address(es) found. ---          

GigabitEthernet1/0/1 is link-up

  MAC address authentication  is Enabled

  max-auth-num is 256

  Guest VLAN is 2

  Authenticate success: 1, failed: 0

  Current online user number is 1

    MAC ADDR         Authenticate state           AuthIndex

    000d-88f8-4e71   MAC_AUTHENTICATOR_SUCCESS     0

……(以下略)

表1-1 display mac-authentication命令顯示信息描述表

字段

描述

Mac address authentication is Enabled

MAC地址認證特性已經開啟

Authentication mode

MAC地址認證用戶名的形式,有兩種形式:

UsernameFixed:采用固定用戶名

UsernameAsMacAddress:采用MAC地址用戶名

缺省為采用MAC地址用戶名(UsernameAsMacAddress)

Fixed password

根據MAC地址認證用戶名形式不同含義有所不同:

采用MAC地址用戶名時,此項配置表示是否采用固定密碼,缺省未配置,即不采用固定密碼,仍采用用戶的MAC地址作為密碼。

采用固定用戶名時,此項配置表示是否配置了固定密碼。缺省為未配置,即密碼為空。

Offline detect period

下線檢測定時器,用來設置檢測用戶是否下線的時間間隔,缺省值為300秒

Quiet period

靜默定時器,設置對用戶認證失敗以後,交換機的靜默時間,缺省為60秒

Server response timeout value

服務器連接超時定時器,用於設置與RADIUS服務器連接超時時間,缺省為100秒

Guest VLAN re-authenticate period

交換機對Guest VLAN內的用戶進行重認證的時間間隔,缺省為30秒

Max allowed user number

交換機支持的最大用戶數,缺省為1024個

Current user number amounts to

當前用戶數

Current domain

當前使用的域,缺省未配置

Silent Mac User info

靜默用戶信息。當用戶因為輸入錯誤的用戶名/密碼而未通過MAC地址認證時,交換機將該用戶設置為靜默,靜默期間交換機不處理該用戶的認證請求

GigabitEthernet1/0/1 is link-up

端口GigabitEthernet1/0/1鏈路處於UP狀態

MAC address authentication is Enabled

端口GigabitEthernet1/0/1MAC地址認證特性已開啟

max-auth-num

端口允許接入的MAC地址認證用戶的最大數量,缺省為256

Guest VLAN

端口的Guest VLAN

Authenticate success: 1, failed: 0

端口上MAC地址認證的統計信息,包括認證通過和認證失敗的數目

Current online user number

端口當前的接入用戶數

MAC ADDR

端口所連接的遠程MAC地址

Authenticate state

端口接入用戶的狀態,共有四種:

l      MAC_AUTHENTICATOR_CONNECTING:正在連接

l      MAC_AUTHENTICATOR_SUCCESS:認證通過

l      MAC_AUTHENTICATOR_FAILURE:認證失敗

l      MAC_AUTHENTICATOR_LOGOFF:已下線

AuthIndex

當前MAC地址在認證端口下的索引值

 

1.1.2  mac-authentication

【命令】

mac-authentication

undo mac-authentication

【視圖】

係統視圖/以太網端口視圖

【參數】

【描述】

mac-authentication命令用來開啟全局或當前端口的MAC地址認證特性。undo mac-authentication命令用來關閉全局或當前端口的MAC地址認證特性。

缺省情況下,全局及所有端口的MAC地址認證特性都處於關閉狀態。

在係統視圖下使用該命令時,表示開啟全局的MAC地址認證特性。在以太網端口視圖下使用該命令時,表示開啟當前視圖所在端口的MAC地址認證特性。

為了啟動MAC地址認證,全局和相應端口都需要開啟MAC地址認證特性。

各端口的MAC地址認證狀態在全局開啟之前可以配置,但不會生效;在全局MAC地址認證開啟後,已使能MAC地址認證的端口將立即開始進行認證操作。

 

【舉例】

# 開啟全局的MAC地址認證特性。

<Sysname> system-view

System View: return to User View with Ctrl+Z.  

[Sysname] mac-authentication

 MAC-Authentication is enabled globally.

# 開啟端口GigabitEthernet1/0/1的MAC地址認證特性。

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] mac-authentication

1.1.3  mac-authentication interface

【命令】

mac-authentication interface interface-list

undo mac-authentication interface interface-list

【視圖】

係統視圖

【參數】

interface-list:開啟MAC地址認證的以太網端口列表,表示方式為interface-list={ interface-type interface-number [ to interface-type interface-number ] } &<1-10>。其中interface-type為端口類型,interface-number為端口號。命令中&<1-10>表示前麵的參數最多可以重複輸入10次。

【描述】

mac-authentication interface命令用來開啟指定端口上的MAC地址認證特性。undo mac-authentication interface命令用來關閉指定端口上的MAC地址認證特性。

缺省情況下,所有端口的MAC地址認證特性都處於關閉狀態。

l    全局MAC地址認證特性開啟後,必須再開啟端口的MAC地址認證特性,MAC地址認證的配置才能在端口上生效;

l    如果端口開啟了MAC地址認證特性,則不能配置該端口的最大MAC地址學習個數(通過命令mac-address max-mac-count配置);反之,如果端口配置了最大MAC地址學習個數,則禁止在該端口上開啟MAC地址認證特性。

l    如果端口啟動了MAC地址認證,則不能配置該端口加入彙聚組。反之,如果該端口已經加入到某個彙聚組中,則禁止在該端口上啟動MAC地址認證。

 

【舉例】

# 開啟以太網端口GigabitEthernet 1/0/1上的MAC地址認證特性。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication interface GigabitEthernet 1/0/1

1.1.4  mac-authentication authmode usernameasmacaddress

【命令】

mac-authentication authmode usernameasmacaddress [ usernameformat { with-hyphen | without-hyphen } { lowercase | uppercase } | fixedpassword password ]

undo mac-authentication authmode usernameasmacaddress [ usernameformat  | fixedpassword ]

【視圖】

係統視圖

【參數】

usernameformat:設置用戶名和密碼的輸入格式。

with-hyphen:係統采用帶有分隔符“-”的MAC地址作為MAC地址認證的用戶名和密碼,例如“00-05-e0-1c-02-e3”。

without-hyphen:係統采用不帶有分隔符“-”的MAC地址作為MAC地址認證的用戶名和密碼,例如“0005e01c02e3”。

lowercase:MAC地址格式為小寫格式。

uppercase:MAC地址格式為大寫格式。

fixedpassword password配置MAC地址認證采用固定密碼password,不再采用MAC地址作為密碼,password為長度 1~63個字符的字符串。

【描述】

mac-authentication authmode usernameasmacaddress命令用來設置MAC地址認證時采用MAC地址用戶名形式,並配置具體用戶名格式。undo mac-authentication authmode命令用來恢複MAC地址認證時采用的用戶名形式為缺省情況。

缺省情況下,MAC地址認證時采用的用戶名、密碼為MAC地址形式。

【舉例】

# 設置MAC地址認證時采用的用戶名形式為MAC地址用戶名,使用帶有分隔符的小寫格式輸入MAC地址作為用戶名和密碼。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication authmode usernameasmacaddress usernameformat with-hyphen lowercase

1.1.5  mac-authentication authmode usernamefixed

【命令】

mac-authentication authmode usernamefixed

undo mac-authentication authmode

【視圖】

係統視圖

【參數】

【描述】

mac-authentication authmode usernamefixed命令用來設置MAC地址認證時采用固定用戶名形式。undo mac-authentication authmode命令用來恢複MAC地址認證時采用的用戶名形式為缺省情況。

缺省情況下,係統采用MAC地址用戶名進行認證。

【舉例】

# 設置MAC地址認證時采用固定用戶名形式。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication authmode usernamefixed

1.1.6  mac-authentication authpassword

【命令】

mac-authentication authpassword password

undo mac-authentication authpassword

【視圖】

係統視圖

【參數】

password:表示認證時使用的密碼,長度為1~63個字符的字符串。

【描述】

mac-authentication authpassword命令用來設置MAC地址認證采用固定用戶名形式時的密碼。undo mac-authentication authpassword命令用來取消設置的密碼。

缺省情況下,未配置固定用戶名的密碼。

【舉例】

# 設置固定用戶名方式的密碼為newmac。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication authpassword newmac

1.1.7  mac-authentication authusername

【命令】

mac-authentication authusername username

undo mac-authentication authusername

【視圖】

係統視圖

【參數】

username:表示認證時使用的用戶名,為長度不超過55個字符的字符串。

【描述】

mac-authentication authusername命令用來設置采用固定用戶名形式時的用戶名。undo mac-authentication authusername命令用來將用戶名恢複為係統缺省情況。

缺省情況下,固定用戶名形式時的用戶名為mac。

【舉例】

# 設置固定用戶名形式認證的用戶名為vipuser。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication authusername vipuser

1.1.8  mac-authentication domain

【命令】

mac-authentication domain isp-name

undo mac-authentication domain

【視圖】

係統視圖

【參數】

isp-name:ISP域名。為不超過128個字符的非空字符串,且不能包括“/”、“:”、“*”、“?”、“<”以及“>”等特殊字符。

【描述】

mac-authentication domain命令用來配置MAC地址認證用戶所使用的ISP域。undo mac-authentication domain命令用來恢複MAC地址認證用戶所使用的ISP域為缺省情況。

缺省情況下,使用缺省ISP域system。

【舉例】

# 配置MAC地址使用的域為aabbcc。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication domain aabbcc

1.1.9  mac-authentication timer

【命令】

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 }

【視圖】

係統視圖

【參數】

offline-detect-value:下線檢測定時器的值,用來設置交換機檢查用戶是否已經下線的時間間隔。取值範圍1~65535,單位為秒。缺省值為300秒。

quiet-value:靜默定時器的值。對用戶認證失敗以後,交換機需要靜默一段時間後再處理用戶認證請求,在靜默期間,交換機不處理該用戶的認證請求。取值範圍1~3600,單位為秒。缺省值為60秒。

server-timeout-value:服務器超時定時器的值。在用戶的認證過程中,如果交換機同RADIUS 服務器的連接超時,則此次認證失敗。取值範圍為1~65535,單位為秒。缺省值為100秒。

【描述】

mac-authentication timer命令用來配置MAC地址認證的各項定時器參數。undo mac-authentication timer命令用來將指定的定時器恢複為缺省值。

相關可參考命令display mac-authentication

【舉例】

# 設置服務器超時定時器時長為150秒。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication timer server-timeout 150

1.1.10  reset mac-authentication

【命令】

reset mac-authentication statistics [ interface interface-list]

【視圖】

用戶視圖

【參數】

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命令用來清除MAC地址認證的統計信息。當指定interface參數時,表示清除指定端口上的MAC地址認證統計信息;不指定interface參數時,表示清除全局MAC地址認證統計信息。

【舉例】

# 清除端口GigabitEthernet 1/0/1上的MAC地址認證統計信息。

<Sysname> reset mac-authentication statistics interface GigabitEthernet 1/0/1

1.2  MAC地址認證增強功能配置命令

1.2.1  mac-authentication guest-vlan

【命令】

mac-authentication guest-vlan vlan-id

undo mac-authentication guest-vlan

【視圖】

以太網端口視圖

【參數】

vlan-id:為當前端口配置的Guest VLAN的VLAN ID,取值範圍為1~4094。

【描述】

mac-authentication guest-vlan命令用來配置當前端口的Guest VLAN,如果端口連接的客戶端認證失敗,該端口將被加入Guest VLAN,此時接入用戶可以訪問Guest VLAN中的網絡資源。undo mac-authentication guest-vlan命令用來取消端口的Guest VLAN配置。

缺省情況下,沒有配置端口的Guest VLAN。

係統每隔mac-authentication timer guest-vlan-reauth設置的時間間隔後,會對Guest VLAN內用戶進行重認證,如果認證成功,則離開Guest VLAN,回到原VLAN。

l    當端口連接的客戶端數量大於1時,將不能配置該端口的Guest VLAN。當端口配置了Guest VLAN後,該端口也將隻允許一個MAC地址認證用戶接入,即使配置的MAC地址認證用戶的最大數目限製大於1,也將不會生效。

l    被配置為Guest VLAN的VLAN不能使用undo vlan命令直接刪除,必須先刪除Guest VLAN配置,才能夠刪除。undo vlan命令請參見本手冊“VLAN”部分的介紹。

l    一個端口隻能配置一個Guest VLAN,對應的VLAN必須已經存在,否則將會配置失敗。如果需要修改當前端口的Guest VLAN,需要先刪除之前的Guest VLAN配置,再重新進行配置。

l    在配置了端口的Guest VLAN後,將不能在此端口開啟802.1x認證功能。

l    MAC地址認證的Guest VLAN功能在端口安全開啟的情況下不生效。

 

相關配置可參考命令mac-authentication timer guest-vlan-reauth

【舉例】

# 配置以太網端口GigabitEthernet1/0/1的Guest VLAN為VLAN4。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] interface GigabitEthernet 1/0/1

[Sysname-GigabitEthernet1/0/1] mac-authentication guest-vlan 4

1.2.2  mac-authentication max-auth-num

【命令】

mac-authentication max-auth-num user-number

undo mac-authentication max-auth-num

【視圖】

以太網端口視圖

【參數】

user-number:端口允許接入的MAC地址認證用戶的最大數量,取值範圍為1~256。

【描述】

mac-authentication max-auth-num命令用來配置當前端口可以接入的MAC地址認證用戶的最大數量,當接入用戶到達配置的限製數量時,交換機將不會再對之後接入的用戶進行認證觸發動作,這些用戶也就無法正常訪問網絡。undo mac-authentication max-auth-num用來恢複該配置的缺省值。

缺省情況下,端口允許接入的MAC地址認證用戶的最大數量為256個。

l    當端口下同時配置了MAC地址認證用戶數量限製和端口安全的用戶數量限製時,允許接入的MAC地址認證用戶數將為這兩種配置中的較小值。端口安全功能的介紹請參見本手冊“端口安全”部分。

l    當端口當前有用戶在線時,不能配置此端口的MAC地址認證用戶的最大數量。

 

【舉例】

# 配置以太網端口GigabitEthernet1/0/2最多允許100個MAC地址認證用戶接入。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] interface GigabitEthernet 1/0/2

[Sysname-GigabitEthernet1/0/2] mac-authentication max-auth-num 100

1.2.3  mac-authentication timer guest-vlan-reauth

【命令】

mac-authentication timer guest-vlan-reauth interval

undo mac-authentication timer guest-vlan-reauth

【視圖】

係統視圖

【參數】

interval:配置交換機對Guest VLAN內的用戶進行重認證的時間間隔,取值範圍為1~3600,單位為秒。

【描述】

mac-authentication timer guest-vlan-reauth命令用來配置交換機對Guest VLAN內的用戶進行重認證的時間間隔,如果認證成功用戶離開Guest VLAN,回到原VLAN。undo mac-authentication timer guest-vlan-reauth用來恢複重認證時間間隔為缺省值。

缺省情況下,交換機對Guest VLAN內用戶進行重認證的時間間隔為30秒。

【舉例】

# 配置交換機每隔60秒對Guest VLAN內的用戶進行重認證。

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname] mac-authentication timer guest-vlan-reauth 60

 

不同款型規格的資料略有差異, 詳細信息請向具體銷售和400谘詢。H3C保留在沒有任何通知或提示的情況下對資料內容進行修改的權利!

BOB登陆
官網
聯係我們