Overview
Themullvad connect command establishes a VPN connection to a Mullvad relay server based on your current relay constraints.
Syntax
Options
| Option | Description |
|---|---|
-w, --wait | Wait until connected before exiting |
-h, --help | Print help information |
Behavior
When you runmullvad connect:
- The CLI checks if you’re logged in to a Mullvad account
- If not logged in, it displays a warning and blocks all network traffic until you:
- Log in to an account with available time/credits
- Disconnect from the VPN
- If logged in, it initiates a connection to a relay matching your current constraints
Examples
Basic Connection
Connect to a VPN relay without waiting:Wait for Connection
Connect and wait until the connection is fully established:Connection with Short Option
Related Commands
- disconnect - Disconnect from the VPN
- status - Check current connection status
- relay set location - Configure which relay to connect to
- account - Manage your Mullvad account
Exit Status
| Code | Description |
|---|---|
| 0 | Connection initiated successfully (or established if --wait used) |
| 1 | Failed to connect or not logged in |
Notes
- If you’re not logged in when connecting, Mullvad will block all network traffic as a security measure
- Use
mullvad statusto monitor connection progress - The relay selection is based on your current relay constraints
- Connection attempts respect your tunnel configuration settings
Source Reference
Implementation:mullvad-cli/src/cmds/tunnel_state.rs:7