TunnelConfig is immutable and built with TunnelConfig.Builder. Validation runs in init when you call build().
TunnelConfig
├── Interface — address (CIDR), privateKey (Base64), listenPort (Long)
└── Peer — publicKey (Base64), allowedIps (List), endpoint (String)
IPv4 with CIDR, e.g. 10.0.0.2/24, 192.168.1.5/32.
Private and peer public keys must match:
- 44 characters
- Base64 alphabet
- Trailing
=
1–65535 as Long in the builder (setListenPort(51820L)).
Non-empty list of IPv4 CIDR strings, e.g. listOf("0.0.0.0/0") for full IPv4 tunnel.
Important: validation currently accepts IPv4:port only (e.g. 198.51.100.10:51820). Hostnames are not accepted by the regex; resolve DNS in your app first if you need a hostname.
Pass a list of package names as the third argument to WireLingVpn.startVpnTunnel, or null for none. Semantics follow the underlying tunnel implementation.
Next: Troubleshooting