选择区域语言: EN CN HK

09-安全配置指导

04-MAC地址认证配置

本章节下载  (316.73 KB)

docurl=/cn/Service/Document_Software/Document_Center/Wlan/WX/H3C_WX3000/Configure/Operation_Manual/H3C_WX_CG-6W100/09/201011/699300_30005_0.htm

04-MAC地址认证配置


l          本手册中标有“请以设备实际情况为准”的特性描述,表示WX系列无线控制产品的各型号对于此特性的支持情况不同,具体差异请参见“特性差异化列表”的“特性支持情况”章节。

l          无线控制产品支持的接口类型和编号与设备的实际情况相关,实际使用中请根据具体设备的接口类型和编号进行配置。

 

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.2.5  MAC地址认证的Guest VLAN

Guest VLAN功能允许用户在认证失败的情况下,可以访问某一特定VLAN中的资源,比如获取客户端软件,升级客户端或执行其他一些用户升级程序。这个VLAN称之为Guest VLAN。

MAC地址认证支持基于MAC的Guest VLAN (MAC-based Guest VLAN),简称MGV。如果接入用户的端口上配置了MGV,则该端口上认证失败的用户会被加入Guest VLAN,即该用户被授权访问Guest VLAN里的资源。

若Guest VLAN中的用户再次发起认证未成功,则该用户将仍然处于Guest VLAN内;若认证成功,则会根据认证服务器是否下发VLAN将用户加入到下发的VLAN中,或回到加入Guest VLAN之前端口所在的VLAN。

1.3  配置MAC地址认证

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

1.3.1  配置准备

l              创建并配置ISP域。

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

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

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

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

l          若用户名和密码为MAC地址形式,则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 ] }

可选

缺省情况下,使用用户的源MAC地址做用户名与密码MAC地址带连字符“-”

 

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

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

 

1.4  配置MAC地址认证的Guest VLAN

1.4.1  配置准备

l              开启MAC地址认证特性。

l              端口的MAC VLAN功能已经使能。

l              已经创建需要配置为Guest VLAN的VLAN。

1.4.2  配置Guest VLAN

表1-2 配置Guest VLAN

配置步骤

命令

说明

进入系统视图

system-view

-

进入接口视图

interface interface-type interface-number

-

配置MAC认证的Guest VLAN

mac-authentication guest-vlan guest-vlan-id

必选

缺省情况下,没有配置MAC认证的Guest VLAN

 

l          不同的端口可以配置不同的Guest VLAN,但一个端口只能配置一个Guest VLAN。

l          若端口上同时配置了802.1x认证与MAC地址认证,且两种认证方式下均配置了相应的MGV,则MGV的生效由首先失败的认证类型决定,即哪种类型的认证先失败就生效哪种类型的MGV。

l          MGV功能的优先级高于端口安全中端口入侵检测的阻塞MAC功能,低于端口入侵检测的端口关闭功能。关于端口入侵检测功能的具体介绍请参见“端口安全配置”。

l          MGV功能的优先级高于MAC认证的静默MAC功能。

 

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

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

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

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

操作

命令

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

display mac-authentication [ interface interface-list ]

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

reset mac-authentication statistics [ interface interface-list ]

 

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

1.6.1  MAC地址本地认证(WX系列无线控制产品适用)

1. 组网需求

图1-1所示,某用户的工作站与无线控制器的端口WLAN-ESS2相连接。

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

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

l              所有用户都属于域:aabbcc.net,认证时使用本地认证的方式。用户名和密码都是为接入用户的MAC地址00-e0-fc-12-34-56

2. 组网图

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

 

3. 配置步骤

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

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

<AC> system-view

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

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

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

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

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

[AC] domain aabbcc.net

[AC-isp-aabbcc.net] authentication lan-access local

[AC-isp-aabbcc.net] quit

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

[AC] mac-authentication domain aabbcc.net

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

[AC] mac-authentication timer offline-detect 180

[AC] mac-authentication timer quiet 180

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

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

# 使能端口安全。

[AC] port-security enable

# 配置无线端口安全,使用密文MAC认证。

