Cisco vWLC家用部署指北

在chiphell种草了cisco ap+vwlc很久了,最近东西买齐了,配置过程中踩了不少坑,vVWLC step by step就不做了,主要说下网络环境搭建和采坑的地方。

vwlc版本选择
直接最新的8.10.171.0完事,这也是思科的推荐版本,官方地址。下载地址AIR_CTVM-K9_8_10_171_0.ova

服务器选择
服役中的R630,E5-2620 v3、32G、2TB

AP选择

  1. 先看8.10.171.0版本支持哪些AP,从官方兼容性列表表7得知支持以下型号AP:
  2. 再看咸鱼,靠!从1830系列开始就没有低于1200块的。那么次一级1810系列如何呢:2x2:2 MU/SUMIMO,我家的无线设备就没3X3天线的2X2够用。就你了!咸鱼830买了2个1815m+挂架。到手一看,出厂日期2020年,NICE!(听卖家说是来源是海底捞倒闭门店233)

POE交换机选择
服务器和AP都是二手,POE交换机再买个二手说不过去了吧,整个可管理POE交换机吧。最终选择了网件GS108PEv3,1815m供电要求是802.3af,这个够用,淘宝690(妈的略贵)。

其他设备
电信SDN猫改桥接、mikrotik hapac^2、思科C3560CG-8TC-S

网络架构
1.hapac2作为主路由,划分VLAN。vlan1管理网段、vlan2 guest、vlan3内网,另ACL不允许guest段访问其它网段。

  1. hapac2做主路由
  2. C3560CG做三层划分VLAN
    • vlan1:192.168.1.0/24 管理网段
    • vlan2:200.200.200.0/24 guest网段
    • vlan3:192.168.2.0/24 内网网段
    • 设ACL,不允许guest段访问其它网段
  3. GS108PEv3做二层,接PC、AP、摄像头、电视机

开整!

配置hapac2

  1. 结果尼玛第一步就翻车了!这台hapac2之前快速设置完就没动过了。这次清空配置后根据教程配vlan和dhcp怎么都失败,表现为三层拿不到vlan。搞了两天没解决,估计是卡在M记独有的bridge上了。没办法只能改网络架构:hapac2只做主路由,DHCP和VLAN让三层做。
  2. 接下来简单了,hapac2只要用快速配置然后把无线和DHCP关掉,路由器地址默认的192.168.88.1。然后配下三个VLAN和192.168.88.1之间的路由,这步不做的话内网的设备找不到192.168.88.1,就上不了外网。

配置C3560CG-8TC-S
稍微麻烦点,关键配置如下:

ip routing  #开启vlan间路由
ip dhcp excluded-address 192.168.1.1 192.168.1.99   #DHCP设排除
ip dhcp excluded-address 200.200.200.1 200.200.200.99
ip dhcp excluded-address 192.168.2.1 192.168.2.99
!
ip dhcp pool lan    #创建DHCP地址池
 network 192.168.1.0 255.255.255.0
 default-router 192.168.1.1 
 dns-server 192.168.88.1 
!         
ip dhcp pool Guest
 network 200.200.200.0 255.255.255.0
 default-router 200.200.200.1 
 dns-server 192.168.88.1 
!         
ip dhcp pool Internal
 network 192.168.2.0 255.255.255.0
 dns-server 192.168.88.1 
 default-router 192.168.2.1 
!         
interface GigabitEthernet0/1    #1口做trunk下接二层GS108PEv3
 switchport trunk encapsulation dot1q
 switchport mode trunk
!         
interface GigabitEthernet0/2    #2口做trunk下接R630
 switchport trunk encapsulation dot1q
 switchport mode trunk
!         
interface GigabitEthernet0/9    #9口上连hapac2,端口从二层口改为三层口,配接口地址
 description Uplink to MikroTik hAP ac^2
 no switchport
 ip address 192.168.88.2 255.255.255.0
!         
interface Vlan1     #默认vlan,作为管理段
 ip address 192.168.1.1 255.255.255.0
 ip access-group 10 out     #ACL配置为“10 deny 200.200.200.0;20 permit any”
!         
interface Vlan2     #Guest段
 ip address 200.200.200.1 255.255.255.0
!         
interface Vlan3     #内网段
 ip address 192.168.2.1 255.255.255.0
 ip access-group 10 out     ##ACL配置为“10 deny 200.200.200.0;20 permit any”
!         
ip route 0.0.0.0 0.0.0.0 192.168.88.1   #配置三层出口路由到hapac2

三层配置出口路由之前没搞过,参考的这篇文章:思科高级配置(三层交换配置路由)

ESXi配置Trunk口
网络\端口组\添加端口组:

