华为交换机配置802.1x认证

  1. 配置AAA。

    # 创建并配置RADIUS服务器模板“rd1”。//Huawei@2012为共享密钥在radius配置相同即可

    [Switch] radius-server template rd1
    [Switch-radius-rd1] radius-server authentication 192.168.1.30 1812
    [Switch-radius-rd1] radius-server shared-key cipher Huawei@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

    # 创建认证域“huawei.com”,并在其上绑定AAA认证方案“abc”与RADIUS服务器模板“rd1”。

    [Switch-aaa] domain huawei.com
    [Switch-aaa-domain-huawei.com] authentication-scheme abc
    [Switch-aaa-domain-huawei.com] radius-server rd1
    [Switch-aaa-domain-huawei.com] quit
    [Switch-aaa] quit

    # 测试用户是否能够通过RADIUS模板的认证。(已在RADIUS服务器上配置了测试用户test,用户密码Huawei2012)

    [Switch] test-aaa test Huawei2012 radius-template rd1
    Info: Account test succeed.




  2. 配置802.1X认证。
    # 将NAC配置模式切换成统一模式。

    设备默认为统一模式。传统模式与统一模式相互切换后,设备会自动重启(非必须)。

    [Switch] authentication unified-mode
    # 配置802.1X接入模板“d1”。
    [Switch] dot1x-access-profile name d1
    [Switch-dot1x-access-profile-d1] dot1x authentication-method pap
    [Switch-dot1x-access-profile-d1] quit

    802.1X接入模板默认采用EAP认证方式。请确保RADIUS服务器支持EAP协议,否则无法处理802.1X认证请求。

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

    [Switch] authentication-profile name p1
    [Switch-authen-profile-p1] dot1x-access-profile d1
    [Switch-authen-profile-p1] access-domain huawei.com force
    [Switch-authen-profile-p1] quit

    # 在接口GE1/0/2–GE1/0/n上绑定认证模板“p1”,使能802.1X认证。以接口GE1/0/2为例,其他接口配置与其类似。

    [Switch] interface gigabitethernet 1/0/2
    [Switch-GigabitEthernet1/0/2] authentication-profile p1

 

    [Switch-GigabitEthernet1/0/2] quit

# (推荐配置)配置指定VLAN内用户下线探测报文的源IP地址和源MAC地址。建议用户下线探测报文的源IP地址和源MAC地址配置为用户网关的IP地址和MAC地址。

[Switch] access-user arp-detect vlan 20 ip-address 192.168.2.10 mac-address 2222-1111-1234

 

    1. 验证配置结果。
      1. 用户在终端上启动802.1X客户端,输入用户名和密码,开始认证。
      2. 如果用户输入的用户名和密码验证正确,客户端页面会显示认证成功信息。用户即可访问网络。
      3. 用户上线后,管理员可在设备上执行命令display access-user access-type dot1x查看在线802.1X用户信息。

             

交换机端口进行配置

authentication-profile dot1x_authen_profile

posted @ 2022-01-10 16:11  冰糖狐狸  阅读(29)  评论(0)    收藏  举报