华为配置终端定位基本实验配置

配置终端定位基本示例

组网图形

图1 配置终端定位基本服务示例

  • 组网需求
  • 数据准备
  • 配置思路
  • 配置注意事项
  • 操作步骤
  • 配置文件

组网需求

图1所示,某公司网络中,中心AP直接与RU连接。

管理员希望通过RU收集Wi-Fi终端信息,并提供给定位服务器进行定位计算,使用户可以通过地图、表格或报告等形式获取到该Wi-Fi终端的位置信息。

数据准备

项目

数据

RU管理VLAN

VLAN100

STA业务VLAN

VLAN101

DHCP服务器

中心AP作为RU和STA的DHCP服务器

RU地址池

10.23.100.3~10.23.100.254/24

STA地址池

10.23.101.2~10.23.101.254/24

AP组

  • 名称:ap-group1

  • 引用模板:域管理模板domain1、VAP模板wlan-vap、2G射频模板wlan-radio-2g、5G射频模板wlan-radio-5g和定位模板wlan-location

域管理模板

  • 名称:domain1
  • 国家码:CN

SSID模板

  • 名称:wlan-ssid

  • SSID名称:wlan-net

安全模板

  • 名称:wlan-security

  • 安全策略:WPA2+PSK+AES

  • 密码:a1234567

VAP模板

  • 名称:wlan-vap

  • 业务VLAN:VLAN101

  • 引用模板:SSID模板wlan-ssid、安全模板wlan-security

空口扫描模板

  • 名称:wlan-air-scan

  • 探测信道集合:国家码信道

2G射频模板

  • 名称:wlan-radio-2g

  • 引用模板:空口扫描模板wlan-air-scan

5G射频模板

  • 名称:wlan-radio-5g

  • 引用模板:空口扫描模板wlan-air-scan

定位模板

  • 名称:wlan-location

  • AP上报信道扫描信息的目的IP/端口号:10.23.100.2/32180

配置思路

采用如下的思路配置WLAN终端定位业务:

  • 配置WLAN基本业务,保证用户能够通过WLAN网络接入公司内部网络。
  • 配置终端定位功能,保证RU可以接收定位服务器的配置信息并将收集到的终端信息发送给定位服务器。

配置注意事项

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

