华为配置WAPI-PSK安全策略实验

2024-03-19 04:52

本文主要是介绍华为配置WAPI-PSK安全策略实验,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

配置WAPI-PSK安全策略示例

组网图形

图1 配置WAPI-PSK安全策略组网图
  • 配置流程
  • 组网需求
  • 配置思路
  • 配置注意事项
  • 操作步骤
  • 配置文件
配置流程

WLAN不同的特性和功能需要在不同类型的模板下进行配置和维护,这些模板统称为WLAN模板,如域管理模板、射频模板、VAP模板、AP系统模板、AP有线口模板、WIDS模板。当用户在配置WLAN业务功能时,需要在对应功能的WLAN模板中进行参数配置,配置完成后,须将此模板引用到AP组或AP中,配置才会自动下发到RU,进而配置的功能在RU上生效。由于模板之间是存在相互引用关系的,因此在用户配置过程中,需要提前了解各个模板之间存在的逻辑关系。模板的逻辑关系和基本配置流程请参见WLAN业务配置流程

组网需求

某小区物业为部分业主提供WLAN网络资源,使其可以在家中随时随地访问Internet。如图1所示,其中RU部署在住户的屋内,直接与中心AP连接,提供SSID为wlan-net的WLAN接入服务,STA自动获取IP地址。

由于无线网络开放性的特点,业务数据存在安全风险。用户对WLAN网络的安全性要求不高,不需要使用额外的认证系统,如果用户的WLAN终端设备都支持WAPI,此时可以使用WAPI(预共享密钥认证)的安全策略,基于时间定时更新单播和组播密钥,保证业务数据的安全。

配置注意事项

建议在与RU直连的设备接口上配置端口隔离,如果不配置端口隔离,可能会在VLAN内形成大量不必要的广播报文,导致网络阻塞,影响用户体验。