ESXi配trunk是为了让vwlc能够拿到三层上划分的vlan,vlan id 4095即为trunk,然后把vswitch分给vwlc就行。

配置GS108PEv3
网件的管理交换机配vlan逻辑真特么绕,搞了半天。

  1. 首先我们有3个VLAN所以VLAN ID要添加123,1默认有了只要添加23就行:
  2. 12口下接AP,8口上接C3560CG所以需要配置成trunk模式。将VLAN ID 123的1、2、8口设置为“T”(Tagged)。即所谓打上标签,就是思科体系里的trunk。(方便理解这么说的,实际比这复杂,博主的小脑瓜只能理解到这一步)

    VLAN ID 1的34567口设U的话,接上的设备就只拿vlan1的IP地址。

  3. PVID楼主不是很理解,应该是思科体系的native vlan的意思吧。默认1就行,如果你改成2或者3那么ap只能获取对应vlan的地址,1的话ap可以拿所有vlan。(这一步坑了我很久)

vwlc配置
就不献丑了,网上好多教程,我主要参考这几篇:
二手cisco ap wifi5 家庭布网测试,vwlc8.5设置802.11r注意事项
千元实现全屋Cisco思科无线网覆盖--技术帖
年轻人的第一个无线网络——Cisco vWLC基础配置教程

重点主要讲下vWLC配置中采坑的地方

  1. service-port默认其实有个192.168.1.1的地址在上面,但是在初始cli配置界面没有指出来;这时候如果你给service-port设了个地址是不生效的,它还是192.168.1.1,因为这个设置要重启才生效。然后不巧如果你给management口设192.168.1.x段的地址(比如192.168.1.1)会设置失败,因为service-port和management地址不允许同一个段!这里面最恶心的是它不告你原因!办法是mgmt先搞个非192.168.1.x段,然后一路设置完保存重启再进入cli设置mgmt为192.168.1.x段。可以参考思科的guide

    Step 1
    Enter the show interface detailed management command to view the current management interface settings.
    Note The management interface uses the controller's factory-set distribution system MAC address.
    Note This command output shows the port MAC address.
    Step 2
    Enter the config wlan disable wlan-number command to disable each WLAN that uses the management interface for distribution system communication.
    Step 3
    Enter these commands to define the management interface:
    Using IPv4 Address
    config interface address management ip-addr ip-netmask gateway

    我实际操作的时候"config wlan disable wlan-number"搞不懂number是啥,所以直接"config wlan disable all"了后面再enable就行。

  2. license问题
    vwlc自带200个ap支持数,有效期60天。但vwlc支持RTU license,你可以不用管RTU是啥,反正思科难得大方了一回。直接在Licenses页面License Count中随便填个数,点set count就完了!直接No Expiry!

  3. ap无法上线问题
    vwlc初始配置页面的国家设置默认是US,如果你买的AP是中国区的话AP会发生反复上线反复下线的问题,此时用console连AP后有以下日志:Max retransmission count exceeded, going back to DISCOVER mode,解决办法就是在vwcl的wireless\country中把国家改为CN。

  4. ac配置多个ssid,不同ssid用不同vlan
    这个上面几篇文章都没写到,我是参考这篇官方guide:使用 WLC 的访客 WLAN 和内部 WLAN 配置示例,文章有点老了,但是很实用!

  5. ap无法运行在trunk模式下 (多个SSID无法获取不同VLAN)
    第4个坑弄完我发现我几个ssid只能拿到一个段的地址。无论是改GS108PEv3的pvid、把端口在T、U间改来改去依旧不行!猜测应该是AP端口没运行在trunk模式下,后来在reddit一篇帖子上看到有人提了一句:

    The APs need to be on trunk ports, yes.
    They also need to have vlan support turned on. In the controller, if you click an AP, in the Flexconnect tab, you'll see a check box for vlan support. Turn that on.

    照着设后问题解决!!!(卡了快两天):

    试着分析了下故障原因:
    官方文档说vwlc默认用native vlan(默认为1)管理AP,如AP上线、获取trunk配置等。我的ap工作在flexconnect模式下,默认vlan support关闭所以只能拿到native vlan给的地址;GS108PEv3的pvid就是设置native vlan,因此设1 AP就只能拿vlan1的地址、设2就拿vlan2的地址、设3就拿vlan3的地址;vlan support开启后ap的trunk功能就能用了(此时pvid需要设置1),这样不同ssid就能拿到不同vlan了。

    另外测了下VLAN ACL功能,先连guest wifi,然后ping测试:

    C:\Users\Satan>ping 192.168.1.10
    
    正在 Ping 192.168.1.10 具有 32 字节的数据:
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    
    192.168.1.10 的 Ping 统计信息:
        数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
    
    C:\Users\Satan>ping 192.168.2.102
    
    正在 Ping 192.168.2.102 具有 32 字节的数据:
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    来自 200.200.200.1 的回复: 无法访问目标网。
    
    192.168.2.102 的 Ping 统计信息:
        数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
    
    C:\Users\Satan>ping www.baidu.com
    
    正在 Ping www.a.shifen.com [XXX.XXX.XXX.XXX] 具有 32 字节的数据:
    来自 XXX.XXX.XXX.XXX 的回复: 字节=32 时间=13ms TTL=52
    来自 XXX.XXX.XXX.XXX 的回复: 字节=32 时间=13ms TTL=52
    来自 XXX.XXX.XXX.XXX 的回复: 字节=32 时间=14ms TTL=52
    来自 XXX.XXX.XXX.XXX 的回复: 字节=32 时间=14ms TTL=52

    guest段无法ping通192.168.2.x 192.168.1.x段地址,但可以上外网。ACL大成功!

  6. 默认flexconnect组不支持802.11r
    这个我觉得绝特么坑爹,所以专门指出来下。在这篇《二手cisco ap wifi5 家庭布网测试,vwlc8.5设置802.11r注意事项 》中也提到了,解决办法是新建flexconnect组,然后把ap加进去:

