配置MAC迁移示例
组网需求
如图2-70所示,某公司办公区内终端通过Switch接入公司内部网络。
为了满足企业的高安全性需求,使用802.1X认证并通过RADIUS服务器验证用户的身份。
企业用户终端的接入位置经常变化,比如使用笔记本的用户移动到其他办公室办公或进行演示交流。但是,缺省情况下,用户从新接口接入后,无法立即发起认证也无法上线;必须等到设备上用户下线探测周期结束或手动将认证接口UP/DOWN清除用户在线表项后,用户才能在后接入的接口上发起认证。为提升用户体验,配置MAC迁移功能,使用户在切换接入接口后能够立即认证上线。
操作步骤
- 配置网络互连互通。
# 创建VLAN并配置接口允许通过的VLAN、IP地址。
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan batch 10 20 [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type access [Switch-GigabitEthernet0/0/2] port default vlan 20 [Switch-GigabitEthernet0/0/2] quit [Switch] interface vlanif 20 [Switch-Vlanif20] ip address 192.168.2.10 24 [Switch-Vlanif20] quit [Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type trunk [Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 [Switch-GigabitEthernet0/0/1] quit [Switch] interface vlanif 10 [Switch-Vlanif10] ip address 192.168.1.10 24 [Switch-Vlanif10] quit
- 配置AAA。
# 创建并配置RADIUS服务器模板“rd1”。
[Switch] radius-server template rd1 [Switch-radius-rd1] radius-server authentication 192.168.2.30 1812 [Switch-radius-rd1] radius-server shared-key cipher Example@2012 [Switch-radius-rd1] quit
# 创建AAA认证方案“abc”并配置认证方式为RADIUS。
[Switch] aaa [Switch-aaa] authentication-scheme abc [Switch-aaa-authen-abc] authentication-mode radius [Switch-aaa-authen-abc] quit
# 创建认证域“example.com”,并在其上绑定AAA认证方案“abc”与RADIUS服务器模板“rd1”。
[Switch-aaa] domain example.com [Switch-aaa-domain-example.com] authentication-scheme abc [Switch-aaa-domain-example.com] radius-server rd1 [Switch-aaa-domain-example.com] quit [Switch-aaa] quit
# 测试用户是否能够通过RADIUS模板的认证。(已在RADIUS服务器上配置了测试用户test,用户密码Example2012)
[Switch] test-aaa test Example2012 radius-template rd1 Info: Account test succeeded.
- 配置802.1X认证。# 将NAC配置模式切换成统一模式。
设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启。
[Switch] authentication unified-mode
# 配置802.1X接入模板“d1”。802.1X接入模板默认采用EAP认证方式。请确保RADIUS服务器支持EAP协议,否则无法处理802.1X认证请求。
[Switch] dot1x-access-profile name d1 [Switch-dot1x-access-profile-d1] dot1x authentication-method eap [Switch-dot1x-access-profile-d1] dot1x timer client-timeout 30 [Switch-dot1x-access-profile-d1] quit
# 配置认证模板“p1”,并在其上绑定802.1X接入模板“d1”、指定认证模板下用户的强制认证域为“example.com”、指定用户接入模式为多用户单独认证接入模式、最大接入用户数为100。
[Switch] authentication-profile name p1 [Switch-authen-profile-p1] dot1x-access-profile d1 [Switch-authen-profile-p1] access-domain example.com force [Switch-authen-profile-p1] authentication mode multi-authen max-user 100 [Switch-authen-profile-p1] quit
# 在接口GE0/0/1上绑定认证模板“p1”,使能802.1X认证。
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] authentication-profile p1 [Switch-GigabitEthernet0/0/1] quit
- 配置MAC迁移。
[Switch] authentication mac-move enable vlan all [Switch] authentication mac-move detect enable
- 验证配置结果。
- 用户在终端上启动802.1X客户端,输入用户名和密码,开始认证。
- 如果用户输入的用户名和密码验证正确,客户端页面会显示认证成功信息。用户即可访问网络。
- 用户上线后,管理员可在设备上执行命令display access-user access-type dot1x查看在线802.1X用户信息。
- 在设备上执行命令display authentication mac-move configuration查看MAC迁移功能的相关配置信息。