[AC] interface wlan-ess 2

[AC-WLAN-ESS2] port-security port-mode mac-and-psk

[AC-WLAN-ESS2] port-security tx-key-type 11key

[AC-WLAN-ESS2] port-security preshared-key pass-phrase 12345678

[AC-WLAN-ESS2] quit

# 创建服务模板2(加密类型服务模板),配置SSID为mactest,将WLAN-ESS2接口绑定到服务模板2。

[AC] wlan service-template 2 crypto

[AC-wlan-st-2] ssid mactest

[AC-wlan-st-2] bind wlan-ess 2

[AC-wlan-st-2] authentication-method open-system

[AC-wlan-st-2] cipher-suite tkip

[AC-wlan-st-2] security-ie rsn

[AC-wlan-st-2] service-template enable

[AC-wlan-st-2] quit

# 配置AP 1:创建AP 1的模板,名称为ap1,型号名称选择WA2100,并配置AP 1的序列号为210235A29G007C000020。

[AC] wlan ap ap1 model WA2100

[AC-wlan-ap-ap1] serial-id 210235A29G007C000020

[AC-wlan-ap-ap1] radio 1 type dot11g

# 将服务模板2绑定到AP 1的radio 1口。

[AC-wlan-ap-ap1-radio-1] service-template 2

[AC-wlan-ap-ap1-radio-1] radio enable

[AC-wlan-ap-ap1-radio-1] quit

[AC-wlan-ap-ap1] quit

(2)        验证配置结果

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

<AC> 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 aabbcc.net

         

Silent Mac User info:

         MAC ADDR               From Port           Port Index

WLAN-ESS2 is link-down

  MAC address authentication is enabled

  Authenticate success: 0, failed: 0

 Max number of on-line users is 4096

  Current online user number is 0

1.6.2  MAC地址RADIUS认证(WX系列无线控制产品适用)

1. 组网需求

图1-2所示,用户主机Client通过端口WLAN-ESS2连接到无线控制器上,无线控制器通过RADIUS服务器对用户进行身份认证。

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

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

2. 组网图

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

 

3. 配置步骤

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

# 配置各接口的IP地址(略)。

# 配置RADIUS方案。

<AC> system-view

[AC] radius scheme 2000

[AC-radius-2000] primary authentication 10.1.1.1 1812

[AC-radius-2000] primary accounting 10.1.1.2 1813

[AC-radius-2000] key authentication abc

[AC-radius-2000] key accounting abc

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

[AC-radius-2000] quit

# 配置ISP域的AAA方案。

[AC] domain 2000

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

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

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

[AC-isp-2000] quit

# 使能端口安全。

[AC] port-security enable

# 配置无线端口安全,使用密文MAC认证。

[AC] interface wlan-ess 2

[AC-WLAN-ESS2] port-security port-mode mac-and-psk

[AC-WLAN-ESS2] port-security tx-key-type 11key

[AC-WLAN-ESS2] port-security preshared-key pass-phrase 12345678

[AC-WLAN-ESS2] quit

# 创建服务模板2(加密类型服务模板),配置SSID为mactest,将WLAN-ESS2接口绑定到服务模板2。

[AC] wlan service-template 2 crypto

[AC-wlan-st-2] ssid mactest

[AC-wlan-st-2] bind wlan-ess 2

[AC-wlan-st-2] authentication-method open-system

[AC-wlan-st-2] cipher-suite tkip

[AC-wlan-st-2] security-ie rsn

[AC-wlan-st-2] service-template enable

[AC-wlan-st-2] quit

# 配置AP 1:创建AP 1的模板,名称为ap1,型号名称选择WA2100,并配置AP 1的序列号为210235A29G007C000020。

[AC] wlan ap ap1 model WA2100

[AC-wlan-ap-ap1] serial-id 210235A29G007C000020

[AC-wlan-ap-ap1] radio 1 type dot11g

# 将服务模板2绑定到AP 1的radio 1口。

[AC-wlan-ap-ap1-radio-1] service-template 2

[AC-wlan-ap-ap1-radio-1] radio enable

