• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

07-安全分册

03-MAC地址认证配置

本章节下载 03-MAC地址认证配置  (218.94 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S7600/H3C_S7600/Configure/Operation_Manual/S7600_OM-Release_6600_(V1.00)/07/200910/653121_30005_0.htm

03-MAC地址认证配置


1 MAC地址认证配置

1.1  MAC地址认证简介

MAC地址认证是一种基于端口和MAC地址对用户的网络访问权限进行控制的认证方法,它不需要用户安装任何客户端软件。设备在首次检测到用户的MAC地址以后,即启动对该用户的认证操作。认证过程中,也不需要用户手动输入用户名或者密码。

目前设备支持两种方式的MAC地址认证:

l              通过RADIUS(Remote Authentication Dial-In User Service,远程认证拨号用户服务)服务器认证。

l              本地认证。

有关远程RADIUS认证和本地认证的详细介绍请参见“安全分册”中的“AAA配置”。

认证方式确定后,可根据需求选择MAC认证用户名的类型,包括以下两种方式:

l              MAC地址用户名:使用用户的MAC地址作为认证时的用户名和密码;

l              固定用户名:不论用户的MAC地址为何值,所有用户均使用在设备上预先配置的用户名和密码进行认证。同一个端口下可以有多个用户进行认证,且均使用同一个固定用户名通过认证。

1.1.1  RADIUS服务器认证方式进行MAC地址认证

当选用RADIUS服务器认证方式进行MAC地址认证时,设备作为RADIUS客户端,与RADIUS服务器配合完成MAC地址认证操作:

l              采用MAC地址用户名时,设备将检测到的用户MAC地址作为用户名和密码发送给RADIUS服务器。

l              采用固定用户名时,设备将已经在本地配置的用户名和密码作为待认证用户的用户名和密码,发送给RADIUS服务器。

RADIUS服务器完成对该用户的认证后,认证通过的用户可以访问网络。

1.1.2  本地认证方式进行MAC地址认证

当选用本地认证方式进行MAC地址认证时,直接在设备上完成对用户的认证。需要在设备上配置本地用户名和密码:

l              采用MAC地址用户名时,需要配置的本地用户名为各接入用户的MAC地址。

l              采用固定用户名时,需要配置的本地用户名为自定义的,所有用户对应的用户名和密码与自定义的一致。

1.2  相关概念

1.2.1  MAC地址认证定时器

MAC地址认证过程受以下定时器的控制:

l              下线检测定时器(offline-detect):用来设置设备用户空闲超时的时间间隔。如果在两个时间间隔之内,没有来自用户的流量通过,设备将切断用户的连接,同时通知RADIUS服务器,停止对该用户的计费。

l              静默定时器(quiet):用来设置用户认证失败以后,设备需要等待的时间间隔。在静默期间,设备不处理该用户的认证功能,静默之后设备再重新对用户发起认证。

l              服务器超时定时器(server-timeout):用来设置设备同RADIUS服务器的连接超时时间。在用户的认证过程中,如果服务器超时定时器超时,设备将在相应的端口上禁止此用户访问网络。

1.2.2  静默MAC

当一个MAC地址认证失败后,此MAC就被添加为静默MAC,在静默时间内,来自此MAC地址的数据报文到达时,设备直接做丢弃处理。静默MAC的功能主要是防止非法MAC短时间内的重复认证。

若配置的静态MAC或者当前认证通过的MAC地址与静默MAC相同,则此MAC地址的静默功能失效。

 

1.2.3  下发VLAN

为了将受限的网络资源与用户隔离,通常将受限的网络资源和用户划分到不同的VLAN。当用户通过身份认证后,受限的网络资源所在的VLAN会作为授权VLAN从授权服务器上下发。同时用户所在的端口被加入到此授权VLAN中,用户可以访问这些受限的网络资源。

1.2.4  下发ACL

从授权服务器下发的ACL被称为授权ACL,它为用户访问网络提供了良好的过滤条件设置功能。当用户上线时,如果RADIUS服务器上配置了授权ACL,则设备会根据服务器下发的授权ACL对用户所在端口的数据流进行控制。而且在用户访问网络的过程中,可以通过改变服务器的授权ACL设置来改变用户的访问权限。

1.3  配置MAC地址认证

通过使用MAC地址认证,可以对用户的网络访问权限进行控制。

1.3.1  配置准备

l              创建并配置ISP域。

l              若采用本地认证方式,需建立本地用户并设置其密码。

l              若采用远程RADIUS认证方式,需要确保设备与RADIUS服务器之间的路由可达,并添加用户名及密码。

本地或远程服务器上配置用户名和密码时,需要注意以下事项:

l    用户名和密码的类型必须与设备上配置的MAC地址认证的用户名和密码类型保持一致。

l    本地用户的服务类型应设置为lan-access

 

1.3.2  配置过程

表1-1 MAC地址认证配置过程

操作

命令

说明

进入系统视图

system-view

-

启动全局的MAC地址认证

mac-authentication

必选

缺省情况下,全局的MAC地址认证为关闭状态

启动端口的MAC地址认证

mac-authentication interface interface-list

必选

缺省情况下,端口的MAC地址认证为关闭状态

或者在以太网端口视图下

interface interface-type interface-number

mac-authentication

quit

配置MAC地址认证用户所使用的ISP域

mac-authentication domain isp-name

可选

缺省情况下,MAC地址认证用户使用缺省ISP域

配置下线检测定时器

mac-authentication timer offline-detect offline-detect-value

可选

缺省情况下,下线检测定时器为300秒

配置静默定时器

mac-authentication timer quiet quiet-value

可选

缺省情况下,静默定时器为60秒

配置服务器超时定时器

mac-authentication timer server-timeout server-timeout-value

可选

缺省情况下,服务器超时定时器取值为100秒

配置MAC地址认证的用户名与密码

mac-authentication user-name-format { fixed [ account name ] [ password { cipher | simple } password ] | mac-address [ {  with-hyphen | without-hyphen } [ lowercase | uppercase ] ] }

可选

缺省情况下,使用用户的不带连字符“-”的源MAC地址做用户名与密码,其中字母为小写

配置端口同时可容纳接入的MAC地址认证用户数量的最大值

以太网端口视图下

interface interface-type interface-number

mac-authentication max-user user-number

可选

缺省情况下,端口同时可容纳接入用户数量的最大值为1024

 

l    在全局MAC地址认证没有开启之前端口可以启动MAC地址认证,但不起作用;只有在全局MAC地址认证启动后,各端口的MAC地址认证配置才会立即生效。

l    端口启动MAC地址认证与端口加入聚合组及端口加入业务环回组互斥。

l    关于缺省ISP域的详细介绍请参见“安全分册”中的“AAA配置”。

 

1.4  MAC地址认证的显示和维护

在完成上述配置后,在任意视图下执行display命令可以显示配置后MAC地址认证的运行情况,通过查看显示信息验证配置的效果。

在用户视图下,执行reset命令可以清除相关统计信息。

表1-2 MAC地址认证的显示和维护

操作

命令

显示全局或指定端口的MAC地址认证信息

display mac-authentication [ interface interface-list ]

清除MAC地址认证的统计信息

reset mac-authentication statistics [ interface interface-list ]

 

1.5  MAC地址认证典型配置举例

1.5.1  MAC地址本地认证

1. 组网需求

图1-1所示,某用户的工作站与以太网设备的端口GigabitEthernet2/0/1相连接。

l              设备的管理者希望在各端口上对用户接入进行MAC地址认证,以控制其对Internet的访问。

l              要求设备每隔180秒就对用户是否下线进行检测;并且当用户认证失败时,需等待3分钟后才能对用户再次发起认证。

l              所有用户都属于域:example.com,认证时使用本地认证的方式。使用用户的源MAC地址做用户名和密码。

2. 组网图

图1-1 启动MAC地址认证对接入用户进行本地认证

 

3. 配置步骤

(1)        在Device上配置MAC地址认证

# 添加本地接入用户。用户名和密码均为接入用户的MAC地址00-e0-fc-12-34-56

<Device> system-view

[Device] local-user 00-e0-fc-12-34-56

[Device-luser-00-e0-fc-12-34-56] password simple 00-e0-fc-12-34-56

[Device-luser-00-e0-fc-12-34-56] service-type lan-access

[Device-luser-00-e0-fc-12-34-56] quit

# 配置ISP域,使用本地认证方式。

[Device] domain example.com

[Device-isp-example.com] authentication lan-access local

[Device-isp-example.com] quit

# 开启全局MAC地址认证特性。

[Device] mac-authentication

# 开启端口GigabitEthernet2/0/1的MAC地址认证特性。

[Device] mac-authentication interface gigabitethernet 2/0/1

# 配置MAC地址认证用户所使用的ISP域。

[Device] mac-authentication domain example.com

# 配置MAC地址认证的定时器。

[Device] mac-authentication timer offline-detect 180

[Device] mac-authentication timer quiet 180

# 配置MAC地址认证用户名格式:使用带连字符的MAC地址作为用户名与密码。

[Device] mac-authentication user-name-format mac-address with-hyphen

(2)        验证配置结果

# 显示全局MAC地址配置信息。

<Device> display mac-authentication

MAC address authentication is enabled.

 User name format is MAC address in lowercase, like xx-xx-xx-xx-xx-xx

 Fixed username:mac

 Fixed password:not configured

          Offline detect period is 180s

          Quiet period is 180s.

          Server response timeout value is 100s

          The max allowed user number is 2048 per slot

          Current user number amounts to 1

          Current domain is example.com

 

Silent Mac User info:

         MAC Addr               From Port           Port Index

 

GigabitEthernet2/0/1 is link-up

  MAC address authentication is enabled

  Authenticate success: 1, failed: 0

 Max number of on-line users is 1024

  Current online user number is 1

          MAC Addr         Authenticate state           Auth Index

          00e0-fc12-3456   MAC_AUTHENTICATOR_SUCCESS     29

 

<Device> display connection

Slot:  2

Index=29  ,Username=00-e0-fc-12-34-56@example.com

 IP=N/A

 MAC=00e0-fc12-3456

 

 Total 1 connection(s) matched on slot 2.

 Total 1 connection(s) matched.

1.5.2  MAC地址RADIUS认证

1. 组网需求

图1-2所示,用户主机Host通过端口GigabitEthernet2/0/1连接到设备上,设备通过RADIUS服务器对用户进行认证、授权和计费。

l              设备的管理者希望在各端口上对用户接入进行MAC地址认证,以控制其对Internet的访问。

l              要求设备每隔180秒就对用户是否下线进行检测;并且当用户认证失败时,需等待3分钟后才能对用户再次发起认证。

l              所有用户都属于域2000,认证时采用固定用户名格式,用户名为aaa,密码为123456。

2. 组网图

图1-2 启动MAC地址认证对接入用户进行RADIUS认证

 

3. 配置步骤

确保RADIUS服务器与设备路由可达,并成功添加了接入用户的用户名和密码。

 

(1)        在Device上配置MAC地址认证

# 配置RADIUS方案。

<Device> system-view

[Device] radius scheme 2000

[Device-radius-2000] primary authentication 10.1.1.1 1812

[Device-radius-2000] primary accounting 10.1.1.2 1813

[Device-radius-2000] key authentication abc

[Device-radius-2000] key accounting abc

[Device-radius-2000] user-name-format without-domain

[Device-radius-2000] quit

# 配置ISP域的AAA方案。

[Device] domain 2000

[Device-isp-2000] authentication default radius-scheme 2000

[Device-isp-2000] authorization  default radius-scheme 2000

[Device-isp-2000] accounting default radius-scheme 2000

[Device-isp-2000] quit

# 开启全局MAC地址认证特性。

[Device] mac-authentication

# 开启端口GigabitEthernet2/0/1的MAC地址认证特性。

[Device] mac-authentication interface gigabitethernet 2/0/1

# 配置MAC地址认证用户所使用的ISP域。

[Device] mac-authentication domain 2000

# 配置MAC地址认证的定时器。

[Device] mac-authentication timer offline-detect 180

[Device] mac-authentication timer quiet 180

# 配置MAC地址认证使用固定用户名格式:用户名为aaa,密码为123456。

[Device] mac-authentication user-name-format fixed account aaa password simple 123456

(2)        验证配置结果

# 显示全局MAC地址配置信息。

<Device> display mac-authentication

MAC address authentication is enabled.

User name format is fixed account

 Fixed username:aaa

 Fixed password:123456

          Offline detect period is 180s

          Quiet period is 180s.

          Server response timeout value is 100s

          The max allowed user number is 2048 per slot

          Current user number amounts to 1

          Current domain is 2000

 

Silent Mac User info:

         MAC ADDR               From Port           Port Index

 

GigabitEthernet2/0/1 is link-up

  MAC address authentication is enabled

  Authenticate success: 1, failed: 0

 Max number of on-line users is 1024

  Current online user number is 1

          MAC Addr         Authenticate state           Auth Index

          00e0-fc12-3456   MAC_AUTHENTICATOR_SUCCESS     29

<Device> display connection

Slot:  2

Index=29  ,Username=aaa@2000

 IP=N/A

 MAC=00e0-fc12-3456

 

 Total 1 connection(s) matched on slot 2.

 Total 1 connection(s) matched.

1.5.3  下发ACL典型配置举例

1. 组网需求

图1-3所示,主机Host通过MAC认证接入网络,认证服务器为RADIUS服务器。Internet网络中有一台FTP服务器,IP地址为10.0.0.1。

l              认证时使用用户的源MAC地址做用户名和密码。

l              在认证服务器上配置授权下发ACL 3000。

l              在Switch的GigabitEthernet2/0/1上开启MAC认证,并配置ACL 3000。

l              当用户认证成功上线,认证服务器下发ACL 3000。此时ACL 3000在GigabitEtherne2/0/1上生效,Host可以访问Internet,但不能访问FTP服务器。

2. 组网图

图1-3 下发ACL典型配置组网图

 

3. 配置步骤

l    确保RADIUS服务器与设备路由可达。

l    由于该例中使用了MAC地址认证的缺省用户名和密码,即使用用户的源MAC地址做用户名与密码,因此还要保证RADIUS服务器上正确添加了接入用户的用户名和密码。

l    指定RADIUS服务器上的授权ACL为设备上配置的ACL 3000。

 

(1)        在Switch上配置ACL下发

# 配置RADIUS方案。

<Sysname> system-view

[Sysname] radius scheme 2000

[Sysname-radius-2000] primary authentication 10.1.1.1 1812

[Sysname-radius-2000] primary accounting 10.1.1.2 1813

[Sysname-radius-2000] key authentication abc

[Sysname-radius-2000] key accounting abc

[Sysname-radius-2000] user-name-format without-domain

[Sysname-radius-2000] quit

# 配置ISP域的AAA方案。

[Sysname] domain 2000

[Sysname-isp-2000] authentication default radius-scheme 2000

[Sysname-isp-2000] authorization  default radius-scheme 2000

[Sysname-isp-2000] accounting default radius-scheme 2000

[Sysname-isp-2000] quit

# 配置ACL 3000,拒绝目的IP地址为10.0.0.1的报文通过。

[Sysname] acl number 3000

[Sysname-acl-adv-3000] rule 0 deny ip destination 10.0.0.1 0

[Sysname-acl-adv-3000] quit

# 开启全局MAC地址认证特性。

[Sysname] mac-authentication

# 配置MAC地址认证用户所使用的ISP域。

[Sysname] mac-authentication domain 2000

# 配置MAC地址认证用户名格式:使用用户的源MAC地址做用户名与密码。

[Sysname] mac-authentication user-name-format mac-address

# 开启指定端口的MAC地址认证特性。

[Sysname] interface gigabitethernet 2/0/1

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

(2)        验证配置结果

# 用户Host认证成功后,通过ping FTP服务器,可以验证认证服务器下发的ACL 3000是否生效。

C:\>ping 10.0.0.1

 

Pinging 10.0.0.1 with 32 bytes of data:

 

Request timed out.

Request timed out.

Request timed out.

Request timed out.

 

Ping statistics for 10.0.0.1:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

 

C:\>

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们