Many servers are only reachable through a VPN. In MorphGate you attach a VPN profile to a host, and the VPN comes up when you connect to that host. It runs inside the app, only for the hosts that use it.
Nothing on your system changes
Each VPN runs inside MorphGate with its own network stack. There is no network interface, no change to your routes and nothing that needs administrator rights. The rest of your computer keeps using your normal network.
Because each VPN is separate, several can be up at the same time, even when two clients use the same private address range (for example two networks that are both 10.0.0.0/24).
Supported VPNs
- WireGuard
- Built in. Import a WireGuard configuration in wg-quick format (a
.conffile, or paste it). A configuration can have several[Peer]sections: each carries the traffic for its ownAllowedIPs, and one gateway that doesn't answer doesn't stop the others.PostUpandPostDownscripts are ignored. The private key is stored only in your encrypted vault. The VPN's page shows Your key, the public key to give the VPN's admin. - OpenVPN
- Built in. Import the
.ovpnprofile your VPN admin gave you, or paste it. If the profile refers to separate files (ca,cert,key,pkcs12,tls-auth,tls-cryptand so on), choose them together with the profile; they are embedded in your vault. A pasted profile needs those files inline. Scripts and route settings are ignored. Client certificates can be a separate certificate and key, a PKCS#12 bundle, or a passphrase-protected key.tls-auth,tls-cryptandtls-crypt-v2are supported. - OpenConnect
- For Cisco AnyConnect and ocserv, Palo Alto GlobalProtect, Fortinet FortiGate, Pulse and Ivanti Connect Secure, F5 BIG-IP, Juniper Network Connect and Array Networks servers. MorphGate uses the
openconnectprogram for the VPN protocol and keeps the traffic inside the app. Installopenconnectfirst (see Install and update). Not available on Windows, phones or tablets.
Add a VPN
- Choose VPNs in the sidebar, then New VPN. On a phone, open the VPNs tab and tap the plus button.
- Pick WireGuard, OpenVPN or OpenConnect, and give it a Name. Leave the name empty for one made from the server's address.
- For WireGuard, choose From .conf file and Choose file…, or Paste config.
- For OpenVPN, choose From .ovpn file and Choose files…, and select the
.ovpnfile along with any files it refers to. Or choose Paste profile. - For OpenConnect, enter the Server, pick the Protocol, and fill in Group (optional) if your admin gave you one. Leave it empty to be asked when connecting, if the server has groups.
- For OpenVPN and OpenConnect, enter a Username and Password, or leave them empty to type them when connecting.
- Choose Save.
If the profile refers to a file you didn't choose, MorphGate says so, for example "the profile refers to ca.crt: choose the .ovpn file and ca.crt together". A saved VPN keeps its type; to switch to another type, create a new VPN.
Then open a host's editor and pick the VPN under VPN. A group can set a VPN for all its hosts.
Connecting
- The VPN comes up when a session, file browser or tunnel needs it, and stops when the last connection using it closes. Hosts that share a VPN share one tunnel.
- If the VPN needs something from you, MorphGate asks in a dialog: a username and password you didn't save, a one-time code, the group, or the passphrase of a protected client key (Key passphrase or Bundle password, unless the profile includes it). Choose Continue, or Cancel to stop connecting.
- If the VPN server wants you to sign in on a web page (single sign-on), MorphGate opens the page in your browser and shows "Finish signing in in your browser". The VPN connects as soon as the server confirms the sign-in, and the dialog closes by itself. Choose Open again if the page didn't open, or Cancel. This works for OpenVPN servers that ask for it, and for Cisco AnyConnect servers that offer sign-in in an external browser (openconnect 9 or later).
- For OpenConnect, if the server's certificate isn't trusted by your computer, MorphGate shows Untrusted VPN server with its fingerprint. Compare it with the one your VPN admin gave you, then choose Trust and connect. MorphGate remembers it for this VPN. To forget it, open the VPN and choose Forget next to the pinned certificate. Changing the VPN's server forgets it too.
- Test on a saved VPN's page connects once and shows the server, the address you got and how long it took.
The VPN's page shows its status (Idle: starts when a host needs it, or Connected as an address) and which hosts use it. The VPNs page lists every VPN with its kind, server, what uses it and its state: Up, Down, or Problem with the problem under its name. In the sidebar, VPNs shows how many are up, and hosts that connect through a VPN are marked VPN.
Host names inside the VPN
When you connect to a host by name, MorphGate first asks the VPN's own DNS servers, so internal names work. A short name such as db1 is tried with the VPN's search domains first. If the VPN's DNS doesn't know the name, or the VPN has none, your computer's normal DNS is asked instead.
For WireGuard, only the server addresses on the DNS line are used; search domains on that line are ignored, so use full names.
VPNs and jump hosts
A VPN carries the first hop of a connection. If a host uses a jump host, it uses the jump host's VPN, not its own. See Jump hosts.
Locking and quitting
Locking the vault, by hand or when idle, closes every VPN along with terminals, file browsers and tunnels. So does quitting MorphGate.
If the VPN server drops the connection, the sessions through it end. MorphGate doesn't reconnect it by itself: the next session, file browser or tunnel that needs it starts it again.
If it doesn't connect
- "no WireGuard handshake with …": check the endpoint, the keys, and that your network doesn't block UDP.
- "no answer from …" for OpenVPN: the address or port is wrong, UDP is blocked, or the profile's
tls-authortls-cryptkey doesn't match the server's. - "openconnect is not installed": install it (see Install and update).
- "connection through the VPN timed out": the VPN is up, but the host is down or the port is filtered. If the host's address isn't in the networks the VPN announced, the message says so.
- A VPN that hosts or groups still use can't be deleted. MorphGate lists them, for example
VPN "Client A" is still used by: web1. Pick another VPN for them first.
Not supported
- OpenConnect on Windows, phones and tablets. WireGuard and OpenVPN work everywhere.
- OpenVPN TAP (layer 2) VPNs, static-key profiles (
secret), connecting through an HTTP or SOCKS proxy,fragment, certificates in hardware tokens or system certificate stores, and TLS below 1.2. MorphGate names the line it can't use when you save the profile. - OpenVPN certificate revocation lists (
crl-verify) are not checked. - Only TCP connections go through a VPN: SSH sessions, file browsers and tunnels. There is no UDP, so
pingto a host behind the VPN doesn't work. - In a view-only shared vault, MorphGate can't remember an OpenConnect certificate you trust, so it asks again each time.