Implementing AP Escape Solutions for Wireless Network Authentication Failures
1 Asterfusion OpenWiFi AP Escape Solution

1.1 Authentication Service Detection
Portal and Radius Service Detection
nc
command to detect whether portal servers are working normally and simulated user authentication methods to detect whether radius servers are working normally. When 3 consecutive unreachable detections are identified, wireless traffic switches from normal authentication pass-through mode to escape mode.
Radius Service Detection Logic Code
function radius_probe(server, port, secret, user, pass)
{
let f = fs.open('/tmp/radius.conf', 'w');
if (f) {
f.write(sprintf('authserver %s:%d\n', server, port));
f.write('servers /tmp/radius.servers\n');
f.write('dictionary /etc/radcli/dictionary\n');
f.write('radius_timeout 3\n');
f.write('radius_retries 1\n');
f.write('bindaddr *\n');
f.close();
}
let f = fs.open('/tmp/radius.servers', 'w');
if (f) {
f.write(sprintf('%s %s\n', server, secret));
f.close();
}
let cmd = sprintf("/usr/sbin/radiusprobe %s %s > /dev/null 2>&1", user, pass);
let exit_code = system(cmd);
if (exit_code == 0) {
return 0;
} else {
return 1;
}
}
Portal Service Detection Logic Code
function probe_portal(host, port, timeout) {
let cmd = sprintf("nc -z -w %d %s %d", timeout, host, port);
let exit_code = system(cmd);
if (exit_code == 0) {
return 0;
} else {
return 1;
}
}
1.2 Escape Logic Configuration
Configuration Steps
1. Navigate to Organization → Site → Configuration → Wireless Configuration Templates → Add Wireless Configuration

2. Configure template name, corresponding AP model, configuration tags, system timezone, and LED settings

3. Switch to Network Activation tab and configure the normal business SSID

- When enabling a normal business SSID, the Captive switch must be turned on
- Normal business VLAN is 401, defaulting to 192.168.17.xx IP addresses
4. Select “+” to continue adding escape SSID


- When enabling escape SSID, the Bypass switch must be turned on
- Escape business VLAN is 403, defaulting to 192.168.20.xx IP addresses
Note: The condition for enabling escape SSID is single frequency band. Only one escape SSID can be configured.
5. Switch to Security Service tab and configure forced portal authentication method as External-UAM

6. Under External UAM, configure: Domain whitelist (Portal server domain or IP), External-UAM server, External-UAM key, External UAM port, Probe port, NAS ID

7. Continue configuring under External UAM: Authentication server, Authentication key, Authentication port, Audit fields (if audit requirements exist), Other non-required fields as needed

8. Click the Save button in the upper left corner to complete the wireless configuration template saving

2. Test Results
Normal Operation Scenario
When both Portal and Radius services are normal:
- By default, AP only releases the normal 401 VLAN SSID
- Terminals can only scan one “Escape” SSID


-
The portal page appears after connection

-
Click “Accept” to prompt for username and password input

-
Enter username and password for Radius authentication

-
The success page returns after successful authentication

-
The terminal gets normal internet access with 192.168.17.xx network address


Escape Mode Scenario
When the Portal service is shut down, triggering AP escape mode:
- AP closes the current 401 VLAN SSID and opens the 403 VLAN SSID
- AP logs show (3 consecutive NC command detections of Portal service anomaly):
2025-08-19T12:00:26.421781+08:00 60eb5a0051ce auth_probe.uc[6669]: Server Check Result NC: 0, RD: 1
2025-08-19T12:01:32.498876+08:00 60eb5a0051ce auth_probe.uc[6669]: Server Check Result NC: 0, RD: 1
2025-08-19T12:02:38.580530+08:00 60eb5a0051ce auth_probe.uc[6669]: Server Check Result NC: 0, RD: 1
2025-08-19T12:02:38.580590+08:00 60eb5a0051ce auth_probe.uc[6669]: Wireless up2v403_0_0_0 Enabled
2025-08-19T12:02:38.580776+08:00 60eb5a0051ce auth_probe.uc[6669]: Wireless up1v401_0_0_0 Disabled
2025-08-19T12:03:45.017059+08:00 60eb5a0051ce auth_probe.uc[6669]: Auth server is down, enable bypass mode [AP-EVENT]Server Check Result NC: 0, RD: 1
-
After disconnection and reconnection to the Escape SSID
-
Terminal obtains the VLAN 403 network IP address 192.168.20.xx
-
Controlled network access is maintained during authentication server downtime


Glossary of Abbreviations
|