前言

宿舍新装了无线AP,它发出来的WIFI信号可以24小时不断网

IMG_20220325_163551

之前一直接的这个接口,每天11点准时断网

IMG20220325163615

虽说可以进行无线桥接转为有线,但是直接插AP上的有线接口会更快更稳定、延迟更低

开始折腾

发现

一开始想用管理IP登AP,结果发现管理VLAN不一样,

而且这个AP关掉了所有有线接口。

后来发现了这个调试接口

IMG_20220325_163529

后来找资料发现这就是个串口,这就好办了

只需要一根带数据传输的MicroUSB线,也就是老安卓数据线

IMG20220325163320

接法

不需要剪USB,手头上刚好有USB公头

这里给出USB公头的线序,直接接USB转UART模块上就行

IMG20220325163044

接上USB转UART模块

这里用的是CH341,带UART的编程器

IMG20220325163100

接入AP调试接口

IMG_20220325_163500

打开串口

打开电脑查看端口号,这里为COM11

360截图17081031275775

打开Putty进行操作

360截图18141217426972

成功接入调试,

经过测试,是思科风格的命令,

幸运的是没设密码

360截图16751022297155

操作

获取信息

1
show interfaces

输出如下,可以发现以太网接口GigabitEthernet 0/2-5默认关闭,

GigabitEthernet 0/1.1是外面来的网线

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Index(dec):3 (hex):3
GigabitEthernet 0/1 is UP , line protocol is UP
Hardware is BCM6755 GigabitEthernet, address is 9c2b.a66e.9df7 (bia 9c2b.a66e.9df7)
Interface address is: no ip address
Interface IPv6 address is:
No IPv6 address
MTU 1500 bytes, BW 1000000 Kbit
Encapsulation protocol is Ethernet-II, loopback not set
Keepalive interval is 10 sec , set
Carrier delay is 2 sec
Ethernet attributes:
Last link state change time: 1970-01-01 08:00:32
Time duration since last link state change: 2 days, 22 hours, 22 minutes, 2 seconds
Priority is 0
Medium-type is Copper
Admin duplex mode is AUTO, oper duplex is Full
Admin speed is AUTO, oper speed is 1000M
Bridge attributes:
Port-type: hybrid
Tagged vlan id: none
Untagged vlan id: 2444
Rxload is 1/255, Txload is 1/255
10 seconds input rate 30593 bits/sec, 23 packets/sec
10 seconds output rate 11201 bits/sec, 13 packets/sec
32142845 packets input, 24279075354 bytes, 0 no buffer, 0 dropped
Received 1895845 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort
23992107 packets output, 17453305448 bytes, 0 underruns, 0 no buffer, 0 dropped
0 output errors, 0 collisions, 0 interface resets
========================== GigabitEthernet 0/1.1 ========================
ifindex(dec):18 (hex):12
GigabitEthernet 0/1.1 is UP , line protocol is UP
Hardware is BCM6755 GigabitEthernet, address is 9c2b.a66e.9df7 (bia 9c2b.a66e.9df7)
Interface address is: no ip address
Interface IPv6 address is:
No IPv6 address
MTU 1500 bytes, BW 1000000 Kbit
Encapsulation protocol is ARPA
========================== GigabitEthernet 0/2 ========================
Index(dec):4 (hex):4
GigabitEthernet 0/2 is UP , line protocol is UP
Hardware is BCM6755 GigabitEthernet, address is 9c2b.a66e.9df8 (bia 9c2b.a66e.9df8)
Interface address is: no ip address
Interface IPv6 address is:
No IPv6 address
MTU 1500 bytes, BW 1000000 Kbit
Encapsulation protocol is Ethernet-II, loopback not set
Keepalive interval is 10 sec , set
Carrier delay is 2 sec
Ethernet attributes:
Last link state change time: 2022-02-23 07:46:41
Time duration since last link state change: 0 days, 21 hours, 52 minutes, 49 seconds
Priority is 0
Medium-type is Copper
Admin duplex mode is AUTO, oper duplex is Full
Admin speed is AUTO, oper speed is 1000M
Bridge attributes:
Port-type: hybrid
Tagged vlan id: none
Untagged vlan id: 1
Rxload is 1/255, Txload is 1/255
10 seconds input rate 27951 bits/sec, 26 packets/sec
10 seconds output rate 56086 bits/sec, 27 packets/sec
3727195 packets input, 1080682841 bytes, 0 no buffer, 0 dropped
Received 3932 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort
4751494 packets output, 3789408629 bytes, 0 underruns, 0 no buffer, 0 dropped
0 output errors, 0 collisions, 0 interface resets


