华为交换机举例:配置MAC认证(AAA采用本地认证)

 华为交换机举例:配置MAC认证(AAA采用本地认证)

组网需求

如图3-49所示,用户哑终端设备通过DeviceA接入公司内部网络。为保证公司内网的安全,因此管理员希望DeviceA能够对用户的网络访问权限进行控制。

由于用户哑终端设备无法安装认证客户端,因此在DeviceA上部署MAC认证。并且,使用本地认证方式对用户身份进行认证。

图3-49 配置MAC认证组网图

本例中Interface1、Interface2分别代表10GE1/0/110GE1/0/2


操作步骤

配置网络互连互通。

# 创建VLAN并配置接口允许通过的VLAN、IP地址。

<HUAWEI> system-view

[HUAWEI] sysname DeviceA

[DeviceA] vlan batch 10 20

[DeviceA] interface 10ge 1/0/1

[DeviceA-10GE1/0/1] portswitch

[DeviceA-10GE1/0/1] port link-type trunk

[DeviceA-10GE1/0/1] port trunk allow-pass vlan 10

[DeviceA-10GE1/0/1] quit

[DeviceA] interface vlanif 10

[DeviceA-Vlanif10] ip address 192.168.1.10 24

[DeviceA-Vlanif10] quit

[DeviceA] interface 10ge 1/0/2

[DeviceA-10GE1/0/2] portswitch

[DeviceA-10GE1/0/2] port link-type access

[DeviceA-10GE1/0/2] port default vlan 20

[DeviceA-10GE1/0/2] quit

[DeviceA] interface vlanif 20

[DeviceA-Vlanif20] ip address 192.168.2.10 24

[DeviceA-Vlanif20] quit


配置AAA本地认证。

# 配置认证方案“a1”为本地认证。

[DeviceA] aaa

[DeviceA-aaa] authentication-scheme a1

[DeviceA-aaa-authen-a1] authentication-mode local

[DeviceA-aaa-authen-a1] quit

# 配置授权方案“b1”为本地授权。

[DeviceA-aaa] authorization-scheme b1

[DeviceA-aaa-author-b1] authorization-mode local

[DeviceA-aaa-author-b1] quit

# 配置本地用户的用户名、密码和用户接入类型。

将终端的MAC地址配置为本地用户名,密码配置为Example@123,接入类型为dot1x。以下以打印机1为例(MAC地址为00e0-fcd4-8828)。

[DeviceA-aaa] local-access-user 00e0-fcd4-8828

[DeviceA-aaa-access-user-00e0-fcd4-8828] password cipher Example@123

[DeviceA-aaa-access-user-00e0-fcd4-8828] service-type dot1x

Warning: If the service type of local access users is configured multiple times, the new configuration overwrites the previous one. The new configuration may cause local access users unable to go online. Continue? [Y/N]:y

[DeviceA-aaa-access-user-00e0-fcd4-8828] quit

# 配置域“example.com”,并在域下应用认证方案“a1”、授权方案“b1”。

[DeviceA-aaa] domain example.com

[DeviceA-aaa-domain-example.com] authentication-scheme a1

[DeviceA-aaa-domain-example.com] authorization-scheme b1

[DeviceA-aaa-domain-example.com] quit

[DeviceA-aaa] quit


配置MAC认证。

# 配置MAC接入模板“m1”。

当采用AAA本地方式认证和授权时,MAC认证用户的用户名和密码必须与AAA本地用户的用户名和密码保持一致。本举例中本地用户的用户名为终端的MAC地址(带分隔符-的),密码为Example@123。

[DeviceA] mac-access-profile name m1

[DeviceA-mac-access-profile-m1] mac-authen username macaddress format with-hyphen password cipher Example@123

[DeviceA-mac-access-profile-m1] quit

# 配置认证模板“p1”,并在其上绑定MAC接入模板“m1”、指定认证模板下用户的强制认证域为“example.com”。

[DeviceA] authentication-profile name p1

[DeviceA-authen-profile-p1] mac-access-profile m1

[DeviceA-authen-profile-p1] access-domain example.com force

[DeviceA-authen-profile-p1] quit

# 在接口10GE1/0/1上绑定认证模板“p1”,开启MAC认证。

[DeviceA] interface 10ge 1/0/1

[DeviceA-10GE 1/0/1] authentication-profile p1

[DeviceA-10GE 1/0/1] quit


检查配置结果

用户启动终端后,设备会自动获取用户终端的MAC地址作为用户名和密码进行认证。

用户认证成功后即可访问网络。

用户上线后,管理员可在设备上执行命令display access-user access-type mac-authen查看在线MAC认证用户信息。

操作步骤

  1. 用户启动终端后,设备会自动获取用户终端的MAC地址作为用户名和密码进行认证。
  2. 用户认证成功后即可访问网络。
  3. 用户上线后,管理员可在设备上执行命令display access-user access-type mac-authen查看在线MAC认证用户信息。

配置脚本

DeviceA的配置脚本

#
sysname DeviceA
#
authentication-profile name p1
 mac-access-profile m1
 access-domain example.com force
#
vlan batch 10 20
#
aaa
 authentication-scheme a1    
  authentication-mode local
 authorization-scheme b1
  authorization-mode local
 domain example.com            
  authentication-scheme a1
  authorization-scheme b1
 local-access-user 00e0-fcd4-8828
  password cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.<FvBB,.w;M75IN5Z>'!L8G:n-!!!!!2jp5!!!!!!<!!!!k9&fPO<BSRW}jPT(,ewKyfIL"zVtM1~=>e.!!!!!%+%# 
  service-type dot1x 
#  
mac-access-profile name m1
 mac-authen username macaddress format with-hyphen password cipher %+%##!!!!!!!!!"!!!!"!!!!*!!!!SKvr${[Fs.vW-9,<\Dz<6:AiLq@Ls2I%l3/!!!!!2jp5!!!!!!<!!!!5v2C4u&Z-8<3C6-//E:GF\uP8a9Le$7xWEF!!!!!%+%#
#
interface Vlanif10
 ip address 192.168.1.10 255.255.255.0
#
interface Vlanif20
 ip address 192.168.2.10 255.255.255.0
#
interface 10GE1/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 authentication-profile p1
#
interface 10GE1/0/2
 port link-type access
 port default vlan 20
#
return


1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » 华为交换机举例:配置MAC认证(AAA采用本地认证)

作者: 小编


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!