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

09-安全命令參考

目錄

03-MAC地址認證命令

本章節下載 03-MAC地址認證命令  (127.28 KB)

03-MAC地址認證命令


1 MAC地址認證

1.1  MAC地址認證配置命令

1.1.1  display mac-authentication

display mac-authentication命令用來顯示MAC地址認證的相關信息,主要包括全局及端口的配置信息、認證報文統計信息以及認證用戶信息。

【命令】

display mac-authentication [ interface interface-type interface-number ]

【視圖】

任意視圖

【缺省用戶角色】

network-admin

netword-operator

【參數】

interface interface-type interface-number:顯示全局及指定端口的MAC地址認證相關信息,interface-type interface-number為端口類型和端口編號。若指定的端口上未使能MAC地址認證,則不顯示該端口任何信息。

【使用指導】

如果不指定端口類型和端口編號,則顯示全局及所有使能了MAC地址認證的端口上的MAC地址認證信息。

【舉例】

# 顯示MAC地址認證信息。

<Sysname> display mac-authentication

 MAC 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

               Max number of users is 1024 per slot

               Current number of online users is 1

               Current authentication domain is domain1

 

 Silent MAC user info:

          MAC Addr         VLAN ID  From Port               Port Index

 

 Ten-GigabitEthernet1/0/1 is link-up

   MAC authentication is enabled

   Max number of online users is 256

   Current number of online users is 1

   Current authentication domain: Not configured

   Authentication attempts: successful 1, failed 0

          MAC Addr         Auth state

          00e0-fc12-3456   authenticated

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

字段

描述

MAC authentication is enabled

MAC地址認證的開啟狀態

User name format is MAC address in lowercase, like xxxxxxxxxxxx

本字段用於顯示MAC地址認證使用的用戶名格式,有以下兩種情況:

·     若采用MAC地址形式,則顯示具體的用戶名格式以及是否帶連字符、字母是否大小寫,例如本例中“User name format is MAC address in lowercase, like xxxxxxxxxxxx”,它表示用戶名格式為不帶連字符的MAC地址,其中字母為小寫

·     若采用固定用戶名格式,則顯示“User name format is fixed account”

Fixed username:

固定用戶名

·     采用MAC地址格式時,該值顯示為“mac”,無實際意義,僅表示采用MAC地址作為用戶名和密碼

·     采用固定用戶名格式時,該值為配置的用戶名(缺省為mac)

Fixed password:

固定用戶名的密碼

·     采用MAC地址格式時,該值顯示為“Not configured”

·     采用固定用戶名格式時,配置的值將顯示為******

Offline detect period

下線檢測定時器的值

Quiet period

靜默定時器的值

Server response timeout value

服務器連接超時定時器的值

Max number of users is 1024 per slot

每板能夠支持的最大MAC地址認證用戶數

Current number of online users is 1

當前用戶數

Current authentication domain is domain1

係統視圖下指定的MAC地址認證用戶使用的認證域

Silent MAC user info

靜默用戶信息

MAC Addr

靜默用戶的MAC地址

From Port

靜默用戶接入的端口

VLAN ID

靜默用戶所在的VLAN

Port Index

端口索引號

Ten-GigabitEthernet1/0/1 is link-up

端口Ten-GigabitEthernet1/0/1的鏈路狀態

MAC authentication is enabled

當前端口的MAC地址認證開啟狀態

Max number of online users is 256

本端口最多可容納的接入用戶數

Current number of online users is 1

端口上的當前接入用戶數

Current authentication domain

端口上指定的MAC地址認證用戶使用的認證域

Authentication attempts: successful 1, failed 0

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

MAC Addr

接入用戶的MAC地址

Auth state

接入用戶的狀態,包括以下兩種:

·     authenticated:認證成功

·     unauthenticated:認證失敗

 

1.1.2  mac-authentication

mac-authentication命令用來開啟指定端口上或全局的MAC地址認證。

undo mac-authentication命令用來關閉指定端口上或全局的MAC地址認證。

【命令】

mac-authentication

undo mac-authentication

【缺省情況】

所有端口及全局的MAC地址認證都處於關閉狀態。

【視圖】

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

【缺省用戶角色】

network-admin

【使用指導】

隻有全局和端口的MAC地址認證均開啟後,MAC地址認證配置才能在端口上生效。

【舉例】

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

<Sysname> system-view

[Sysname] mac-authentication

# 開啟端口Ten-GigabitEthernet1/0/1上的MAC地址認證。

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

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

【相關命令】

·     display mac-authentication

1.1.3  mac-authentication domain

mac-authentication domain命令用來指定MAC地址認證用戶使用的認證域。

undo mac-authentication domain命令用來恢複缺省情況。

【命令】

mac-authentication domain domain-name

undo mac-authentication domain

【缺省情況】

未指定MAC地址認證用戶使用的認證域,使用係統缺省的認證域。缺省認證域的介紹請參見“安全命令參考/AAA”中的命令domain default enable

【視圖】

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

【缺省用戶角色】

network-admin

【參數】

domain-name:ISP域名,為1~24個字符的字符串,不區分大小寫。

【使用指導】

不同視圖下指定的認證域的生效範圍不同:

·     係統視圖下指定的認證域對所有開啟了MAC地址認證的端口生效。

·     以太網接口視圖下指定的認證域僅對本端口有效。不同的端口可以指定不同的認證域。

端口上接入的MAC地址認證用戶將按照如下先後順序選擇認證域:端口上指定的認證域-->係統視圖下指定的認證域-->係統缺省的認證域。

【舉例】

