华为配置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 Vlanif100
 ip address 10.23.100.1 255.255.255.0
 dhcp select interface
#
interface Vlanif101
 ip address 10.23.101.1 255.255.255.0
 dhcp select interface
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk pvid vlan 100
 port trunk allow-pass vlan 100 to 101
#
interface GigabitEthernet0/0/24
 port link-type trunk
 port trunk allow-pass vlan 101
#
management-vlan 100
#
wlan
 security-profile name wlan-security
  security wapi psk pass-phrase %^%#cWul9=qe~"#{UzRlWz["^Gzo<X/k8-21m37N4;n'%^%#
  wapi usk-update-interval 20000
  wapi msk-update-interval 20000
 ssid-profile name wlan-ssid
  ssid wlan-net
 vap-profile name wlan-vap
  service-vlan vlan-id 101
  ssid-profile wlan-ssid
  security-profile wlan-security
 regulatory-domain-profile name domain1
 ap-group name ap-group1
  regulatory-domain-profile domain1
  radio 0
   vap-profile wlan-vap wlan 1
  radio 1
   vap-profile wlan-vap wlan 1
 ap-id 1 type-id 55 ap-mac 60de-4476-e360 ap-sn 210235554710CB000042
  ap-name area_1
  ap-group ap-group1
  radio 0
   channel 20mhz 6
   eirp 127
   calibrate auto-channel-select disable  
   calibrate auto-txpower-select disable
  radio 1
   channel 20mhz 149
   eirp 127
   calibrate auto-channel-select disable  
   calibrate auto-txpower-select disable
#
return
</span></span>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.kler.cn/a/273293.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

MVC接收请求教程

mvc接收各种请求 1-环境搭建 1.1-准备apifox发送请求 1.2-项目搭建 ①创建Web骨架的Maven项目 ​ --打开2023-IDEA &#xff0c;选择New Project ​ --选择Maven Archetype ​ --注意点&#xff1a;Catalog默认就行了 ​ --Archetype选择webapp ​ --JDK跟着黑马敲最好…

MS17_010 漏洞利用与安全加固

文章目录 环境说明1 MS17_010 简介2 MS17_010 复现过程3 MS17_010 安全加固 环境说明 渗透机操作系统&#xff1a;kali-linux-2024.1-installer-amd64漏洞复现操作系统: cn_windows_7_professional_with_sp1_x64_dvd_u_677031 1 MS17_010 简介 MS17_010 漏洞后门利用程序 Eter…

跳绳计数,YOLOV8POSE

跳绳计数&#xff0c;YOLOV8POSE 通过计算腰部跟最初位置的上下波动&#xff0c;计算跳绳的次数

VSCode + PicGo + Github 实现markdown图床管理

目录 PicGo客户端VSvode插件 PicGo客户端 PicGo 是一个图片上传管理工具 官网&#xff1a;https://molunerfinn.com/PicGo/ github图传使用说明&#xff1a;https://picgo.github.io/PicGo-Doc/zh/guide/config.html#GitHub图床 步骤&#xff1a; 1、创建一个github公开仓库…

Vue+SpringBoot打造数据可视化的智慧河南大屏

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块三、系统展示四、核心代码4.1 数据模块 A4.2 数据模块 B4.3 数据模块 C4.4 数据模块 D4.5 数据模块 E 五、免责说明 一、摘要 1.1 项目介绍 基于JAVAVueSpringBootMySQL的数据可视化的智慧河南大屏&#xff0c;包含了GDP、…

单目相机标定实现--张正友标定法

文章目录 一&#xff1a;相机坐标系&#xff0c;像素平面坐标系&#xff0c;世界坐标系&#xff0c;归一化坐标系介绍1&#xff1a;概述公式 二:实现1&#xff1a;整体流程4&#xff1a;求出每张图像的单应性矩阵并用LMA优化5&#xff1a;求解理想无畸变情况下的摄像机的内参数…

基于Spring Boot的拍卖管理系统设计与实现

摘 要 随着社会的发展&#xff0c;系统的管理形势越来越严峻。越来越多的用户利用互联网获得信息&#xff0c;但各种信息鱼龙混杂&#xff0c;信息真假难以辨别。为了方便用户更好的获得信息&#xff0c;因此&#xff0c;设计一种安全高效的拍卖管理系统极为重要。 为设计一个…

Css提高——Css3的新增选择器

目录 1、Css3新增选择器列举 2、属性选择器 2.1、语法 2.2、代码&#xff1a; 2.3、效果图 3、结构伪类选择器 3.1、语法 3.2、代码 3.3、效果图 3.4、nth&#xff1a;child&#xff08;n&#xff09;的用法拓展 nth-child&#xff08;n&#xff09;与nth-of-type&#x…

