• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 关于我们

09-安全配置举例

目录

03-MAC地址认证典型配置举例

本章节下载 03-MAC地址认证典型配置举例  (367.32 KB)

03-MAC地址认证典型配置举例


1 简介

本文档介绍了使用MAC地址认证功能实现用户安全接入的典型配置案例。

2 配置前提

本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。

本文假设您已了解MAC地址认证特性。

3 MAC地址本地认证典型配置举例

3.1  组网需求

图3-1所示,通过配置MAC地址本地认证功能,实现在无需架设服务器的情况下,完成接入用户的安全认证,控制其对Internet的访问。

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

 

3.2  配置思路

·     在Device与用户端相连的端口Ten-GigabitEthernet1/0/1上配置MAC地址认证。

·     认证用户属于域bbb,用户名和密码都为用户端的MAC地址:08-00-27-00-98-d2

为了防止非法MAC短时间内的重复认证,可配置MAC地址认证定时器。

3.1  适用产品及版本

表3-1 适用产品及版本

产品

软件版本

S9850-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6850-G系列

S6805-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6530X系列

Release 8108P22及以上版本、Release 8307P10及以上版本

S6530X-G系列

Release 8307P24及以上版本

S5590-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5590-EI系列

S5500V3-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5500-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

FS5500V2-EI系列

Release 8108P11及以上版本

FS6300V2-EI系列

Release 8307P53及以上版本

S6520X-EI-G系列

S6520XP-EI-G系列

Release 7748及以上版本

S5590XP-HI-G系列

Release 7748及以上版本

S5560-EI-G系列

Release 7748及以上版本

S5500-D-G系列

S5100-D-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5300-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

S5130S-HI-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-EI-G系列(除S5130S-30C-EI-G、S5130S-54C-EI-G)

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-30C-EI-G

S5130S-54C-EI-G

Release 7748及以上版本

 

3.2  配置注意事项

·     配置全局MAC地址认证一般放在最后,当其他认证参数未配置完成时,会造成合法用户无法访问网络。

·     创建本地用户时,需要注意用户名必须与设备上指定的MAC地址认证用户名格式保持一致。

3.3  配置步骤

# 添加本地接入用户。

<Device> system-view

[Device] local-user 08-00-27-00-98-d2 class network

[Device-luser-network-08-00-27-00-98-d2] password simple 08-00-27-00-98-d2

[Device-luser-network-08-00-27-00-98-d2] service-type lan-access

[Device-luser-network-08-00-27-00-98-d2] quit

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

[Device] domain bbb

[Device-isp-bbb] authentication lan-access local

[Device-isp-bbb] quit

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

[Device] mac-authentication domain bbb

# 配置MAC地址认证的下线定时器和静默定时器。即设备每隔180秒就对用户是否下线进行检测;并且当用户认证失败时,需等待3分钟后才能对用户再次发起认证。