太长了就省略了。。。。。。。。。。

继续查看信息

1
show running-config

得到,wifi开了2.4GHz与5GHz,

我需要的信息已经拿到了:dot11 wlan 3是@FeiYoung

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Building configuration...
Current configuration: 2858 bytes

version AP_RGOS 11.9(6)B9, Release(08212903)
hostname ▒▒У▒▒-7#-402-MAP852
!
errdisable recovery interval 300
!
fair-schedule
rldp enable
ip dhcp snooping
wids
user-isolation ap enable
!
no ip source-route
data-plane wireless-broadcast enable
!
no service password-encryption
clock timezone China +8 0
!
dot11 wlan 1
band-select enable
tunnel local
ssid 手动打码
!
dot11 wlan 2
band-select enable
tunnel local
ssid 手动打码
!
dot11 wlan 3
band-select enable
tunnel local
ssid @FeiYoung
!
link-check disable
!
nfpp
!
wlocation
!
vlan 1
!
vlan 1893
!
vlan 2444
!
vlan 3159
!
vlan 3259
!
interface GigabitEthernet 0/1
encapsulation dot1Q 2444
!
interface GigabitEthernet 0/1.1
!
interface GigabitEthernet 0/2
encapsulation dot1Q 1
rldp port loop-detect shutdown-port
!
interface GigabitEthernet 0/3
encapsulation dot1Q 1
shutdown
rldp port loop-detect shutdown-port
!
interface GigabitEthernet 0/4
encapsulation dot1Q 1
shutdown
rldp port loop-detect shutdown-port
!
interface GigabitEthernet 0/5
encapsulation dot1Q 1
shutdown
rldp port loop-detect shutdown-port
!
interface Dot11radio 1/0
no ofdma enable
country-code CN
radio-type 802.11b
no mu-mimo enable
no txbf enable
rate-set 11b mandatory 1 2 5 11
rate-set 11g mandatory 11
rate-set 11g support 12 18 24 36 48 54
rate-set 11g disable 1 2 5 6 9
rate-set 11n mcs-support 63
rate-set 11ac mcs-support 79
rate-set 11ax mcs-support 128
no dfs adjustment enable
no ampdu-rts
no 11axsupport enable
11acsupport enable
response-rssi 25
coverage-area-control 8
power local 9
channel 1
chan-width 20
!
interface Dot11radio 1/0.1
wlan-id 1
!
interface Dot11radio 1/0.2
wlan-id 2
!
interface Dot11radio 1/0.3

查看VLAN

由上面信息得VLAN有这几个

360截图18720115687564

show vlan后,

得到Dol/0.3绑定的VLAN1893就是我需要的VLAN号

360截图18430705618595

绑定有线接口到VLAN

这里折腾比较久,因为网上设置锐捷交换机VLAN大多用

1
switchprot access vlan

但这个AP不支持这个命令,

后来发现下面这个命令可以用

进入配置模式

1
config

进入接口0/4

1
interface GigabitEthernet 0/4

360截图17001018393165

绑定VLAN

1
encapsulation dot1Q 1893

启用接口

1
no shutdown

大功告成

测试

接入主机测试得到IP

360截图1757111375105114

可以连接天翼校园网

360截图1793072496137123

测速也达到正常50M

360截图179910249192104

结束

如果AP断电了,每次都要设置很麻烦,

这里提供一个Arduino程序,程序写到Arduino的板子里后,

每次设置都只需要用Arduino的板子串口接AP的调试接口即可自动设置

灯亮即开始设置,灯灭即设置完成

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);

delay(5000);
digitalWrite(LED_BUILTIN, HIGH);
delay(2000);
Serial.println();
delay(2000);
Serial.println("config");
delay(2000);
Serial.println("interface GigabitEthernet 0/2");
delay(2000);
Serial.println("encapsulation dot1Q 1893");//Fyoung
delay(2000);
Serial.println("no shutdown");
digitalWrite(LED_BUILTIN, LOW);
}

void loop() {
// put your main code here, to run repeatedly:

}

EOF