操作步骤
  1. 配置中心AP,使RU与中心AP之间能够传输CAPWAP报文

    # 配置中心AP,将接口GE0/0/1加入VLAN100(管理VLAN)。

    <span style="color:#333333"><span style="background-color:#dddddd"><HUAWEI> <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b246945475190907">system-view</strong>
    [HUAWEI] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1089173424190907">sysname AP</strong>
    [AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b2078307907190907">vlan batch 100 101</strong>
    [AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1480089006190907">interface gigabitethernet 0/0/1</strong>
    [AP-GigabitEthernet0/0/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b538052571190907">port link-type trunk</strong>
    [AP-GigabitEthernet0/0/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1791398723190907">port trunk pvid vlan 100</strong>
    [AP-GigabitEthernet0/0/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1624351834190907">port trunk allow-pass vlan 100</strong>
    [AP-GigabitEthernet0/0/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b398509587190907">quit</strong></span></span>
  2. 配置中心AP与上层网络设备互通

    根据实际组网情况在中心AP上行口配置业务VLAN透传,和上行网络设备互通。

    # 配置中心AP上行接口GE0/0/24加入VLAN101(业务VLAN)。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1855267388190907">interface gigabitethernet 0/0/24</strong>
    [AP-GigabitEthernet0/0/24] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b523367798190907">port link-type trunk</strong>
    [AP-GigabitEthernet0/0/24] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1913301035190907">port trunk allow-pass vlan 101</strong>
    [AP-GigabitEthernet0/0/24] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1620907968190907">quit</strong></span></span>
  3. 配置中心AP作为DHCP服务器,为STA和RU分配IP地址

    # 配置基于接口地址池的DHCP服务器,其中,VLANIF100接口为RU提供IP地址,VLANIF101为STA提供IP地址。

    DNS服务器地址请根据实际需要配置。常用配置方法如下:
    • 接口地址池场景,需要在VLANIF接口视图下执行命令dhcp server dns-list ip-address &<1-8>。
    • 全局地址池场景,需要在IP地址池视图下执行命令dns-list ip-address &<1-8>。
    <span style="color:#333333"><span style="background-color:#dddddd">[AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b60356096190907">dhcp enable</strong>
    [AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b782788619190907">interface vlanif 100</strong>
    [AP-Vlanif100] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1439029025190907">ip address 10.23.100.1 24</strong>
    [AP-Vlanif100] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b178519295190907">dhcp select interface</strong>
    [AP-Vlanif100] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b894438072190907">quit</strong>
    [AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1239236207190907">interface vlanif 101</strong>
    [AP-Vlanif101] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1000697080190907">ip address 10.23.101.1 24</strong>
    [AP-Vlanif101] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1187620607190907">dhcp select interface</strong>
    [AP-Vlanif101] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b854045514190907">quit</strong></span></span>
  4. 配置RU上线

    # 创建AP组,用于将相同配置的RU都加入同一AP组中。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1944526303190907">wlan</strong>
    [AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1492569438190907">ap-group name ap-group1</strong>
    [AP-wlan-ap-group-ap-group1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b211419057190907">quit</strong></span></span>

    # 创建域管理模板,在域管理模板下配置中心AP的国家码并在AP组下引用域管理模板。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b852537192190907">regulatory-domain-profile name domain1</strong>
    [AP-wlan-regulate-domain-domain1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1230439612190907">country-code cn</strong>
    [AP-wlan-regulate-domain-domain1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1906410096190907">quit</strong>
    [AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1769406750190907">ap-group name ap-group1</strong>
    [AP-wlan-ap-group-ap-group1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b918729171190907">regulatory-domain-profile domain1</strong>
    Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and reset the AP. Continu e?[Y/N]:<strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_zh-cn_task_0175818441_b2083244362190906">y</strong>  
    [AP-wlan-ap-group-ap-group1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b780916136190907">quit</strong>
    [AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1180214892190907">quit</strong></span></span>
    # 配置中心AP上RU的管理VLAN。
    <span style="color:#333333"><span style="background-color:#dddddd">[AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1076648720190907">management-vlan 100</strong></span></span>
    # 在中心AP上离线导入RU,并将RU加入AP组“ap-group1”中。假设RU的MAC地址为60de-4476-e360,并且根据RU的部署位置为RU配置名称,便于从名称上就能够了解RU的部署位置。例如MAC地址为60de-4476-e360的RU部署在1号区域,命名此RU为area_1。

    ap auth-mode命令缺省情况下为MAC认证,如果之前没有修改其缺省配置,可以不用执行ap auth-mode mac-auth

    举例中使用的RU为R240D,具有射频0和射频1两个射频。R240D的射频0为2.4GHz射频,射频1为5GHz射频。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1001360617190907">wlan</strong>
    [AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1378045124190907">ap auth-mode mac-auth</strong>
    [AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1974212889190907">ap-id 1 ap-mac 60de-4476-e360</strong>
    [AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b159842295190907">ap-name area_1</strong>
    [AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1747769399190907">ap-group ap-group1</strong>
    Warning: This operation may cause AP reset. If the country code changes, it will clear channel, power and antenna gain configuration s of the radio, Whether to continue? [Y/N]:<strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_zh-cn_task_0175818441_b1248067968190906">y</strong>  
    [AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b727475792190907">quit</strong></span></span>

    # 将RU上电后,当执行命令display ap all查看到RU的“State”字段为“nor”时,表示RU正常上线。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1436775027190907">display ap all</strong>
    Total AP information:  
    nor  : normal          [1]  
    Extra information:  
    P  : insufficient power supply  
    ----------------------------------------------------------------------------------------------------  
    ID   MAC            Name   Group     IP            Type                State STA Uptime      ExtraInfo  
    ----------------------------------------------------------------------------------------------------  
    1    00e0-fc76-e360 area_1 ap-group1 10.23.100.254 R240D               <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_zh-cn_task_0175818441_b2761129184119">nor</strong>   0   10S         -  
    ----------------------------------------------------------------------------------------------------  
    Total: 1</span></span>
  5. 配置WLAN业务参数

    # 创建名为“wlan-security”的安全模板,并配置WAPI-PSK安全策略,指定单播密钥和组播密钥均基于时间更新,更新间隔均为20000秒。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong>security-profile name wlan-security</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>security wapi psk pass-phrase 1234567@</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>wapi usk key-update time-based</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>wapi msk key-update time-based</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>wapi usk-update-interval 20000</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>wapi msk-update-interval 20000</strong>
    [AP-wlan-sec-prof-wlan-security] <strong>quit</strong></span></span>

    # 创建名为“wlan-ssid”的SSID模板,并配置SSID名称为“wlan-net”。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong>ssid-profile name wlan-ssid</strong>
    [AP-wlan-ssid-prof-wlan-ssid] <strong>ssid wlan-net</strong>
    [AP-wlan-ssid-prof-wlan-ssid] <strong>quit</strong></span></span>

    # 创建名为“wlan-vap”的VAP模板,配置业务VLAN,并且引用安全模板和SSID模板。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong>vap-profile name wlan-vap</strong>
    [AP-wlan-vap-prof-wlan-vap] <strong>service-vlan vlan-id 101</strong>
    [AP-wlan-vap-prof-wlan-vap] <strong>security-profile wlan-security</strong>
    [AP-wlan-vap-prof-wlan-vap] <strong>ssid-profile wlan-ssid</strong>
    [AP-wlan-vap-prof-wlan-vap] <strong>quit</strong></span></span>

    # 配置AP组引用VAP模板“wlan-vap”,RU上射频0和射频1都使用VAP模板“wlan-vap”的配置。

    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong>ap-group name ap-group1</strong>
    [AP-wlan-ap-group-ap-group1] <strong>vap-profile wlan-vap wlan 1 radio all</strong>
    [AP-wlan-ap-group-ap-group1] <strong>quit</strong></span></span>
  6. 配置RU射频的信道和功率

    射频的信道和功率自动调优功能默认开启,如果不关闭此功能则会导致手动配置不生效。举例中RU射频的信道和功率仅为示例,实际配置中请根据RU的国家码和网规结果进行配置。

    # 关闭RU射频0的信道和功率自动调优功能,并配置RU射频0的信道和功率。
    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-view] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b173878809190907">ap-id 1</strong>
    [AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1068015866190907">radio 0</strong>
    [AP-wlan-radio-1/0] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1156070834190907">calibrate auto-channel-select disable</strong>
    [AP-wlan-radio-1/0] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b10416957190907">calibrate auto-txpower-select disable</strong>
    [AP-wlan-radio-1/0] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b322716985190907">channel 20mhz 6</strong>
    Warning: This action may cause service interruption. Continue?[Y/N]<strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_zh-cn_task_0175818441_b1479588541190906">y</strong> 
    [AP-wlan-radio-1/0] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1212113758190907">eirp 127</strong>
    [AP-wlan-radio-1/0] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1397201252190907">quit</strong></span></span>
    # 关闭RU射频1的信道和功率自动调优功能,并配置RU射频1的信道和功率。
    <span style="color:#333333"><span style="background-color:#dddddd">[AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b589503841190907">radio 1</strong>
    [AP-wlan-radio-1/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1533334760190907">calibrate auto-channel-select disable</strong>
    [AP-wlan-radio-1/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b778771945190907">calibrate auto-txpower-select disable</strong>
    [AP-wlan-radio-1/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b898029763190907">channel 20mhz 149</strong>
    Warning: This action may cause service interruption. Continue?[Y/N]<strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_zh-cn_task_0175818441_b1479588541190906_1">y</strong> 
    [AP-wlan-radio-1/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b2034558345190907">eirp 127</strong>
    [AP-wlan-radio-1/1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1714376074190907">quit</strong>
    [AP-wlan-ap-1] <strong id="ZH-CN_TASK_0176919479__zh-cn_task_0175818464_b1628278207190907">quit</strong></span></span>
  7. 验证配置结果

    • 完成配置后,用户可通过手机终端搜索到SSID为wlan-net的无线网络。
    • 用户关联到无线网络上后,手机终端能够被分配相应的IP地址,用户输入预共享密钥可以访问无线网络。
配置文件

中心AP的配置文件

<span style="color:#333333"><span style="background-color:#dddddd">#sysname AP
#
vlan batch 100 to 101 
#
dhcp enable
#
interface Vlanif100ip address 10.23.100.1 255.255.255.0dhcp select interface
#
interface Vlanif101ip address 10.23.101.1 255.255.255.0dhcp select interface
#
interface GigabitEthernet0/0/1port link-type trunkport trunk pvid vlan 100port trunk allow-pass vlan 100 to 101
#
interface GigabitEthernet0/0/24port link-type trunkport trunk allow-pass vlan 101
#
management-vlan 100
#
wlansecurity-profile name wlan-securitysecurity wapi psk pass-phrase %^%#cWul9=qe~"#{UzRlWz["^Gzo<X/k8-21m37N4;n'%^%#wapi usk-update-interval 20000wapi msk-update-interval 20000ssid-profile name wlan-ssidssid wlan-netvap-profile name wlan-vapservice-vlan vlan-id 101ssid-profile wlan-ssidsecurity-profile wlan-securityregulatory-domain-profile name domain1ap-group name ap-group1regulatory-domain-profile domain1radio 0vap-profile wlan-vap wlan 1radio 1vap-profile wlan-vap wlan 1ap-id 1 type-id 55 ap-mac 60de-4476-e360 ap-sn 210235554710CB000042ap-name area_1ap-group ap-group1radio 0channel 20mhz 6eirp 127calibrate auto-channel-select disable  calibrate auto-txpower-select disableradio 1channel 20mhz 149eirp 127calibrate auto-channel-select disable  calibrate auto-txpower-select disable
#
return
</span></span>

这篇关于华为配置WAPI-PSK安全策略实验的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/824849

相关文章

SpringBoot3.4配置校验新特性的用法详解

《SpringBoot3.4配置校验新特性的用法详解》SpringBoot3.4对配置校验支持进行了全面升级,这篇文章为大家详细介绍了一下它们的具体使用,文中的示例代码讲解详细,感兴趣的小伙伴可以参考... 目录基本用法示例定义配置类配置 application.yml注入使用嵌套对象与集合元素深度校验开发

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖

SpringBoot基于配置实现短信服务策略的动态切换

《SpringBoot基于配置实现短信服务策略的动态切换》这篇文章主要为大家详细介绍了SpringBoot在接入多个短信服务商(如阿里云、腾讯云、华为云)后,如何根据配置或环境切换使用不同的服务商,需... 目录目标功能示例配置(application.yml)配置类绑定短信发送策略接口示例:阿里云 & 腾

如何为Yarn配置国内源的详细教程

《如何为Yarn配置国内源的详细教程》在使用Yarn进行项目开发时,由于网络原因,直接使用官方源可能会导致下载速度慢或连接失败,配置国内源可以显著提高包的下载速度和稳定性,本文将详细介绍如何为Yarn... 目录一、查询当前使用的镜像源二、设置国内源1. 设置为淘宝镜像源2. 设置为其他国内源三、还原为官方

CentOS7更改默认SSH端口与配置指南

《CentOS7更改默认SSH端口与配置指南》SSH是Linux服务器远程管理的核心工具,其默认监听端口为22,由于端口22众所周知,这也使得服务器容易受到自动化扫描和暴力破解攻击,本文将系统性地介绍... 目录引言为什么要更改 SSH 默认端口?步骤详解:如何更改 Centos 7 的 SSH 默认端口1

Maven的使用和配置国内源的保姆级教程

《Maven的使用和配置国内源的保姆级教程》Maven是⼀个项目管理工具,基于POM(ProjectObjectModel,项目对象模型)的概念,Maven可以通过一小段描述信息来管理项目的构建,报告... 目录1. 什么是Maven?2.创建⼀个Maven项目3.Maven 核心功能4.使用Maven H

SpringBoot多数据源配置完整指南

《SpringBoot多数据源配置完整指南》在复杂的企业应用中,经常需要连接多个数据库,SpringBoot提供了灵活的多数据源配置方式,以下是详细的实现方案,需要的朋友可以参考下... 目录一、基础多数据源配置1. 添加依赖2. 配置多个数据源3. 配置数据源Bean二、JPA多数据源配置1. 配置主数据

Spring 基于XML配置 bean管理 Bean-IOC的方法

《Spring基于XML配置bean管理Bean-IOC的方法》:本文主要介绍Spring基于XML配置bean管理Bean-IOC的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一... 目录一. spring学习的核心内容二. 基于 XML 配置 bean1. 通过类型来获取 bean2. 通过

如何使用Nginx配置将80端口重定向到443端口

《如何使用Nginx配置将80端口重定向到443端口》这篇文章主要为大家详细介绍了如何将Nginx配置为将HTTP(80端口)请求重定向到HTTPS(443端口),文中的示例代码讲解详细,有需要的小伙... 目录1. 创建或编辑Nginx配置文件2. 配置HTTP重定向到HTTPS3. 配置HTTPS服务器

SpringBoot中配置Redis连接池的完整指南

《SpringBoot中配置Redis连接池的完整指南》这篇文章主要为大家详细介绍了SpringBoot中配置Redis连接池的完整指南,文中的示例代码讲解详细,具有一定的借鉴价值,感兴趣的小伙伴可以... 目录一、添加依赖二、配置 Redis 连接池三、测试 Redis 操作四、完整示例代码(一)pom.