[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 lowercase

# 开启端口Ten-GigabitEthernet1/0/1的MAC地址认证。

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

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

[Device-Ten-GigabitEthernet1/0/1] quit

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

[Device] mac-authentication

3.4  验证配置

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

<Device>display mac-authentication

 Global MAC authentication parameters:

   MAC authentication                         : Enabled

   Authentication method                      : PAP

   M-LAG member configuration conflict        : Unknown

   Username format                            : MAC address in lowercase(xx-xx-xx-xx-xx-xx)

           Username                           : mac

           Password                           : Not configured

   MAC range accounts                         : 0

          MAC address          Mask                 Username

   Offline detect period                      : 180 s

   Quiet period                               : 180 s

   Server timeout                             : 100 s

   Reauth period                              : 3600 s

   User aging period for critical VLAN        : 1000 s

   User aging period for guest VLAN           : 1000 s

   Authentication domain                      : bbb

   HTTP proxy port list                       : Not configured

   HTTPS proxy port list                      : Not configured

 Online MAC-auth wired users                  : 1

 

 Silent MAC users:

          MAC address       VLAN ID  From port               Port index

 

 Ten-GigabitEthernet1/0/1  is link-up

   MAC authentication               : Enabled

   Carry User-IP                    : Disabled

   Authentication domain            : Not configured

   Auth-delay timer                 : Disabled

   Periodic reauth                  : Disabled

   Re-auth server-unreachable       : Logoff

   Guest VLAN                       : Not configured

   Guest VLAN reauthentication      : Enabled

     Guest VLAN auth-period         : 30 s

   Critical VLAN                    : Not configured

   Critical voice VLAN              : Disabled

   Host mode                        : Single VLAN

   Offline detection                : Enabled

   Authentication order             : Default

   User aging                       : Enabled

   Server-recovery online-user-sync : Disabled

 

   Auto-tag feature                 : Disabled

   VLAN tag configuration ignoring  : Disabled

   Max online users                 : 4294967295

   Authentication attempts          : successful 1, failed 0

   Current online users             : 1

          MAC address       Auth state

          0800-2700-98d2    Authenticated

3.5  配置文件

#

 mac-authentication

 mac-authentication timer offline-detect 180

 mac-authentication timer quiet 180

 mac-authentication domain bbb

 mac-authentication user-name-format mac-address with-hyphen lowercase

#

domain bbb

 authentication lan-access local

#

local-user 08-00-27-00-98-d2 class network

 password cipher $c$3$rTXB/eL1h+bXc/t2nyQOrhDMC0PWfyiPb93BqMCK+JFYwvn5

 service-type lan-access

 authorization-attribute user-role network-operator

#

interface Ten-GigabitEthernet1/0/1

mac-authentication

#

4 MAC地址认证下发ACL配置举例

4.1  组网需求

图4-1所示,用户主机Host通过端口Ten-GigabitEthernet1/0/1连接到设备上,设备通过RADIUS服务器对用户进行认证、授权和计费,Internet网络中有一台FTP服务器,IP地址为10.0.0.1。现有如下组网需求:

·     一台iMC服务器(IP地址为10.1.1.1/24)作为RADIUS认证授权计费服务器。

·     在端口Ten-GigabitEthernet1/0/1上对用户接入进行MAC地址认证,以控制其对Internet的访问。认证时使用用户的源MAC地址做用户名和密码,其中MAC地址带连字符、字母小写。

·     用户认证成功后可以访问Internet,但不能访问FTP服务器。

图4-1 MAC地址认证支持下发ACL

 

4.2  配置思路

·     在RADIUS服务器上添加接入设备和用户帐号,并指定授权下发ACL 3000。

·     在Device上配置RADIUS方案,并配置ACL规则。

在Device与用户端相连的端口上配置MAC地址认证。

4.3  适用产品及版本

表4-1 适用产品及版本

产品

软件版本

S9850-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6850-G系列

S6805-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S6530X系列

Release 8108P22及以上版本、Release 8307P10及以上版本

S6530X-G系列

Release 8307P24及以上版本

S5590-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5590-EI系列

S5500V3-HI系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5500-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

FS5500V2-EI系列

Release 8108P11及以上版本

FS6300V2-EI系列

Release 8307P53及以上版本

S6520X-EI-G系列

S6520XP-EI-G系列

Release 7748及以上版本

S5590XP-HI-G系列

Release 7748及以上版本

S5560-EI-G系列

Release 7748及以上版本

S5500-D-G系列

S5100-D-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

FS5300-EI系列

Release 8108P11及以上版本、Release 8307P10及以上版本

S5130S-HI-G系列

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-EI-G系列(除S5130S-30C-EI-G、S5130S-54C-EI-G)

Release 6010P03及以上版本、Release 8307P10及以上版本

S5130S-30C-EI-G

S5130S-54C-EI-G

Release 7748及以上版本

 

4.4  配置注意事项

·     配置全局MAC地址认证一般放在最后,当其他认证参数未配置完成时,会造成合法用户无法访问网络。

·     在RADIUS服务器上添加用户帐号,用户名必须与设备上指定的MAC地址认证用户名格式保持一致。

·     在标准的RADIUS协议中,RADIUS服务器的认证端口为UDP端口1812,我司设备作为RADIUS服务器时认证端口为UDP端口1645。

4.5  配置步骤

4.5.1  配置RADIUS服务器

说明

下面以iMC为例(使用iMC版本为:iMC PLAT 7.3(E0506)iMC EIA 7.3(E0503)iMC EIP 7.3(E0503)),说明RADIUS服务器的基本配置。

 

在RADIUS服务器上添加用户账户(用户名为d4-85-64-be-c6-3e,密码为d4-85-64-be-c6-3e),指定要授权下发的ACL编号,并保证用户的认证/授权/计费功能正常运行。

1. 增加接入设备

登录进入iMC管理平台,选择“用户”页签,单击导航树中的“接入策略管理 > 接入设备管理 > 接入设备配置”菜单项,进入接入设备配置页面。在该页面中单击“增加”按钮,进入增加接入设备页面。

·     设置认证端口和计费端口分别为“1812”和“1813”;

·     选择接入设备类型为“H3C (General)”;

·     设置与Switch交互报文时的认证、计费共享密钥为“expert”;

·     选择或手工增加接入设备,添加IP地址为10.1.1.2的接入设备;

·     其它参数采用缺省值;

·     单击<确定>按钮完成操作。

说明

添加的接入设备IP地址要与Device发送RADIUS报文的源地址保持一致。缺省情况下,设备发送RADIUS报文的源地址是发送RADIUS报文的接口IP地址。若设备上通过命令nas-ip或者radius nas-ip指定了发送RADIUS报文的源地址,则此处的接入设备IP地址就需要修改并与指定源地址保持一致。

 

图4-2 增加接入设备页面

 

2. 增加接入策略

选择“用户”页签,单击导航树中的“接入策略管理 > 接入策略管理”菜单项,进入接入策略管理页面。在该页面中单击<增加>按钮,进入增加接入策略页面。

·     输入接入策略名称“MACauth”;

·     配置下发ACL,并手工输入ACL编号“3000”;

·     本配置页面中还有其它策略配置选项,请根据实际情况选择配置;

·     单击<确定>按钮完成操作。

图4-3 增加接入策略页面

 

3. 增加接入服务

选择“用户”页签,单击导航树中的“接入策略管理 > 接入服务管理”菜单项,进入接入服务管理页面。在该页面中单击<增加>按钮,进入增加服务配置页面。

·     输入服务名“MACauth Service”、服务后缀为“2000”,此服务后缀为MAC地址认证用户使用的认证域。指定服务后缀的情况下,RADIUS方案中必须指定向服务器发送的用户名中携带域名;

·     选择缺省接入策略为“MACauth”;

·     本配置页面中还有其它服务配置选项,请根据实际情况选择配置;

·     单击<确定>按钮完成操作。

图4-4 增加服务配置页面

 

4. 增加接入用户

选择“用户”页签,单击导航树中的“接入用户管理 > 接入用户”菜单项,进入接入用户页面。在该页面中单击<增加>按钮,进入增加接入用户页面。

·     选择或者手工增加用户姓名“test”;

·     输入账号名“d4-85-64-be-c6-3e”和密码“d4-85-64-be-c6-3e”;

·     选择该用户所关联的接入服务为“MACauth Service”;

·     本配置页面中还有其它服务配置选项,请根据实际情况选择配置;

·     单击<确定>按钮完成操作。

图4-5 增加接入用户页面

 

4.5.2  配置Device

(1)     配置授权ACL

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

<Device> system-view

[Device] acl advanced 3000

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

[Device-acl-ipv4-adv-3000] quit

(2)     配置使用RADIUS服务器进行MAC地址认证

# 配置RADIUS方案。

[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 simple expert

[Device-radius-2000] key accounting simple expert

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

[Device-radius-2000] quit

# 配置ISP域的AAA方法。

[Device] domain bbb

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

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

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

[Device-isp-bbb] quit

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

[Device] mac-authentication domain bbb

# 配置MAC地址认证用户的账号格式:使用带连字符的MAC地址做用户名与密码,其中字母小写。

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

# 开启端口Ten-GigabitEthernet1/0/1上的MAC地址认证。

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

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

[Device-Ten-GigabitEthernet1/0/1] quit

# 开启全局MAC地址认证。

[Device] mac-authentication

4.6  验证配置

# 显示MAC地址认证配置信息。

<Device> display mac-authentication

 Global MAC authentication parameters:

   MAC authentication                         : Enable

   Authentication method                      : PAP

   M-LAG member configuration conflict        : Unknown

   Username format                            : MAC address in lowercase(xx-xx-xx-xx-xx-xx)

           Username                           : mac

           Password                           : Not configured

   Offline detect period                      : 300 s

   Quiet period                               : 60 s

   Server timeout                             : 100 s

   Reauth period                              : 3600 s

   User aging period for critical VLAN        : 1000 s

   User aging period for guest VLAN           : 1000 s

   Authentication domain                      : bbb

   HTTP proxy port list                       : Not configured

   HTTPS proxy port list                      : Not configured

 Online MAC-auth wired users                  : 1

 

 Silent MAC users:

          MAC address       VLAN ID  From port               Port index

 

 Ten-GigabitEthernet1/0/1  is link-up

   MAC authentication               : Enabled

   Carry User-IP                    : Disabled

   Authentication domain            : Not configured

   Auth-delay timer                 : Disabled

   Periodic reauth                  : Disabled

   Re-auth server-unreachable       : Logoff

   Guest VLAN                       : Not configured

   Guest VLAN reauthentication      : Enabled

     Guest VLAN auth-period         : 30 s

   Critical VLAN                    : Not configured

   Critical voice VLAN              : Disabled

   Host mode                        : Single VLAN

   Offline detection                : Enabled

   Authentication order             : Default

   User aging                       : Enabled

   Server-recovery online-user-sync : Enabled

 

   Auto-tag feature                 : Disabled

   VLAN tag configuration ignoring  : Disabled

   Max online users                 : 4294967295

   Authentication attempts          : successful 1, failed 0

   Current online users             : 1

          MAC address       Auth state

          0800-2712-3456    Authenticated

用户认证上线后,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),

4.7  配置文件

#

acl advanced 3000

 rule 0 deny ip destination 10.0.0.1 0

#

 radius scheme 2000

 primary authentication 10.1.1.1

 primary accounting 10.1.1.2

 key authentication cipher $c$3$PJM7Px3rbC96Kvh8RyFWHMLatExagQ==

 key accounting cipher $c$3$rr7AO7ZuSNZ+b+deWrfb/Qg1JPc97g==

 user-name-format with-domain

#

 domain bbb

 authentication default radius-scheme 2000

 authorization default radius-scheme 2000

 accounting  default radius-scheme 2000

#

 mac-authentication domain bbb

#

 mac-authentication user-name-format mac-address with-hyphen lowercase

#

interface Ten-GigabitEthernet1/0/1

 mac-authentication

#

 mac-authentication

#

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

新华三官网
联系我们