Overview
Themullvad relay command manages relay selection constraints including location, provider, ownership, and custom relay configurations.
Syntax
Subcommands
get
Display current relay constraints:set
Configure relay constraints:list
List all available relays:update
Update the relay list from Mullvad API:override
Manage custom IP overrides for specific relays:Set Subcommands
location
Select relay by country, city, or hostname:mullvad relay set location se- Select any relay in Swedenmullvad relay set location se got- Select relay in Gothenburg, Swedenmullvad relay set location se got se-got-wg-004- Select specific relaymullvad relay set location se-got-wg-004- Select by hostname only
custom-list
Use a custom list for relay selection:provider
Filter relays by hosting provider:<PROVIDER>...- One or more provider names, or “any”
ownership
Filter relays by ownership:any- Any relay (owned or rented)owned- Only Mullvad-owned serversrented- Only rented servers
ip-version
Set IP protocol preference:any- IPv4 or IPv6ipv4- IPv4 onlyipv6- IPv6 only
multihop
Enable or disable multihop (double VPN):entry
Configure entry relay for multihop:set location.
custom
Configure a custom WireGuard relay:<HOST>- Hostname or IP address<PORT>- Remote port number<PEER_PUBKEY>- Base64-encoded WireGuard public key<TUNNEL_IP>...- One or more tunnel IP addresses
--v4-gateway <IPV4>- IPv4 gateway address (required)--v6-gateway <IPV6>- IPv6 gateway address (optional)
Override Subcommands
override get
Show current relay IP overrides:override set
Set custom IP for a relay:override unset
Remove IP override for a relay:override clear-all
Remove all relay overrides:-y,--confirm- Skip confirmation prompt
Examples
Display Current Constraints
List Available Relays
Select Relay by Location
Select country:Configure Multihop
Enable multihop:Filter by Provider
Filter by Ownership
Only owned servers:Update Relay List
Set Custom Relay
Override Relay IP
Set custom IPv4:View Overrides
Remove Override
Clear All Overrides
Related Commands
- connect - Connect using current relay constraints
- status - View currently connected relay
- custom-list - Manage custom relay lists
- tunnel - Configure tunnel options
Exit Status
| Code | Description |
|---|---|
| 0 | Command executed successfully |
| 1 | Invalid location, provider, or configuration |
Notes
- Relay selection is hierarchical: location → provider → ownership → IP version
- Setting a custom endpoint removes all other constraints
- Multihop requires WireGuard and uses two relays (entry and exit)
- Overrides are useful for testing or accessing relays with special network configurations
- The relay list is cached locally and updated periodically
- Invalid locations are validated against the current relay list
Source Reference
Implementation:mullvad-cli/src/cmds/relay.rs