End-to-end how-to for getting ziti-edge-tunnel (and optionally
ziti-router and luci-app-ziti) running on an OpenWRT device.
GL.iNet QSDK users: if your device reports
aarch64_cortex-a53_neon-vfpv4fromopkg print-architecture(GL-BE3600, GL-MT6000, and similar QSDK-based firmware), followdocs/install-gl-inet.mdinstead. Our.ipks are taggedaarch64_cortex-a53and need a one-step repack with the matching arch label before they install on QSDK. Do not try to fix it by adding an arch line to/etc/opkg.conf-- that breaks package management on QSDK.
There are three ways in, depending on what you have:
| You have | Use |
|---|---|
A .ipk someone built and sent to you |
Sideload |
| A feed URL someone published (e.g. on GitHub Pages) | Feed install |
| The source tree in this repo | Build then sideload |
After install, see Enrolling an identity.
Fastest path if you already have the .ipk. Works for the bin variant of
ziti-router-bin and for any ziti-edge-tunnel_*.ipk whose architecture
matches your device.
On the host (substitute your router's IP):
scp ziti-edge-tunnel_1.15.1-1_aarch64_cortex-a53.ipk \
llhttp9_9.4.1-1_aarch64_cortex-a53.ipk \
root@192.168.8.1:/tmp/On the router:
opkg update
opkg install /tmp/llhttp9_*.ipk /tmp/ziti-edge-tunnel_*.ipkopkg will pull in any missing runtime deps (libuv, libopenssl,
zlib, libjson-c, libsodium, libprotobuf-c, libpcap, libatomic,
kmod-tun, ip-full, ca-bundle) from your device's existing feeds.
Then enable the service:
/etc/init.d/ziti-edge-tunnel enable(It will not actually start until at least one identity is enrolled -- see Enrolling an identity.)
This is what the GL.iNet "Plug-ins" page calls a custom source. Once the
feed publisher (you or someone else) has set this up via
docs/feed-hosting.md, an end user does:
-
Admin Panel -> Applications -> Plug-ins.
-
Click Manage Sources.
-
Add the per-architecture URL, for example for the GL-BE3600 (aarch64_cortex-a53):
https://your-org.github.io/openwrt-openziti/aarch64_cortex-a53 -
Save and refresh.
ziti-edge-tunnelandluci-app-zitishow up with Install buttons.
echo "src/gz openziti https://your-org.github.io/openwrt-openziti/aarch64_cortex-a53" \
>> /etc/opkg/customfeeds.conf
opkg update
opkg install ziti-edge-tunnel luci-app-zitiThe publisher will provide a pub.key. Install it once:
mkdir -p /etc/opkg/keys
# scp pub.key to /tmp/ first
KEYID=$(usign -F -p /tmp/pub.key)
mv /tmp/pub.key /etc/opkg/keys/$KEYIDSkipping signature verification is possible (opkg --force-signature per
invocation, or option check_signature 0 in /etc/opkg.conf) but not
recommended for production.
If you cloned this repo and want to build for your own device.
Prerequisites (on the build host):
- Docker Desktop (Windows/macOS) or Docker Engine (Linux), running.
- ~2 GB free disk for the OpenWRT SDK image + build tree.
Build the ZET package:
bash tools/build-sdk.sh -p ziti-edge-tunnel(Or ./tools/build-sdk.ps1 -Package ziti-edge-tunnel from PowerShell.)
The output .ipks land in build/<target>/, where <target> defaults to
aarch64_cortex-a53 (works for the GL-BE3600 and many other ARM SBCs).
For other targets:
bash tools/build-sdk.sh -p ziti-edge-tunnel -t x86_64
bash tools/build-sdk.sh -p ziti-edge-tunnel -t aarch64_cortex-a53_ipq53xx(See docs/integration-notes.md for the full target list and SNAPSHOT
caveats.)
Then sideload as in path A.
ZET needs at least one enrolled identity (a JSON file holding the device's keypair + controller address) before it does anything. You get this by trading a JWT enrollment token issued by your OpenZiti controller.
- Browse to your router's LuCI: Services -> OpenZiti -> Identities.
- Paste the JWT into the form, give it a name (letters/digits/
-/_). - Click Enroll.
The LuCI app stages the JWT in /etc/ziti/.jwt-stage/ (0700 dir, 0600
file, wiped after use), runs ziti-edge-tunnel enroll, writes the
identity JSON to /etc/ziti/identities/<name>.json, and adds a config identity stanza to /etc/config/ziti.
ziti-edge-tunnel enroll \
--jwt /tmp/foo.jwt \
--identity /etc/ziti/identities/foo.jsonThen append a stanza to /etc/config/ziti:
config identity
option name 'foo'
option file '/etc/ziti/identities/foo.json'
option enabled '1'
And reload:
/etc/init.d/ziti-edge-tunnel reloadziti-edge-tunnel version
/etc/init.d/ziti-edge-tunnel status # if available on your version
pgrep -a ziti-edge-tunnel # should print the running PID
ip addr show ziti0 # tun device should exist once an identity is up
logread -e ziti # service logsopkg remove ziti-edge-tunnel
opkg remove llhttp9 # if no other package depends on it
# /etc/config/ziti and /etc/ziti/identities/ are conffiles -- remove manually if desired
rm -rf /etc/ziti- Service won't start: check
logread -e ziti. Missing identities produce a "no identities" message; a missingkmod-tunproduces a tun device error (runopkg install kmod-tun). - DNS doesn't resolve Ziti hostnames: ZET runs an internal DNS
resolver; you may need to forward a zone from
dnsmasqto ZET. See the deferred items indocs/integration-notes.md. - Architecture mismatch on
opkg install: verify withcat /etc/openwrt_release | grep DISTRIB_TARGETon the device and compare against the.ipkfilename suffix.