-
Notifications
You must be signed in to change notification settings - Fork 0
Clients and Devices
ocserv speaks the OpenConnect / Cisco AnyConnect SSL-VPN protocol, so a wide range of clients work. The connection target is your server URL — including the camouflage secret if camouflage is enabled.
If camouflage is on, every example below must use
https://host:port/?your-secretas the server URL.
# Trusted (Let's Encrypt) cert
sudo openconnect https://vpn.example.com:8443 --user=alice
# With camouflage secret
sudo openconnect "https://vpn.example.com:8443/?your-secret" --user=alice
# Self-signed cert — pin it instead of disabling verification
FPRINT=$(openssl x509 -noout -fingerprint -sha256 -in server-cert.pem | cut -d= -f2 | tr -d ':')
sudo openconnect --servercert "sha256:$FPRINT" https://SERVER_IP --user=alice
# Non-interactive password
echo 'S3cret' | sudo openconnect https://vpn.example.com:8443 --user=alice --passwd-on-stdin-
Server address:
https://vpn.example.com:8443/?your-secret -
Username / password: from your
ocpasswdusers - Enabled server-side by
cisco-client-compat = true(already set in the samples).
Use the official OpenConnect app (or Cisco Secure Client / AnyConnect):
- Add a connection with the server URL (with the secret if camouflaging).
- Enter username/password.
- A trusted certificate avoids manual "untrusted cert" prompts.
Keenetic supports OpenConnect as a client. Netcraze routers are the same hardware/firmware family rebranded for different markets, so everything here applies to them identically. Notes specific to routers:
- Put the full URL including
/?your-secretin the connection's server field. - Username/password from
ocpasswd. - TCP-only works well with this image's recommended setup (DTLS/UDP is often disabled — see Configuration Reference#ports).
A connected tunnel does not automatically send the router's LAN traffic through the VPN. By default these routers keep their ISP as the default route. To actually use the VPN for traffic you configure connection priorities / policy-based routing on the router:
- Per-device policy (recommended for testing): create a connection-priority profile that uses the OpenConnect connection and assign just one test device to it. Everything else keeps the ISP.
- Full tunnel for everyone: raise the VPN above the ISP in the internet-connection priority list.
This is a router-side decision — the server already advertises route = default. See Networking NAT and Routing#full-vs-split-tunnel.
Authenticating is not the same as carrying traffic. After connecting:
- From the client (or the router's diagnostics/ping tool), ping the VPN gateway:
10.20.0.1(youripv4-network.1). A reply proves the tunnel data path. - Then ping a public IP, e.g.
1.1.1.1, to prove routing + NAT end-to-end.
Watch it from the server side — see Troubleshooting#how-do-i-prove-the-tunnel-actually-works.
ocserv-server · MIT License · Built on ocserv + s6-overlay