性能测试

PS D:\Download\iperf-3.1.3-win64\iperf-3.1.3-win64> .\iperf3.exe -c 192.168.1.10
Connecting to host 192.168.1.10, port 5201
[ 4] local 192.168.2.100 port 11981 connected to 192.168.1.10 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 28.5 MBytes 239 Mbits/sec
[ 4] 1.00-2.00 sec 33.2 MBytes 279 Mbits/sec
[ 4] 2.00-3.01 sec 30.9 MBytes 258 Mbits/sec
[ 4] 3.01-4.00 sec 33.5 MBytes 282 Mbits/sec
[ 4] 4.00-5.00 sec 35.2 MBytes 296 Mbits/sec
[ 4] 5.00-6.00 sec 32.4 MBytes 271 Mbits/sec
[ 4] 6.00-7.00 sec 33.1 MBytes 278 Mbits/sec
[ 4] 7.00-8.00 sec 27.4 MBytes 229 Mbits/sec
[ 4] 8.00-9.00 sec 31.2 MBytes 262 Mbits/sec
[ 4] 9.00-10.00 sec 32.1 MBytes 270 Mbits/sec
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-10.00 sec 318 MBytes 266 Mbits/sec sender
[ 4] 0.00-10.00 sec 318 MBytes 266 Mbits/sec receiver

emmmm,好垃!不太能接受!那么内网拷文件又如何?

还行鸭,此时dBm在-59左右。

移动笔记本靠近AP,dBm为-43,再次测试:

舒服了~
毕竟wifi不是双全工,866Mbps只是理论协商速度实际有500Mbps不错了。测试能达到70MB/s我很满足了。家里也没有3x3天线的设备,这个速度够用了。
也查过资料,貌似思科的AP用iperf3测速就是跑不满,可能商业产品有做限制,我也调过vwlc的qos但是没用;反正内网拷贝达标了就不去管它了。

vwlc限速迷思
但是vwlc确实存在限速问题,chiphell很多人都提到过,我花了点时间验证了下。
首先,这个说法是官方的7.5 deployment guide提到的:

Virtual Controller Release 7.5 Support
Throughput performance up to 500 Mbps per virtual controller

在后续版本的部署手册中没有特意提到这一点,就当一直存在这个限制。

但是我内网拷文件稳定70MB/s,跑到了这款2x2 AP的极限,这个限制对我并没有生效。查过资料后我认为,是因为我开了flexconnect local switching选项的原因。

FlexConnect Switching Modes
FlexConnect APs are capable of supporting the following switching modes concurrently, on a per-WLAN basis:

  • Local Switched: Locally-switched WLANs map wireless user traffic to discrete VLANs via 802.1Q trunking, either to an adjacent router or switch. If so desired, one or more WLANs can be mapped to the same local 802.1Q VLAN.
    A branch user, who is associated to a local switched WLAN, has their traffic forwarded by the on-site router. Traffic destined off-site (to the central site) is forwarded as standard IP packets by the branch router. All AP control/management-related traffic is sent to the centralized controller separately via Control and Provisioning of Wireless Access Points protocol (CAPWAP).
  • Central Switched: Central switched WLANs tunnel both the wireless user traffic and all control traffic via CAPWAP to the centralized controller where the user traffic is mapped to a dynamic interface/VLAN on the controller. This is the normal CAPWAP mode of operation.
    The traffic of a branch user, who is associated to a central switched WLAN, is tunneled directly to the centralized controller. If that user needs to communicate with computing resources within the branch (where that client is associated), their data is forwarded as standard IP packets back across the WAN link to the branch location. Depending on the WAN link bandwidth, this might not be desirable behavior.


