通过iMaster NCE实现基于有线和WLAN的802.1X认证和MAC认证
实验环境 实验环境: O3社区·园区传统解决方案-NCE仅做认证
实验参考: https://support.huawei.com/enterprise/zh/doc/EDOC1100333464/496931a
拓扑图
部分IP地址规划信息
基础网络搭建 IP路由基础 配置什么都不影响准入认证,只要实现总部-分部全网能通即可
基础IP地址及接口划分
1 2 此处省略,按拓扑图划分即可 除了AC与SW-Core之间是Trunk 放行vlan 99,其他都是Access,路由器与防火墙之间使用三层接口
分部其他配置
1 2 3 4 5 6 7 8 9 10 # SW-01 dhcp enable interface Vlanif10 dhcp select interface interface Vlanif100 dhcp select interface dhcp server gateway-list 10.0.100.254 dhcp server option 43 sub-option 2 ip-address 172.201.5.10
分部路由配置
分部四台设备跑OSPF协议,AR使用静态路由指向总部网段,并将静态路由引入OSPF;同时设置OSPF COST值,防止次优路由
1 2 3 4 5 6 7 8 9 10 11 12 13 # SW-01 ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 10.0.10.254 0.0.0.0 network 10.0.100.254 0.0.0.0 network 172.200.5.2 0.0.0.0 network 172.200.5.13 0.0.0.0 interface Vlanif12 ospf cost 100 interface Vlanif34 ospf cost 1000
1 2 3 4 5 6 7 8 9 10 11 12 # SW0-02 ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 10.0.20.254 0.0.0.0 network 172.200.5.6 0.0.0.0 network 172.200.5.14 0.0.0.0 interface Vlanif34 ospf cost 1000 interface Vlanif56 ospf cost 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # AR-01 ospf 1 router-id 1.1.1.1 import-route static type 1 area 0.0.0.0 network 1.1.1.1 0.0.0.0 network 172.200.5.1 0.0.0.0 network 172.200.5.9 0.0.0.0 network 172.200.108.1 0.0.0.0 ip route-static 10.10.10.10 255.255.255.255 172.200.108.2 # 核心测试地址 ip route-static 20.20.20.20 255.255.255.255 172.200.108.2 # 核心测试地址 ip route-static 10.190.21.224 255.255.255.224 172.200.108.2 # iMaster NCE网段地址 ip route-static 172.201.5.0 255.255.255.0 172.200.108.2 # 总部互联地址 interface GigabitEthernet0/0/1 ospf cost 1000 interface GigabitEthernet0/0/3 ospf cost 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # AR-02 ospf 1 router-id 2.2.2.2 import-route static type 1 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 172.200.5.5 0.0.0.0 network 172.200.5.10 0.0.0.0 network 172.200.109.1 0.0.0.0 ip route-static 10.10.10.10 255.255.255.255 172.200.109.2 # 核心测试地址 ip route-static 20.20.20.20 255.255.255.255 172.200.109.2 # 核心测试地址 ip route-static 10.190.21.224 255.255.255.224 172.200.109.2 # iMaster NCE网段地址 ip route-static 172.201.5.0 255.255.255.0 172.200.109.2 # 总部互联地址 interface GigabitEthernet0/0/1 ospf cost 1000 interface GigabitEthernet0/0/3 ospf cost 100
总部路由配置
总部四台设备跑OSPF,实现总部网络的互通,防火墙安全策略记得放通
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # SW-Core interface LoopBack10 ip address 10.10.10.10 255.255.255.255 # 测试地址 interface LoopBack20 ip address 20.20.20.20 255.255.255.255 # 测试地址 ospf 1 router-id 7.7.7.7 area 0.0.0.0 network 10.10.10.10 0.0.0.0 network 20.20.20.20 0.0.0.0 network 10.190.21.224 0.0.0.31 network 172.201.5.1 0.0.0.0 network 172.201.5.5 0.0.0.0 network 172.201.5.9 0.0.0.0
1 2 3 4 5 6 7 8 9 # AC ospf 1 router-id 8.8.8.8 area 0.0.0.0 network 172.201.5.10 0.0.0.0 dhcp enable interface Vlanif200 dhcp select interface # 无线用户
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 # Core USG-01 acl number 2010 rule 5 permit source 10.0.10.0 0.0.0.255 rule 10 permit source 10.0.100.0 0.0.0.255 rule 15 permit source 172.200.5.0 0.0.0.3 acl number 2020 rule 5 permit source 10.0.20.0 0.0.0.255 rule 10 permit source 172.200.5.4 0.0.0.3 route-policy pre-10 permit node 10 if-match acl 2010 apply cost 100 route-policy pre-10 permit node 20 if-match acl 2020 apply cost 1000 route-policy pre-10 permit node 30 ip route-static 10.0.10.0 255.255.255.0 172.200.108.1 # 分部有线用户 ip route-static 10.0.20.0 255.255.255.0 172.200.108.1 # 分部生产网络 ip route-static 10.0.100.0 255.255.255.0 172.200.108.1 # 分部AP管理 ip route-static 172.200.5.0 255.255.255.252 172.200.108.1 # 分部设备互联 ip route-static 172.200.5.4 255.255.255.252 172.200.108.1 # 分部设备互联 ospf 1 router-id 5.5.5.5 import-route static type 1 route-policy pre-10 area 0.0.0.0 network 172.201.5.2 0.0.0.0 network 172.201.5.13 0.0.0.0 firewall zone trust add interface 10GE0/0/0 add interface GE0/0/0 add interface GE0/0/1 security-policy default action permit # 默认不放行就要去写详细的安全策略
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 # Core USG-02 acl number 2010 rule 5 permit source 10.0.10.0 0.0.0.255 rule 10 permit source 10.0.100.0 0.0.0.255 rule 15 permit source 172.200.5.0 0.0.0.3 acl number 2020 rule 5 permit source 10.0.20.0 0.0.0.255 rule 10 permit source 172.200.5.4 0.0.0.3 route-policy pre-20 permit node 10 if-match acl 2010 apply cost 1000 route-policy pre-20 permit node 20 if-match acl 2020 apply cost 100 route-policy pre-20 permit node 30 ip route-static 10.0.10.0 255.255.255.0 172.200.109.1 # 分部有线用户 ip route-static 10.0.20.0 255.255.255.0 172.200.109.1 # 分部生产网络 ip route-static 10.0.100.0 255.255.255.0 172.200.109.1 # 分部AP管理 ip route-static 172.200.5.0 255.255.255.252 172.200.109.1 # 分部设备互联 ip route-static 172.200.5.4 255.255.255.252 172.200.109.1 # 分部设备互联 ospf 1 router-id 6.6.6.6 import-route static type 1 route-policy pre-20 area 0.0.0.0 network 172.201.5.6 0.0.0.0 network 172.201.5.10 0.0.0.0 firewall zone trust add interface 10GE0/0/0 add interface GE0/0/0 add interface GE0/0/1 security-policy default action permit # 默认不放行就要去写详细的安全策略
AP上线 AP采用CAPWAP的DTLS隧道加密功能上线,使用常规的上线方式也行;配置CAPWAP隧道的DTLS加密功能
DTLS预共享密钥:此处配置为a1234567
FIT AP的管理参数(用户名/密码):此处配置为admin/Huawei@123
全局离线管理VAP的登录密码:此处配置为a1234567
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 # AC # 开局时,配置对端设备以不认证方式进行DTLS会话;在对端设备重新上线后,应立即关闭该功能,避免未授权对端设备接入网络 capwap dtls no-auth enable # 开启CAPWAP DTLS不认证 capwap dtls psk a1234567 # 配置DTLS预共享密钥 capwap source interface vlanif 99 # 配置capwap,依次输入FIT管理的用户名、密码(两次)、全局离线管理VAP的登录密码(两次) # 创建AP组、添加AP [AC] wlan [AC-wlan-view] ap auth-mode mac-auth [AC-wlan-view] quit [AC-wlan-view] ap-id 0 ap-mac xxxx-xxxx-xxxx [AC-wlan-ap-0] ap-group ap-group1 [AC-wlan-ap-0] ap-name AP1 [AC-wlan-ap-0] quit [AC-wlan-view] ap-id 1 ap-mac xxxx-xxxx-xxxx [AC-wlan-ap-1] ap-group ap-group1 [AC-wlan-ap-1] ap-name AP2 [AC-wlan-ap-1] quit # 上线验证 [AC] display ap all Total AP information: nor : normal [2] ExtraInfo : Extra information P : insufficient power supply ---------------------------------------------------------------------------------------------- ID MAC Name Group IP Type State STA Uptime ExtraInfo ---------------------------------------------------------------------------------------------- 0 xxxx-xxxx-xxxx AP1 ap-group1 10.0.100.X AP7052DE nor 0 2M:28S P # 都为normal状态 1 xxxx-xxxx-xxxx AP2 ap-group1 10.0.100.X AP7052DE nor 0 1M:45S P ---------------------------------------------------------------------------------------------- Total: 2
业务部署 有线终端802.1X接入认证 分部的有线用户在接入SW-01交换机,需要通过802.1X认证后,才能接入网络;此处的iMaster NCE作为RADIUS服务器使用,其他环境也可以自己搭建RADIUS服务器进行认证
交换机配置思路: 在SW-01接入交换机上配置RADIUS服务器模板、AAA方案、认证域、802.1X接入模板、配置认证模板、接口应用认证模板
iMaster NCE配置思路 :创建认证用户、添加准入设备、创建认证规则、创建授权结果(默认已有)创建授权规则、客户端测试
SW-01准入配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 # 配置认证服务器模板 radius-server template radius_huawei radius-server shared-key cipher Huawei@123 # 密钥 radius-server authentication 10.190.21.236 1812 # 认证 radius-server accounting 10.190.21.236 1813 # 计费 # 配置AAA方案 aaa authentication-scheme radius_huawei # 配置认证方案,方式为radius authentication-mode radius accounting-scheme radius_huawei # 配置计费方案,方式为radius accounting-mode radius accounting realtime 3 # 三分钟,与iMaster NCE上配置的一样 # 配置认证域 aaa domain huawei1 # 配置认证域 authentication-scheme radius_huawei # 指定认证方案 accounting-scheme radius_huawei # 指定计费方案 radius-server radius_huawei # 指定认证服务器 # 配置802.1X接入模板 dot1x-access-profile name radius_huawei # 802.1X接入模板默认采用EAP认证方式;需确保RADIUS服务器支持EAP协议,否则无法处理802.1X认证请求 dot1x authentication-method eap # 默认为EAP认证方式 # 配置认证模板 authentication-profile name radius_huawei dot1x-access-profile radius_huawei # 指定802.1X接入模板 access-domain huawei1 force # 指定认证域,强制认证 # 在接口下使能802.1X认证 interface GigabitEthernet0/0/1 # 在需要进行认证的接口下应用 authentication-profile radius_huawei # 指定认证模板
iMster-NCE准入配置
准入》准入资源》用户管理: 创建有线用户的802.1X用户与用户组,用户记得勾选802.1X选项
准入》准入资源》准入设备》创建准入设备: IP地址对应SW-01的IP地址(只要三层可达)、认证和授权的密钥为SW-01配置认证服务器模板所指定的密钥、计费周期也是SW-01配置计费方案时所指定的时间
准入》准入策略》认证授权》创建认证规则: 认证协议一定要勾选全部,否则在测试时PC机还要修改认证协议(默认使用EAP-PEAP)
准入》准入策略》认证授权》创建授权规则: 授权结果使用的是系统自带的允许接入,也可以根据需求自定义授权结果,当授权通过时执行
PC接入测试 :PC默认使用的是EAP PEAP
1 2 # SW-01测试 test-aaa 用户 密码 radius-template radius模板 认证协议 # PC认证不成功时通过这个命令测试,如果失败就根据提示检测配置或账号密码等信息
有线终端MAC接入认证 分部的有线用户在接入SW-02交换机(主要针对傻瓜客户端),需要通过MAC认证后,才能接入网络
坑: PC认证失败时,在其他配置没有错误的情况下,需要删除规则和授权规则后重新创建
交换机配置思路: 在SW-02接入交换机上配置RADIUS服务器模板、AAA方案、认证域、802.1X接入模板、配置认证模板、接口应用认证模板
iMaster NCE配置思路 :创建认证用户、添加准入设备、创建认证规则、创建授权结果(默认已有)创建授权规则、客户端测试
SW-02准入配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 # 配置认证服务器模板 radius-server template radius_huawei radius-server shared-key cipher Huawei@123 # 密钥 radius-server authentication 10.190.21.236 1812 # 认证 radius-server accounting 10.190.21.236 1813 # 计费 # 配置AAA方案 aaa authentication-scheme radius_huawei # 配置认证方案,方式为radius authentication-mode radius accounting-scheme radius_huawei # 配置计费方案,方式为radius accounting-mode radius accounting realtime 3 # 三分钟,与iMaster NCE上配置的一样 # 配置认证域 aaa domain huawei1 # 配置认证域 authentication-scheme radius_huawei # 指定认证方案 accounting-scheme radius_huawei # 指定计费方案 radius-server radius_huawei # 指定认证服务器 # 配置MAC接入模板 mac-access-profile name radius_huawei quit # 配置认证模板 authentication-profile name radius_huawei mac-access-profile radius_huawei # 指定MAC接入模板 access-domain huawei1 force # 指定认证域,强制认证 # 在接口下使能MAC认证 interface GigabitEthernet0/0/1 # 在需要进行认证的接口下应用 authentication-profile radius_huawei # 指定认证模板
iMster-NCE准入配置
准入》准入资源》用户管理: 创建有线用户的MAC账号
准入》准入资源》准入设备》创建准入设备: IP地址对应SW-02的IP地址(只要三层可达)、认证和授权的密钥为SW-02配置认证服务器模板所指定的密钥、计费周期也是SW-02配置计费方案时所指定的时间
准入》准入策略》认证授权》创建认证规则: 认证方式为MAC认证
准入》准入策略》认证授权》创建授权规则: 同上
1 # 在o3的实验环境中,要重启一下PC的网卡,重新获取地址
坑: 如果一直认证失败,需要删除授权规则和认证规则后,重新创建
无线终端802.1X接入认证 分部的有线用户在接入SW-01交换机,需要通过802.1X认证后,才能接入网络;此处的iMaster NCE作为RADIUS服务器使用,其他环境也可以自己搭建RADIUS服务器进行认证
AC配置思路: AC作为DHCP服务器为STA分配地址、配置802.1X认证、配置WLAN无线业务
iMaster NCE配置思路 :创建认证用户、添加准入设备、创建认证规则、创建授权结果(默认已有)创建授权规则、客户端测试
AC配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 # 配置DHCP服务器 dhcp enable interface Vlanif200 dhcp select interface # 配置RADIUS服务器模板 radius-server authorization 10.190.21.236 shared-key cipher Huawei@123 # 授权(不要遗漏) radius-server template radius_huawei radius-server shared-key cipher Huawei@123 # 密钥 radius-server authentication 10.190.21.236 1812 # 认证 radius-server accounting 10.190.21.236 1813 # 计费 # 配置AAA方案 aaa authentication-scheme radius_huawei # 配置认证方案,方式为radius authentication-mode radius accounting-scheme radius_huawei # 配置计费方案,方式为radius accounting-mode radius accounting realtime 3 # 三分钟,与iMaster NCE上配置的一样 # 配置802.1X接入模板 dot1x-access-profile name wlan-dot1x dot1x authentication-method eap # 配置认证模板 authentication-profile name wlan-dot1x dot1x-access-profile wlan-dot1x # 指定802.1X接入模板 authentication-scheme radius_huawei # 指定认证方案 accounting-scheme radius_huawei # 指定计费方案 radius-server radius_huawei # 指定认证服务器 # 配置无线业务 wlan security-profile name wlan-dot1x # 安全模板 security wpa2 dot1x aes # wpa2+dot1x+aes加密认证 ssid-profile name wlan-dot1x # ssid模板 ssid wlan-dot1x-05 vap-profile name wlan-dot1x # vap模板 forward-mode tunnel service-vlan vlan-id 200 security-profile wlan-dot1x ssid-profile wlan-dot1x authentication-profile wlan-dot1x # 指定认证模板 ap-group name ap-group1 # ap组引用vap模板 vap-profile wlan-dot1x wlan 1 radio all
iMster-NCE准入配置
准入》准入资源》用户管理: 创建无线用户的802.1X用户与用户组,用户记得勾选802.1X选项
准入》准入资源》准入设备》创建准入设备: IP地址对应AC的IP地址(只要三层可达)、认证和授权的密钥为AC配置认证服务器模板所指定的密钥、计费周期也是AC配置计费方案时所指定的时间
准入》准入策略》认证授权》创建认证规则: 认证协议要勾选全部
准入》准入策略》认证授权》创建授权规则: 接入方式WIFI
客户端测试: 系统支持的话可以使用下面的方法,不支持则需要同有线的802.1X类似方法进行接入
无线终端MAC接入认证 分部的无线用户在接入WIFI后,需要通过MAC认证后,才能接入网络
坑: PC认证失败时,在其他配置没有错误的情况下,需要删除规则和授权规则后重新创建
AC配置思路: AC作为DHCP服务器为STA分配地址、配置802.1X认证、配置WLAN无线业务
iMaster NCE配置思路 :创建认证用户、添加准入设备、创建认证规则、创建授权结果(默认已有)创建授权规则、客户端测试
AC配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 # 配置RADIUS服务器模板(前面dot1x配置过了,此处可省略) radius-server authorization 10.190.21.236 shared-key cipher Huawei@123 # 授权(不要遗漏) radius-server template radius_huawei radius-server shared-key cipher Huawei@123 # 密钥 radius-server authentication 10.190.21.236 1812 # 认证 radius-server accounting 10.190.21.236 1813 # 计费 # 配置AAA方案(前面dot1x配置过了,此处可省略) aaa authentication-scheme radius_huawei # 配置认证方案,方式为radius authentication-mode radius accounting-scheme radius_huawei # 配置计费方案,方式为radius accounting-mode radius accounting realtime 3 # 三分钟,与iMaster NCE上配置的一样 # 配置MAC接入模板 mac-access-profile name wlan-mac quit # 配置认证模板 authentication-profile name wlan-mac dot1x-access-profile wlan-mac # 指定 MAC接入模板 authentication-scheme radius_huawei # 指定认证方案 accounting-scheme radius_huawei # 指定计费方案 radius-server radius_huawei # 指定认证服务器 # 配置无线业务 wlan security-profile name wlan-mac # 安全模板 security open # 题目要求开放 ssid-profile name wlan-mac # ssid模板 ssid wlan-mac05 vap-profile name wlan-dot1x # vap模板 forward-mode tunnel service-vlan vlan-id 200 security-profile wlan-mac ssid-profile wlan-mac authentication-profile wlan-mac # 指定认证模板 ap-group name ap-group1 # ap组引用vap模板 vap-profile wlan-mac wlan 2 radio all
iMster-NCE准入配置
准入》准入资源》用户管理: 创建无线用户的802.1X用户与用户组,用户记得勾选802.1X选项
准入》准入资源》准入设备》创建准入设备: IP地址对应AC的IP地址(只要三层可达)、认证和授权的密钥为AC配置认证服务器模板所指定的密钥、计费周期也是AC配置计费方案时所指定的时间;前面802.1X配置过了,可省略
准入》准入策略》认证授权》创建认证规则: 认证方式为MAC认证
准入》准入策略》认证授权》创建授权规则: 同上
客户端测试:
业务部署-拓展 本块内容在o3实验中是没有的,属于自定义的拓展实验
有线终端免认证 参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100301670/c9fff8f6
假设SW-01在所有的接口都做了认证,但是AP属于傻瓜设备,所以需要通过MAC地址配置免认证(有很多种实现方法,免认证只是其中一种);在有线终端802.1X接入认证 的基础上继续做
1 2 3 4 5 6 7 8 9 10 # SW-01 mac-access-profile name radius_huawei # mac免认证也要做mac的认证模板 quit authentication-profile name radius_huawei # 配置认证模板 dot1x-access-profile radius_huawei # 指定802.1X接入模板 mac-access-profile radius_huawei # 指定MAC接入模板 access-domain huawei1 force # 指定认证域,强制认证 authentication dot1x-mac-bypass # MAC旁路认证
1 2 3 4 5 6 7 8 9 10 # SW-01:配置完成后在AC上看AP有没有掉线 aaa authentication-scheme ap_noauthen # 认证模板 authentication-mode none # 认证模式为空 domain ap_noauthen # 免认证域 authentication-scheme ap_noauthen domain ap_noauthen mac-authen force mac-address AP1的MAC地址 mask ffff-ffff-ffff # 免认证的AP domain ap_noauthen mac-authen force mac-address AP2的MAC地址 mask ffff-ffff-ffff
802.1X认证点在汇聚层 参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100247698/f7ad4ae6
上面实验中的认证点都在接入交换机SW-01和SW-02上,假设在网络规模很大的情况下,可以将认证点移动到汇聚交换机上,减少认证点数量且便于管理
以下为简化后的网络拓扑图,新增了一台接入交换机,将SW-01变成汇聚交换机,SW-01为认证点
1 2 3 4 5 6 7 8 9 10 11 12 13 # 接入交换机:此处接入交换机走二层,需配置802.1X报文透传 l2protocol-tunnel user-defined-protocol dot1x protocol-mac 0180-c200-0003 group-mac 0100-0000-0002 # 自定义策略,此处mac是固定的 int g0/0/1 # 接入用户和上联汇聚的接口都要配置透传 port link-type access port default vlan 10 l2protocol-tunnel user-defined-protocol dot1x enable int g0/0/7 port link-type hybrid port hybrid tagged vlan 10 20 100 # 假设接入交换机下游接了不同的业务vlan,只要能透传业务vlan到汇聚就行,也可以用trunk l2protocol-tunnel user-defined-protocol dot1x enable
1 2 3 4 5 6 # SW-01汇聚交换机:在下联接入交换机的接口上使能802.1X认证,其他配置不变 interface GigabitEthernet0/0/6 # 下联接入交换机 port link-type trunk port trunk allow vlan 10 20 100 # 假设接入交换机下游接了不同的业务vlan authentication-profile radius_huawei # 指定认证模板
有线终端混合接入认证 参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100213123/f0a4e23a
PC做802.1X认证,AP做MAC认证
1 2 3 4 5 mac-access-profile name radius_huawei # 在有线终端的802.1X基础上多创建mac认证 authentication-profile name radius_huawei dot1x-access-profile radius_huawei mac-access-profile radius_huawei # 指定mac认证和dot1x认证即可
逃生策略配置 当RADIUS服务器宕机后,所有设备均可以访问指定的资源,保证业务不受影响
坑: 当修改了authentication-profile后,需要在应用了这个配置文件的接口下,重新删除再添加才能生效
1 2 3 4 5 6 7 # 认证点使用默认的:统一认证模式 [SW-01]dis version Huawei Versatile Routing Platform Software VRP (R) software, Version 5.170 (S5731 V200R022C00SPC500) Copyright (C) 2000-2022 HUAWEI TECH Co., Ltd. HUAWEI S5731-H24P4XC Routing Switch uptime is 0 week, 0 day, 16 hours, 8 minutes
RADIUS服务器状态探测配置
参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100247691/f749e96c
设备通过RADIUS服务器状态探测功能感知RADIUS服务器的状态,在RADIUS服务器状态为Down时,使用户能够获取逃生权限;在RADIUS服务器状态恢复Up后,用户退出逃生权限,进行重认证
探测流程: 按以下配置内容为例,60秒探测一次RADIUS服务器状态,如果第一次探测为死亡,则再过60秒后再探测一次,第二次还是为死亡则正是标注RADIUS服务器为DOWN,后续的认证直接走逃生或备用服务器;同时60秒探测一次RADIUS服务器状态,收到正确响应时,就实时将RADIUS服务器标注为UP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # SW-01:对RADIUS服务器状态的探测节奏 radius-server template radius_server radius-server testuser username test password cipher xxxxx # 配置探测账号(账号密码无所谓是不是正确的,只要服务器有恢复就算存活) radius-server retransmit 3 timeout 5 # 配置radius认证请求报文的超时重传次数3次,超时时间5秒 radius-server detect-server interval 60 # 配置对Down状态的RADIUS服务器的自动探测周期,默认60秒(实验时可缩短时间) radius-server detect-server timeout 3 # 配置对Down状态的RADIUS服务器探测报文的超时等待时间,默认3秒 # SW-01:配置对RADIUS服务器死亡判定的条件(失败几次就判定为DOWN) radius-server dead-interval 5 # 连续5秒内收不到任何有效响应 ,默认5秒 radius-server dead-count 2 # 连续2次探测都失败 → 正式置为 Down,默认2次(实验时可修改还1) radius-server detect-cycle 2 # 上面2次失败必须在2个探测周期内发生(冗余校验) radius-server max-unresponsive-interval 300 # 如果300秒还活不过来,就停止探测,节省资源,默认300秒 # SW-Core 关闭与NCE的接口,来断开RADIUS服务器 interface XGigabitEthernet1/0/31 shutdown # SW-01:radius服务器状态一定要是down才能进行后续的逃生实验! display radius-server configuration template radius_server
方法1(推荐)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 undo authentication pre-authen-access enable # 关闭预连接 acl number 3000 # 在逃生后允许访问的策略控制 rule 5 deny ip destination 20.20.20.20 0 rule 10 permit ip aaa service-scheme radius_server_down # 配置服务方案,绑定acl 3000 acl-id 3000 authentication-profile name radius_huawei authentication event authen-server-down action authorize service-scheme radius_server_down # 当服务器宕机后执行这个服务方案 authentication event authen-server-up action re-authen # 当服务器恢复后进行重认证 interface GigabitEthernet0/0/1 # 接入端的接口,一定要重新配置下认证模板才能生效!!! undo authentication-profile # 去除认证模板 authentication-profile radius_huawei # 配置认证模板
当RADIUS服务器宕机后,客户端提示身份认证失败,并且无法获取到IP地址(不一定获取不到IP);但是在认证点上使用display access-user
可以看到客户端的认证状态为AAA-server-down
(一定要有这个或者客户端在RADIUS宕机前就已经是认证成功的状态)
这时候需要在客户端上把802.1X身份认证取消掉,才可以获取到IP地址,逃生成功
方法2
参考:https://support.huawei.com/enterprise/zh/doc/EDOC1000113971/b54e9ee
与方法1相同,当认证失败后无法获取IP地址,则需要将网卡的802.1X认证取消掉才能获取到IP地址
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ucl-group 10 name ucl_server_down aaa service-scheme server_down # 配置服务方案 ucl-group name ucl_server_down acl number 6001 # 在逃生后允许访问的策略控制 rule 5 deny ip source ucl-group name ucl_server_down destination 20.20.20.20 0 rule 10 permit ip source ucl-group name ucl_server_down traffic-filter inbound acl 6001 # 在系统视图下应用,只有配置该命令后基于ucl-group的规则才能生效 undo authentication pre-authen-access enable # 关闭预连接 authentication-profile name radius_huawei authentication event authen-server-down action service-scheme server_down # 当服务器宕机后执行这个服务方案 authentication event authen-server-up action re-authen # 当服务器恢复后进行重认证 interface GigabitEthernet0/0/1 # 接入端的接口,一定要重新配置下认证模板才能生效!!! undo authentication-profile # 去除认证模板 authentication-profile radius_huawei # 配置认证模板
方法3
参考:https://support.huawei.com/enterprise/zh/doc/EDOC1100301670/9a29af14
此方法相对方法1来说,少了一些安全策略的限制,但是可以通过修改逃生vlan的方式,并提前配置网络限制就能解决此问题
1 2 3 4 5 6 7 8 9 undo authentication pre-authen-access enable # 关闭预连接 authentication-profile name radius_huawei authentication event authen-server-down action authorize vlan 10 # 当服务器宕机后,用户使用vlan 10逃生 authentication event authen-server-up action re-authen # 当服务器恢复后进行重认证 interface GigabitEthernet0/0/1 # 接入端的接口,一定要重新配置下认证模板才能生效!!! undo authentication-profile # 去除认证模板 authentication-profile radius_huawei # 配置认证模板
假设需要有一个专门的vlan来用作逃生vlan,则连接客户端的接口要配置为hybrid接口,并放行原本的vlan和逃生vlan
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # 在本实验中,记得把逃生vlan宣告进OSPF并配置DHCP,同时在防火墙上要配置静态路由指向vlan 11 interface Vlanif11 # 逃生专用vlan ip address 10.0.11.254 255.255.255.0 ospf enable 1 area 0.0.0.0 dhcp select interface undo authentication pre-authen-access enable # 关闭预连接 authentication-profile name radius_huawei authentication event authen-server-down action authorize vlan 11 # 当服务器宕机后,用户使用vlan 11逃生 authentication event authen-server-up action re-authen # 当服务器恢复后进行重认证 interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 10 port hybrid tagged vlan 10 to 11 undo authentication-profile # 去除认证模板 authentication-profile radius_huawei # 配置认证模板
不使用逃生
当客户端数量庞大,且使用客户端的用户不会进行以上的操作时,可以将使能准入认证的接口删除准入,临时取消掉准入;等准入设备恢复后再重新应用
1 2 interface GigabitEthernet0/0/1 undo authentication-profile # 去除认证模板
失败方法
1 2 3 4 5 6 7 # 在本次实验中,当RADIUS服务器宕机后,PC无法逃生(PING不通网关) undo authentication pre-authen-access enable # 关闭预连接 aaa authentication-scheme radius_huawei authentication-mode radius none # 当RADIUS不可用时,自动切换到无认证模式
免认证可访问资源 在认证前可以被访问到的资源,比如认证服务器等等
https://support.huawei.com/enterprise/zh/doc/EDOC1000113971/b54e9ee
业务优化 射频调优 1 2 3 4 5 6 7 8 9 10 11 # 配置射频调优功能,通过AC自动为AP分配最佳工作信道和功率 [AC] wlan [AC-wlan-view] ap-group name ap-group1 [AC-wlan-ap-group-ap-group1] radio 0 [AC-wlan-group-radio-ap-group1/0] calibrate auto-channel-select enable # 自动选择信道 [AC-wlan-group-radio-ap-group1/0] calibrate auto-txpower-select enable # 自动选择功率 [AC-wlan-group-radio-ap-group1/0] quit [AC-wlan-ap-group-ap-group1] radio 1 [AC-wlan-group-radio-ap-group1/1] calibrate auto-channel-select enable [AC-wlan-group-radio-ap-group1/1] calibrate auto-txpower-select enable
后续补充web配置截图
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 # 配置空口扫描 [AC] wlan [AC-wlan-view] air-scan-profile name wlan-airscan # 配置空口扫描 [AC-wlan-air-scan-prof-wlan-airscan] scan-channel-set country-channel # 设置 空口扫描信道集合为AP对应国家码支持的所有信道 [AC-wlan-air-scan-prof-wlan-airscan] scan-period 80 # 扫描持续时间毫秒 [AC-wlan-air-scan-prof-wlan-airscan] scan-interval 80000 # 扫描间隔 [AC-wlan-air-scan-prof-wlan-airscan] quit [AC-wlan-view] radio-2g-profile name wlan-radio2g # 配置2G射频模板 [AC-wlan-radio-2g-prof-wlan-radio2g] air-scan-profile wlan-airscan # 引用空口扫描模板 [AC-wlan-radio-2g-prof-wlan-radio2g] quit [AC-wlan-view] radio-5g-profile name wlan-radio5g # 配置5G射频模板 [AC-wlan-radio-5g-prof-wlan-radio5g] air-scan-profile wlan-airscan [AC-wlan-radio-5g-prof-wlan-radio5g] quit [AC-wlan-view] ap-group name ap-group1 [AC-wlan-ap-group-ap-group1] radio-5g-profile wlan-radio5g radio 1 # 在ap组中引用射频模板 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-ap-group-ap-group1] radio-2g-profile wlan-radio2g radio 0 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-ap-group-ap-group1] quit [AC-wlan-view] calibrate manual startup # 立即触发射频调优功能 Warning: The operation may cause business interruption, continue?[y/n]:y
验证: 等待调优结束后,通过命令可查询到由于调优导致的信道或者是功率切换记录;调优后有两台AP的工作信道已错开,同时信道利用率普遍较低
1 2 display channel switch-record calibrate # 查看设备信道切换的记录信息 display radio all # 查看信道信息
智能漫游 配置智能漫游功能,并通过调整智能漫游的参数,引导终端(特别是粘性终端)漫游
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [AC] wlan [AC-wlan-view] rrm-profile name wlan-rrm # 配置RRM模板 [AC-wlan-rrm-prof-wlan-rrm] smart-roam enable # 开启智能漫游 [AC-wlan-rrm-prof-wlan-rrm] smart-roam roam-threshold check-snr # 漫游触发方式:基于终端信噪比 [AC-wlan-rrm-prof-wlan-rrm] smart-roam roam-threshold snr 15 # 触发门限值:15dB [AC-wlan-rrm-prof-wlan-rrm] quit [AC-wlan-view] radio-2g-profile name wlan-radio2g # 配置2G射频模板 [AC-wlan-radio-2g-prof-wlan-radio2g] rrm-profile wlan-rrm # 引用RRM模板 [AC-wlan-radio-2g-prof-wlan-radio2g] quit [AC-wlan-view] radio-5g-profile name wlan-radio5g # 配置5G射频模板 [AC-wlan-radio-5g-prof-wlan-radio5g] rrm-profile wlan-rrm [AC-wlan-radio-5g-prof-wlan-radio5g] quit [AC-wlan-view] ap-group name ap-group1 [AC-wlan-ap-group-ap-group1] radio-5g-profile wlan-radio5g radio 1 # 在ap组中引用射频模板;前面已经配置过了,可省略 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-ap-group-ap-group1] radio-2g-profile wlan-radio2g radio 0 Warning: This action may cause service interruption. Continue?[Y/N]y [AC-wlan-ap-group-ap-group1] quit
QoS
VLAN 20的业务为重要业务,需确保最优转发,因此需要在路由器上配置QoS服务策略,将流入路由器的流量根据业务网段分别重新标记不同的DSCP优先级,并在路由器的出口上根据流量不同的DSCP值来进行带宽保证
业务名称
网段
ACL编号
办公业务
10.0.10.0/24
3001
生产业务
10.0.20.0/24
3002
其余业务
3003
业务名称
VLAN值
DSCP值
办公业务
10
AF
生产业务
20
EF
其余业务
其余VLAN
BE
流量抓取
1 2 3 4 5 6 7 8 # AR-01/AR-02:创建ACL抓取办公、生产、其他流量 acl 3001 rule permit ip source 10.0.10.0 0.0.0.255 acl 3002 rule permit ip source 10.0.20.0 0.0.0.255 acl 3002 rule permit ip
入方向QoS策略
1 2 3 4 5 6 7 8 # AR-01/AR-02:创建入方向流分类 traffic classifier QOSIN-CLASS-Office if-match acl 3001 traffic classifier QOSIN-CLASS-Service if-match acl 3002 traffic classifier QOSIN-CLASS-DEFAULT if-match acl 3003
1 2 3 4 5 6 7 # AR-01/AR-02:创建入方向流行为 traffic behavior QOSIN-CLASS-Office remark dscp af21 traffic behavior QOSIN-CLASS-Service remark dscp ef traffic behavior QOSIN-CLASS-DEFAULT
1 2 3 4 5 6 # AR-01/AR-02:创建入方向流策略 traffic policy QOSIN-MARKING classifier QOSIN-CLASS-Office behavior QOSIN-CLASS-Office classifier QOSIN-CLASS-Service behavior QOSIN-CLASS-Service classifier QOSIN-CLASS-DEFAULT behavior QOSIN-CLASS-DEFAULT
1 2 3 4 5 6 # AR-01/AR-02:在入接口应用流策略 interface GigabitEthernet 0/0/1 traffic-policy QOSIN-MARKING inbound interface GigabitEthernet 0/0/3 traffic-policy QOSIN-MARKING inbound
出方向QoS
1 2 3 4 5 6 7 8 # AR-01/AR-02:创建出方向流分类 traffic classifier QOSOUT-CLASS-Office if-match acl 3001 traffic classifier QOSOUT-CLASS-Service if-match acl 3002 traffic classifier QOSOUT-CLASS-DEFAULT if-match acl 3003
1 2 3 4 5 6 7 8 # AR-01/AR-02:创建出方向流行为 traffic behavior QOSOUT-CLASS-Office queue af bandwidth 1494 traffic behavior QOSOUT-CLASS-Service queue ef bandwidth 160 cbs 4000 traffic behavior QOSOUT-CLASS-DEFAULT queue af bandwidth 748
1 2 3 4 5 6 # AR-01/AR-02:创建出方向流策略 traffic policy QOSOUT-MARKING-10M classifier QOSOUT-CLASS-Office behavior QOSIN-CLASS-Office classifier QOSOUT-CLASS-Service behavior QOSIN-CLASS-Service classifier QOSOUT-CLASS-DEFAULT behavior QOSIN-CLASS-DEFAULT
1 2 3 4 # AR-01/AR-02:在出接口应用流策略 interface GigabitEthernet 0/0/2 traffic-policy QOSOUT-MARKING-10M outbound
业务隔离
因SW-01和SW-02为三层交换机,通过OSPF协议已将分部内网打通,无法做到IP网段隔离。因此在SW-01和SW-02的接口上配置ACL,实现生产和办公业务的IP网段隔离
ACL编号
源网段
目的网段
3001
10.0.10.0/24
10.0.20.0/24
3002
10.0.20.0/24
10.0.10.0/24
1 2 3 4 5 6 7 8 # SW-01 acl 3010 rule deny ip source 10.0.10.0 0.0.0.255 destination 10.0.20.0 0.0.0.255 rule permit ip interface GigabitEthernet0/0/1 traffic-filter inbound acl 3010
1 2 3 4 5 6 7 8 # SW-02 acl 3020 rule deny ip source 10.0.10.0 0.0.0.255 destination 10.0.20.0 0.0.0.255 rule permit ip interface GigabitEthernet0/0/1 traffic-filter inbound acl 3020