Skip to content

Deploy on OpenWrt

The fn-knock OpenWrt package includes a LuCI configuration page, the admin interface, authentication pages, the Rust backend, and the Go gateway. After installation, manage the service under Services → Knock. The admin interface defaults to 7991, and the gateway endpoint defaults to 7999.

First identify both the package format and target architecture used by your firmware. The package manager cannot install the wrong format, and a package for the wrong target will not run even when the CPUs appear similar.

Choose the correct package

The firmware determines the package format

Firmware package managerPackage formatTypical OpenWrt releaseInstall command
opkg.ipk24.10 and earlieropkg install /tmp/<file-name>.ipk
apk.apk25.12 and laterapk add --allow-untrusted /tmp/<file-name>.apk

OpenWrt 25.12 and later generally use apk, while 24.10 and earlier generally use opkg. Forks and systems in the middle of an upgrade may differ, so always use the package manager actually present on the router. Do not guess from the version number or filename extension; check the router first:

bash
ubus call system board
if command -v opkg >/dev/null 2>&1; then
  opkg print-architecture
else
  apk --print-arch
fi

Download directly for your firmware architecture

Use the target reported by the commands above, then download the matching package format directly from the table. These are the same stable download endpoints used by the official website, with the format and architecture already selected; you do not need to edit the URL.

Target architectureTypical devicesAPK (OpenWrt 25.12+)IPK (OpenWrt 24.10 and earlier)
x86_64Intel / AMD 64-bit router appliances and virtual machinesDownload APKDownload IPK
aarch64_cortex-a53IPQ60xx, Cortex-A53, and ImmortalWrt qualcommax/ipq60xxDownload APKDownload IPK
aarch64_genericGeneric ARM64 routers and development boardsDownload APKDownload IPK
arm_cortex-a7_neon-vfpv432-bit ARMv7 devices built for the matching targetDownload APKDownload IPK
arm_cortex-a5_vfpv4Cortex-A5 / VFPv4 routersDownload APKDownload IPK

Release filenames end with the OpenWrt target architecture. For example:

text
fn-knock_<version>-<release>_x86_64.ipk
fn-knock_<version>-r<release>_aarch64_cortex-a53.apk

Use the target reported by opkg print-architecture or apk --print-arch. In particular, do not interchange aarch64_generic and aarch64_cortex-a53. Do not force-install a package on MIPS, ARMv6, or another target for which no package is currently available.

Download the main fn-knock package, not the app-store metadata package.

Install

Upload the matching package to /tmp on the router, then run the command for your firmware:

bash
# opkg firmware
opkg install /tmp/fn-knock_*.ipk

# apk firmware
apk add --allow-untrusted /tmp/fn-knock_*.apk

These wildcard commands assume that /tmp contains only one installable fn-knock package. If multiple versions are present, use the complete filename.

Use apk --allow-untrusted only for a local package obtained from a trusted release page whose source or checksum you have verified. This option bypasses repository signature verification and must never be used for an untrusted file. Before an offline installation, also confirm that the firmware repositories can provide all dependencies.

The package scripts enable and start the service and refresh the LuCI menu cache. You can also install a local package through LuCI's package upload page, but the command line makes the selected format and architecture easier to verify.

First launch and ports

Open Services → Knock, confirm that the service status is Running, then click Open admin panel. The default address is:

text
http://<OpenWrt-LAN-address>:7991/

On first access, set the admin panel password. It protects only the OpenWrt admin endpoint and is separate from the TOTP, username and password, or Passkey used by visitors to access applications.

PortBind scopePurpose
7991Configurable; default admin endpointAdmin panel
7999Gateway listenerPublic endpoint for mapped services
17998127.0.0.1Internal Rust admin backend API
7997127.0.0.1Authentication service
7996127.0.0.1Internal gateway gRPC

The LuCI page can change these ports, the data directory, and the gateway configuration directory. After you apply the configuration, procd reloads the service. Every port value must be unique.

Do not forward or allow 7991 from the WAN. If public access is required, choose the run mode, certificate, and access policy first, then create only the firewall rule or upstream forwarding needed for gateway port 7999. Installing the package does not replace OpenWrt's WAN firewall policy.

Check service status and logs with:

bash
/etc/init.d/fn-knock status
logread -e fn-knock

A reachable admin panel proves only that the local service has started. After configuring a mapping, test 7999 and the domain over a real external connection such as cellular data. Do not treat a LAN result as proof that internet-facing authentication works.

Data and upgrades

Runtime configuration and data are stored in:

text
/etc/config/fn-knock
/etc/fn-knock/gateway
/var/lib/fn-knock

The gateway directory contains the SQLite database, while the runtime directory may contain secrets, tunnel resources, and update state. Back up all three locations before upgrading. They contain sensitive information and must not be uploaded to a public location.

Also export a .knock application backup from the Maintenance page. Directory backups retain SQLite and platform runtime data, while .knock archives migrate portable settings. See Backup, Restore, and Data Cleanup for their contents, version constraints, and post-restore validation.

OpenWrt cannot install FPK updates from the admin interface. Use the direct-download table above to get a new package in the same format and for the same firmware target, then run:

bash
# opkg firmware: install a new version or explicitly reinstall the same version
opkg install --force-reinstall /tmp/fn-knock_*.ipk

# apk firmware
apk add --allow-untrusted /tmp/fn-knock_*.apk

/etc/init.d/fn-knock status

If /tmp contains more than one version, use the complete filename instead of a wildcard so multiple packages are not passed to the package manager at once.

An upgrade does not proactively clear the runtime directories above. If the package manager asks how to handle a modified /etc/config/fn-knock, keep the existing file unless the upgrade instructions explicitly require restoring the default configuration.

If you forget the OpenWrt admin panel password, run the following command over SSH:

bash
fn-knock-reset-panel-password

Then return to the admin panel from LuCI and follow the prompt to set a new password.

OpenWrt feature limitations

FeatureOpenWrt package behavior
In-app FPK updatesNot supported; install a matching package with opkg or apk
Direct mode and host firewall managementSupported; the service must run as root, and you should retain LuCI or local-console access as a recovery path
Smart ConnectSupported; requires an installed and running dnsmasq whose main configuration includes /etc/dnsmasq.d/; the UI's automatic apt-get installation does not apply to OpenWrt
SSH securityNot supported; use OpenWrt's own SSH logs, firewall, or security packages
Web terminalNot supported
Automatic HTTPSNot supported by the current OpenWrt package

Smart Connect writes /etc/dnsmasq.d/fn-knock-smart-connect.conf, then restarts the service with service dnsmasq restart. Before enabling it for the first time, confirm over SSH that dnsmasq is ready and retain LuCI or console access for recovery. If the UI asks you to install dnsmasq, install it yourself with the firmware's opkg or apk rather than relying on the UI install button.

fn-knock does not replace OpenWrt firmware updates, router backups, or a minimal-exposure firewall policy.

Continue reading:

Community QQ group: 1081609274