该模式下流量交换在AP和交换机中进行,数据流量并没有经过vwlc(控制和管理流量依旧经过)因此并没有被vwlc的背板吞吐量限制。local switching模式默认是关闭的,此时是AP工作在central switching模式下,这时流量经过vwlc,那么就要吃500Mbps的限速了。

验证猜测对不对也很简单,只要开关local switching选项然后内网拷贝两次就知道了。

我测试下来确实如此:关闭local switching选项让AP处于central switching模式下,此时即使离ap很近拷贝速度也没超过60MB/s,打开后就跑到这款ap的上限70MB/s左右了。

另外看ESXi中vwlc的流量波动图也很明显:

  1. central switching模式总传输只有470Mbps

  2. local switching模式下传输为0,因为AP交换流量没经过vwlc而是直接到交换机了:

结论:vwlc确实存在500Mbps的吞吐限制,但是你可以开启flexconnect的local switching选项来避免这个问题。

覆盖范围
125平房子,书房和客厅放了两个AP,除了厨房5Ghz两格外其他全覆盖。

无缝漫游实际体验
设备:oppo reno十倍变焦手机、小米pad5
测试软件:wifi魔盒、微信视频通话、bilibili直播

wifi魔盒测试:
手机切换时间在50ms~450ms都有,偶尔丢1个包,也有掉线问题,比较拉夸。
小米pad5切换时间一直在50ms左右,丢包和掉线几乎没有。

微信视频测试:
手机、小米pad5都没有卡顿很流畅。

bilibili直播测试:
手机、小米pad5都没有卡顿很流畅。

测试总结:
漫游和覆盖体验都很满意。说明wifi魔盒测试结果并不代表实际体验,这玩意儿不靠谱啊!

Thanks for watching.

HOMELAB DEVICES

Server
Dell PowerEdge R630
E5-2620 v3 x2\32GB ECC\1.63TB

Router
Mikrotik HAP ac^2

Switch
Cisco WS-C3560CG-8TC-S
NETGEAR GS108PEv3

Wi-Fi
AC Cisco vWLC
AP Cisco 1815M

UPS
APC SUA1000ICH
NMC AP9631CH

wordpress设置域名后无法通过ip地址访问

我的wordpress是搭建在内网的一台服务器上,在wordpress控制面板的设置中设了WordPress(URL)站点地址(URL)为https域名地址。

然后发现无法通过localhost的形式访问wordpress了,输入内网ip会被强制跳转成域名。这样访问速度慢,内网编辑帖子和调设置很墨迹。

本来以为是一个很简单的问题,结果google一圈竟然没啥简单快捷的办法。

后来灵机一动,可以改hosts嘛!

duang~

localip www.yourdomain.com

事实证明土方法有时候就是好使:)

RHEL9.0配置SSH公钥登录

RHEL 9.0不允许root账户通过SSH登录,因此安装时需要新建用户账户,第一次SSH登录使用用户账户。

  1. 生成ECDSA SSH秘钥对

    ssh-keygen -t ecdsa
  2. 验证秘钥对

    $ ls -l ~/.ssh
    -rw-------. 1 pepper pepper 505 8月 12 22:49 id_ecdsa
    -rw-r–r–. 1 pepper pepper 178 8月 12 22:49 id_ecdsa.pub
  3. 复制(安装)公钥

    $ ssh-copy-id pepper@192.168.1.11

    此命令将公钥复制到.ssh/authorized_keys中

  4. 验证公钥

    $ cat ~/.ssh/authorized_keys
    ecdsa-sha2-nistp256 AAAAE2VjZ略n+fFZVdmk= pepper@Wordpress
  5. 用WinSCP将id_ecdsa拷出,然后用xshell6.0以上版本创建SSH连接。

  6. 在“用户身份验证\方法”中选择“public key”,“用户秘钥”定位到id_ecdsa文件。

  7. 即可使用公钥登录rhel

ref:

How to Configure SSH Passwordless Authentication on RHEL 9

开通Linux密钥认证登录安全操作手册(Xshell)

Error cURL error 7 http_request_failed

WordPress站点健康检查提示“Error cURL error 7 http_request_failed”

selinux引起的问题,修改selinux配置:

[pepper@Wordpress wordpress]$ sudo setsebool httpd_can_network_connect on

or
关闭selinux:

[pepper@Wordpress wordpress]$ sudo getenforce   #检查selinux当前模式
Enforcing
...
[pepper@Wordpress ~]$ sudo vi /etc/selinux/config   #编辑selinux配置文件
...
SELINUX=enforcing   #改为permissive
...
[pepper@Wordpress wordpress]$ sudo reboot   #重启生效