[AC-wlan-ap-ap1-radio-1] quit

[AC-wlan-ap-ap1] quit

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

[AC] mac-authentication domain 2000

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

[AC] mac-authentication timer offline-detect 180

[AC] mac-authentication timer quiet 180

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

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

(2)        验证配置结果

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

<AC> 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 4096 per slot

          Current user number amounts to 0

          Current domain is 2000

 

Silent MAC User info:

          MAC Addr         From Port                    Port Index

 

WLAN-ESS2 is link-down

  MAC address authentication is enabled

  Authenticate success: 0, failed: 0

 Max number of on-line users is 4096

  Current online user number is 0

1.6.3  下发ACL典型配置举例(WX系列无线控制产品适用)

1. 组网需求

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

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

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

l              在AC的WLAN-ESS2上开启MAC认证,并配置ACL 3000。

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

此配置举例不适合LS8M1WCMA0、LSQM1WCMB0、LSBM1WCM2A0业务板。

 

2. 组网图

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

 

3. 配置步骤

(1)        在AC上配置ACL下发

# 配置各接口的IP地址(略)。

# 配置RADIUS方案。

<AC> system-view

[AC] radius scheme 2000

[AC-radius-2000] primary authentication 10.1.1.1 1812

[AC-radius-2000] primary accounting 10.1.1.2 1813

[AC-radius-2000] key authentication abc

[AC-radius-2000] key accounting abc

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

[AC-radius-2000] quit

# 配置ISP域的AAA方案。

[AC] domaim 2000

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

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

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

[AC-isp-2000] quit

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

[AC] acl number 3000

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

[AC-acl-adv-3000] quit

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

[AC] mac-authentication domain 2000

# 配置MAC地址认证用户名格式:使用用户的源MAC地址做用户名与密码(带连字符“-”)。

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

# 使能端口安全。

[AC] port-security enable

# 配置无线端口安全,使用密文MAC认证。

[AC] interface wlan-ess 2

[AC-WLAN-ESS2] port-security port-mode mac-and-psk

[AC-WLAN-ESS2] port-security tx-key-type 11key

[AC-WLAN-ESS2] port-security preshared-key pass-phrase 12345678

[AC-WLAN-ESS2] quit

# 创建服务模板2(加密类型服务模板),配置SSID为mactest,将WLAN-ESS2接口绑定到服务模板2。

[AC] wlan service-template 2 crypto

[AC-wlan-st-2] ssid mactest

[AC-wlan-st-2] bind wlan-ess 2

[AC-wlan-st-2] authentication-method open-system

[AC-wlan-st-2] cipher-suite tkip

[AC-wlan-st-2] security-ie rsn

[AC-wlan-st-2] service-template enable

[AC-wlan-st-2] quit

# 配置AP 1:创建AP 1的模板,名称为ap1,型号名称选择WA2100,并配置AP 1的序列号为210235A29G007C000020。

[AC] wlan ap ap1 model WA2100

[AC-wlan-ap-ap1] serial-id 210235A29G007C000020

[AC-wlan-ap-ap1] radio 1 type dot11g

# 将服务模板2绑定到AP 1的radio 1口。

[AC-wlan-ap-ap1-radio-1] service-template 2

[AC-wlan-ap-ap1-radio-1] radio enable

[AC-wlan-ap-ap1-radio-1] quit

[AC-wlan-ap-ap1] quit

(2)        验证配置结果

# 用户Host认证成功后,通过在设备上执行display connection命令可以查看到已上线用户信息。

[AC-WLAN-ESS2] display connection

 

Index=9   ,Username=00-e0-fc-12-34-56@2000

IP=N/A

IPv6=N/A

MAC=00e0-fc12-3456

 

Total 1 connection(s) matched.

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

[AC] ping 10.0.0.1

  PING 10.0.0.1: 56  data bytes, press CTRL_C to break

    Request time out

    Request time out

    Request time out

    Request time out

    Request time out

 

  --- 10.0.0.1 ping statistics ---

    5 packet(s) transmitted

    0 packet(s) received

    100.00% packet loss

 

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