操作步骤
  1. 配置定位服务器(略)。
  2. 配置中心AP,使AP与中心AP之间能够传输CAPWAP报文

    # 配置中心AP连接AP的接口GigabitEthernet0/0/1~GigabitEthernet0/0/3加入VLAN100(管理VLAN)。
    
    <HUAWEI> system-view
    [HUAWEI] sysname AP
    [AP] vlan batch 100 101
    [AP] interface gigabitethernet 0/0/1
    [AP-GigabitEthernet0/0/1] port link-type trunk
    [AP-GigabitEthernet0/0/1] port trunk pvid vlan 100
    [AP-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 101
    [AP-GigabitEthernet0/0/1] quit
    [AP] interface gigabitethernet 0/0/2
    [AP-GigabitEthernet0/0/2] port link-type trunk
    [AP-GigabitEthernet0/0/2] port trunk pvid vlan 100
    [AP-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 101
    [AP-GigabitEthernet0/0/2] quit
    [AP] interface gigabitethernet 0/0/3
    [AP-GigabitEthernet0/0/3] port link-type trunk
    [AP-GigabitEthernet0/0/3] port trunk pvid vlan 100
    [AP-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 101
    [AP-GigabitEthernet0/0/3] quit

  3. 配置中心AP与定位服务器互通

    # 配置中心AP连接定位服务器的接口GE0/0/24加入VLAN100。
    
    [AP] interface gigabitethernet 0/0/24
    [AP-GigabitEthernet0/0/24] port link-type trunk
    [AP-GigabitEthernet0/0/24] port trunk pvid vlan 100
    [AP-GigabitEthernet0/0/24] port trunk allow-pass vlan 100 101
    [AP-GigabitEthernet0/0/24] quit

  4. 配置中心AP作为DHCP服务器,为STA和RU分配IP地址

    # 配置基于接口地址池的DHCP服务器,其中,VLANIF100接口为RU提供IP地址,VLANIF101为STA提供IP地址。
    
    [AP] dhcp enable
    [AP] interface vlanif 100
    [AP-Vlanif100] ip address 10.23.100.1 24
    [AP-Vlanif100] dhcp select interface
    [AP-Vlanif100] quit
    [AP] interface vlanif 101
    [AP-Vlanif101] ip address 10.23.101.1 24
    [AP-Vlanif101] dhcp select interface
    [AP-Vlanif101] quit

  5. 配置RU上线

    # 创建AP组,用于将相同配置的RU都加入同一AP组中。
    [AP] wlan
    [AP-wlan-view] ap-group name ap-group1
    [AP-wlan-ap-group-ap-group1] quit
    # 创建域管理模板,在域管理模板下配置中心AP的国家码并在AP组下引用域管理模板。
    [AP-wlan-view] regulatory-domain-profile name domain1
    [AP-wlan-regulatory-domain-prof-domain1] country-code cn
    [AP-wlan-regulatory-domain-prof-domain1] quit
    [AP-wlan-view] ap-group name ap-group1
    [AP-wlan-ap-group-ap-group1] regulatory-domain-profile domain1
    Warning: Modifying the country code will clear channel, power and antenna gain configurations of the radio and reset the AP. Continu e?[Y/N]:y  
    [AP-wlan-ap-group-ap-group1] quit
    [AP-wlan-view] quit
    # 配置中心AP的管理VLAN。
    [AP] management-vlan 100
    # 在中心AP上离线导入RU,并将RU加入AP组“ap-group1”中。根据RU的部署位置为RU配置名称,便于从名称上就能够了解RU的部署位置。例如MAC地址为fcb6-9897-c520的RU部署在1号区域,命名此RU为area_1。​​​​​​​
    ap auth-mode命令缺省情况下为MAC认证,如果之前没有修改其缺省配置,可以不用执行ap auth-mode mac-auth。
    
    举例中使用的RU为R240D,具有射频0和射频1两个射频。
    
    [AP] wlan
    [AP-wlan-view] ap auth-mode mac-auth
    [AP-wlan-view] ap-id 1 ap-mac fcb6-9897-c520
    [AP-wlan-ap-1] ap-name area_1
    [AP-wlan-ap-1] ap-group ap-group1
    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]:y  
    [AP-wlan-ap-1] quit
    [AP-wlan-view] ap-id 2 ap-mac fcb6-9897-c9c0
    [AP-wlan-ap-2] ap-name area_2
    [AP-wlan-ap-2] ap-group ap-group1
    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]:y  
    [AP-wlan-ap-2] quit
    [AP-wlan-view] ap-id 3 ap-mac fcb6-9897-ca40
    [AP-wlan-ap-3] ap-name area_3
    [AP-wlan-ap-3] ap-group ap-group1
    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]:y  
    [AP-wlan-ap-3] quit
    # 将RU上电后,当执行命令display ap all查看到RU的“State”字段为“nor”时,表示RU正常上线。
    
    [AP-wlan-view] display ap all
    Total AP information:
    nor  : normal          [3]
    ----------------------------------------------------------------------------------------
    ID   MAC            Name   Group     IP            Type                State STA Uptime
    ----------------------------------------------------------------------------------------
    1    fcb6-9897-c520 area_1 ap-group1 10.23.100.254 R240D               nor   0   25S
    2    fcb6-9897-c9c0 area_2 ap-group1 10.23.100.253 R240D               nor   0   20S
    3    fcb6-9897-ca40 area_3 ap-group1 10.23.100.252 R240D               nor   0   10S
    ----------------------------------------------------------------------------------------
    Total: 3

  6. 配置WLAN业务参数

    # 创建名为“wlan-security”的安全模板,并配置安全策略。
    举例中以配置WPA2+PSK+AES的安全策略为例,密码为“a1234567”,实际配置中请根据实际情况,配置符合实际要求的安全策略。
    
    [AP-wlan-view] security-profile name wlan-security
    [AP-wlan-sec-prof-wlan-security] security wpa2 psk pass-phrase a1234567 aes
    [AP-wlan-sec-prof-wlan-security] quit
    # 创建名为“wlan-ssid”的SSID模板,并配置SSID名称为“wlan-net”。
    
    [AP-wlan-view] ssid-profile name wlan-ssid
    [AP-wlan-ssid-prof-wlan-ssid] ssid wlan-net
    [AP-wlan-ssid-prof-wlan-ssid] quit
    # 创建名为“wlan-vap”的VAP模板,配置业务VLAN,并且引用安全模板和SSID模板。
    
    [AP-wlan-view] vap-profile name wlan-vap
    [AP-wlan-vap-prof-wlan-vap] service-vlan vlan-id 101
    [AP-wlan-vap-prof-wlan-vap] security-profile wlan-security
    [AP-wlan-vap-prof-wlan-vap] ssid-profile wlan-ssid
    [AP-wlan-vap-prof-wlan-vap] quit
    # 配置AP组引用VAP模板,RU上射频0和射频1都使用VAP模板“wlan-vap”的配置。
    
    [AP-wlan-view] ap-group name ap-group1
    [AP-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 0
    [AP-wlan-ap-group-ap-group1] vap-profile wlan-vap wlan 1 radio 1
    [AP-wlan-ap-group-ap-group1] quit

  7. 配置WLAN空口扫描功能

    # 创建名为“wlan-air-scan”的空口扫描模板,并配置空口扫描信道集合。
    [AP-wlan-view] air-scan-profile name wlan-air-scan
    [AP-wlan-air-scan-prof-wlan-air-scan] scan-channel-set country-channel
    [AP-wlan-air-scan-prof-wlan-air-scan] quit
    # 创建名为“wlan-radio-2g”的2G射频模板,并引用名为“wlan-air-scan”的空口扫描模板。
    [AP-wlan-view] radio-2g-profile name wlan-radio-2g
    [AP-wlan-radio-2g-prof-wlan-radio-2g] air-scan-profile wlan-air-scan
    [AP-wlan-radio-2g-prof-wlan-radio-2g] quit
    # 创建名为“wlan-radio-5g”的5G射频模板,并引用名为“wlan-air-scan”的空口扫描模板。
    [AP-wlan-view] radio-5g-profile name wlan-radio-5g
    [AP-wlan-radio-5g-prof-wlan-radio-5g] air-scan-profile wlan-air-scan
    [AP-wlan-radio-5g-prof-wlan-radio-5g] quit
    # 配置AP组引用射频模板。
    [AP-wlan-view] ap-group name ap-group1
    [AP-wlan-ap-group-ap-group1] radio-2g-profile wlan-radio-2g radio 0
    [AP-wlan-ap-group-ap-group1] radio-5g-profile wlan-radio-5g radio 1
    [AP-wlan-ap-group-ap-group1] quit

  8. 配置终端定位功能

    # 创建名为“wlan-location”的定位模板,使能终端定位功能,并配置定位信息上报的目的地和端口号。
    [AP-wlan-view] location-profile name wlan-location
    [AP-wlan-location-prof-wlan-location] private mu-enable
    [AP-wlan-location-prof-wlan-location] private server ip-address 10.23.100.2 port 32180
    [AP-wlan-location-prof-wlan-location] quit
    # 配置AP组引用定位模板。
    [AP-wlan-view] ap-group name ap-group1
    [AP-wlan-ap-group-ap-group1] location-profile wlan-location radio all
    [AP-wlan-ap-group-ap-group1] quit

  9. 验证配置结果

    WLAN业务配置会自动下发给RU,配置完成后,通过执行命令display vap ssid wlan-net查看如下信息,当“Status”项显示为“ON”时,表示RU对应的射频上的VAP已创建成功。
    
    [AP-wlan-view] display vap ssid wlan-net
    WID : WLAN ID
    ------------------------------------------------------------------------------------
    AP ID AP name        RfID WID  BSSID          Status  Auth type     STA   SSID     
    ------------------------------------------------------------------------------------
    1     area_1         0    1    FCB6-9897-C520 ON      WPA2-PSK      1     wlan-net
    1     area_1         1    1    FCB6-9897-C530 ON      WPA2-PSK      0     wlan-net
    2     area_2         0    1    FCB6-9897-C9C0 ON      WPA2-PSK      0     wlan-net
    2     area_2         1    1    FCB6-9897-C9D0 ON      WPA2-PSK      0     wlan-net
    3     area_3         0    1    FCB6-9897-CA40 ON      WPA2-PSK      0     wlan-net
    4     area_3         1    1    FCB6-9897-CA50 ON      WPA2-PSK      0     wlan-net
    ------------------------------------------------------------------------------------
    Total: 6

配置文件
中心AP的配置文件

#
 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 101
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk pvid vlan 100
 port trunk allow-pass vlan 100 101
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk pvid vlan 100
 port trunk allow-pass vlan 100 101
#
interface GigabitEthernet0/0/24
 port link-type trunk
 port trunk pvid vlan 100
 port trunk allow-pass vlan 100 101
#
management-vlan 100
#
wlan
 security-profile name wlan-security
  security wpa2 psk pass-phrase %^%#_b"h2cpaO$9bZ-;`-_;CN5)k,_\UP3[!AJE6Vtg3%^%# aes
 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
 location-profile name wlan-location
  private mu-enable
  private server ip-address 10.23.100.2 port 32180
 regulatory-domain-profile name domain1
 air-scan-profile name wlan-air-scan
 radio-2g-profile name wlan-radio-2g
  air-scan-profile wlan-air-scan
 radio-5g-profile name wlan-radio-5g
  air-scan-profile wlan-air-scan
 ap-group name ap-group1
  regulatory-domain-profile domain1
  location-profile wlan-location radio all
  radio 0
   radio-2g-profile wlan-radio-2g
   vap-profile wlan-vap wlan 1
  radio 1
   radio-5g-profile wlan-radio-5g
   vap-profile wlan-vap wlan 1
 ap-id 1 type-id 55 ap-mac fcb6-9897-c520 ap-sn 21500826402SF4900166
  ap-name area_1
  ap-group ap-group1
 ap-id 2 type-id 55 ap-mac fcb6-9897-c9c0 ap-sn 21500826402SF4900203
  ap-name area_2
  ap-group ap-group1
 ap-id 3 type-id 55 ap-mac fcb6-9897-ca40 ap-sn 21500826402SF4900207
  ap-name area_3
  ap-group ap-group1
#
return

上一篇:FreeRTOS教程7 事件组


下一篇:科技云报道:第五次工业革命,中国AI企业如何打造新质生产力?