# 在係統視圖下指定MAC地址認證用戶使用的認證域為domain1。

<Sysname> system-view

[Sysname] mac-authentication domain domain1

# 指定端口Ten-GigabitEthernet1/0/1上接入的MAC地址認證用戶使用的認證域為aabbcc。

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] mac-authentication domain aabbcc

【相關命令】

·     display mac-authentication

·     domain default enable(安全命令參考/AAA)

1.1.4  mac-authentication max-user

mac-authentication max-user命令用來配置端口上最多允許同時接入的MAC地址認證用戶數。當接入此端口的MAC地址認證用戶數超過最大值後,新接入的用戶將被拒絕。

undo mac-authentication max-user命令用來恢複缺省情況。

【命令】

mac-authentication max-user user-number

undo mac-authentication max-user

【缺省情況】

端口上最多允許同時接入的MAC地址認證用戶數為256。

【視圖】

以太網接口視圖

【缺省用戶角色】

network-admin

【參數】

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

【舉例】

# 配置端口Ten-GigabitEthernet1/0/1最多允許同時接入32個MAC地址認證用戶。

<Sysname> system-view

[Sysname] interface ten-gigabitethernet 1/0/1

[Sysname-Ten-GigabitEthernet1/0/1] mac-authentication max-user 32

【相關命令】

·     display mac-authentication

1.1.5  mac-authentication timer

mac-authentication timer命令用來配置MAC地址認證的定時器參數。

undo 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 }

【缺省情況】

下線檢測定時器的值為300秒,靜默定時器的值為60秒,服務器超時定時器的值為100秒。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

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地址認證過程受以下定時器的控製:

·     下線檢測定時器(offline-detect):用來設置在線用戶空閑超時的時間間隔。若設備在一個下線檢測定時器間隔之內,沒有收到某在線用戶的報文,將切斷該用戶的連接,同時通知RADIUS服務器停止對其計費。

·     靜默定時器(quiet):用來設置用戶認證失敗以後,設備需要等待的時間間隔。在靜默期間,設備不對來自認證失敗用戶的報文進行認證處理,直接丟棄。靜默期後,如果設備再次收到該用戶的報文,則依然可以對其進行認證處理。

·     服務器超時定時器(server-timeout):用來設置設備同RADIUS服務器的連接超時時間。在用戶的認證過程中,如果到服務器超時定時器超時時設備一直沒有收到RADIUS服務器的應答,則設備將在相應的端口上禁止此用戶訪問網絡。

【舉例】

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

<Sysname> system-view

[Sysname] mac-authentication timer server-timeout 150

【相關命令】

·     display mac-authentication

1.1.6  mac-authentication user-name-format

mac-authentication user-name-format命令用來配置MAC地址認證的用戶名格式。

undo mac-authentication user-name-format命令用來恢複缺省情況。

【命令】

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

【缺省情況】

使用用戶的MAC地址作為用戶名和密碼,其中字母為小寫,不帶連字符“-”。

【視圖】

係統視圖

【缺省用戶角色】

network-admin

【參數】

fixed:表示采用固定用戶名格式。

account name:指定發送給RADIUS服務器進行認證或者在本地進行認證的用戶名。其中name為用戶名,為1~55個字符的字符串,不區分大小寫,不能包括字符@,缺省為mac。

password:指定固定用戶名的密碼。

cipher:表示以密文方式設置密碼。

simple:表示以明文方式設置密碼。

password:設置的明文密碼或密文密碼,區分大小寫。明文密碼為1~63個字符的字符串;密文密碼為1~117個字符的字符串。

mac-address:表示使用用戶的MAC地址作為用戶名和密碼。

with-hyphen:帶連字符“-”的MAC地址格式,例如xx-xx-xx-xx-xx-xx。

without-hyphen:不帶連字符“-”的MAC地址格式,例如xxxxxxxxxxxx。

lowercase:MAC地址中的字母為小寫。

uppercase:MAC地址中的字母為大寫。

【使用指導】

若指定用戶的MAC地址為用戶名,則用戶密碼也為用戶的MAC地址。這種情況下,每一個MAC地址認證用戶都使用唯一的用戶名進行認證,安全性高,但要求認證服務器端配置多個MAC形式的用戶帳戶。

若指定一個固定的用戶名,則表示不論用戶的MAC地址為何值,所有用戶均使用設備上指定的一個固定用戶名和密碼作為身份信息進行認證。由於同一個端口下可以有多個用戶進行認證,因此這種情況下端口上的所有MAC地址認證用戶均使用同一個固定用戶名進行認證,服務器端僅需要配置一個用戶帳戶即可滿足所有認證用戶的認證需求,適用於接入客戶端比較可信的網絡環境。

以明文或密文方式設置的密碼,均以密文的方式保存在配置文件中。

【舉例】

# 配置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

【相關命令】

·     display mac-authentication

1.1.7  reset mac-authentication statistics

reset mac-authentication statistics命令用來清除MAC地址認證的統計信息。

【命令】

reset mac-authentication statistics [ interface interface-type interface-number ]

【視圖】

用戶視圖

【缺省用戶角色】

network-admin

【參數】

interface interface-type interface-number:清除指定端口的MAC地址認證統計信息,interface-type interface-number為端口類型和端口編號。

【使用指導】

如果不指定端口類型和端口編號,則清除設備上的全局及所有端口的MAC認證統計信息。

【舉例】

# 清除以太網接口Ten-GigabitEthernet1/0/1上的MAC認證統計信息。

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

【相關命令】

·     display mac-authentication

 

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

BOB登陆
官網
聯係我們