mac npm install 很慢或报错

npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED npm ERR! request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expired 1、取消ssl验证&#xff1a; npm config set strict-ssl false 修改后一般就可以了&#xff0c;…

Nadaraya-Watson核回归

目录 基本原理 ​编辑 核函数的选择 带宽的选择 特点 应用 与注意力机制的关系 参考内容 在统计学中&#xff0c;核回归是一种估计随机变量的条件期望的非参数技术。目标是找到一对随机变量 X 和 Y 之间的非线性关系。 在任何非参数回归中&#xff0c;变量 Y 相对于变量…

nvm安装和使用保姆级教程(详细)

一、 nvm是什么 &#xff1a; nvm全英文也叫node.js version management&#xff0c;是一个nodejs的版本管理工具。nvm和npm都是node.js版本管理工具&#xff0c;为了解决node.js各种版本存在不兼容现象可以通过它可以安装和切换不同版本的node.js。 二、卸载之前安装的node: …

微服务技术栈SpringCloud+RabbitMQ+Docker+Redis+搜索+分布式(五):分布式搜索 ES-下

文章目录 一、数据聚合1.1 聚合种类1.2 DSL实现聚合1.3 RestAPI实现聚合1.4 演示&#xff1a;多条件聚合 二、自动补全2.1 拼音分词器2.2 自定义分词器2.3 DSL自动补全查询2.5 实现酒店搜索框自动补全2.5.1 修改酒店索引库数据结构2.5.2 RestAPI实现自动补全查询2.5.3 实战 三、…

Kafka:分布式消息队列

1. 简介 介绍 Kafka 的概述、优势和劣势&#xff0c;以及应用场景。 2. 基本概念 2.1 架构 一个典型的 Kafka 体系架构包括若干 Producer、若干Broker、若干 Consumer&#xff0c;以及一个ZooKeeper集群。 ZooKeeper是Kafka用来负责集群元数据的管理、控制器的选举等操作的…

【2023蓝桥杯】刷题笔记(C语言)

1、字符串包含最多的字符及其个数 #include<stdio.h> int main() {int i;char arr[1000] { 0 };//定义字符串数组arr&#xff0c;初始化为0gets(arr);//从键盘输入字符串给arr// printf("%s\n",arr);//输出字符串数组// for(i0;i<5;i){// printf("%…

关于 闰年 的小知识,为什么这样判断闰年

闰年的规定&#xff1a; 知道了由来&#xff0c;我们就可以写程序来判断&#xff1a; #include <stdio.h> int main() {int year, leap;scanf("%d",&year);if((year%4 0 && year%100 ! 0) || year%400 0)leap 1;else leap 0;if(leap) printf(…

centos破解root密码以及如何防止他人破解root密码

目录 破解root密码 服务器重启 1.再重启页面上下选择第一个按e进入内核编辑模式 2.找到linux16开头的一行&#xff0c;光标移动到最后添加 init/bin/sh Ctrlx 保存 3.进入单用户模式 4.重新挂在根分区 5.关闭selinux 6.更新密码 passwd 7.在根分区下面创建一个隐藏文件…

【设计模式】-工厂模式

工厂模式是一种创建型设计模式&#xff0c;它提供了一种在不指定具体类的情况下创建对象的方法。工厂模式的核心思想是将对象的创建与使用分离&#xff0c;降低系统的耦合度&#xff0c;使系统更加灵活、可扩展。 工厂模式主要分为三种类型&#xff1a;简单工厂模式、工厂方法…

CLIP解读

1、引言 在计算机视觉领域&#xff0c;通常需要经过训练模型来实现对预定类别目标预测&#xff08;如分类、检测等任务&#xff09;&#xff0c;但是这种形式会限制模型的通用性。比如我们训练完了一个猫狗分类模型&#xff0c;如果现在希望识别一只老虎&#xff0c;那么原来训…

Java基础-lambda表达式

lambda表达式 前言前置知识λ小故事函数式编程起源: λ演算法 概念Lambda && 匿名类无参类型的简写带参函数的简写 简写的依据自定义函数接口lambda && 匿名类JVM层面区别匿名内部类实现Lambda表达式实现推论,this引用的意义 lambda && 集合 前言 函数…

C++_day6:继承、多态

1.封装一个动物的基类&#xff0c;类中有私有成员&#xff1a;姓名&#xff0c;颜色&#xff0c;指针成员年纪 再封装一个狗这样类&#xff0c;共有继承于动物类&#xff0c;自己拓展的私有成员有&#xff1a;指针成员&#xff1a;腿的个数&#xff08;整型 int count&#xf…
最新文章