Skip to main content

Overview

The mullvad 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:
Examples:
  • mullvad relay set location se - Select any relay in Sweden
  • mullvad relay set location se got - Select relay in Gothenburg, Sweden
  • mullvad relay set location se got se-got-wg-004 - Select specific relay
  • mullvad relay set location se-got-wg-004 - Select by hostname only

custom-list

Use a custom list for relay selection:
See custom-list for managing lists.

provider

Filter relays by hosting provider:
Arguments:
  • <PROVIDER>... - One or more provider names, or “any”
Example:

ownership

Filter relays by ownership:
Values:
  • any - Any relay (owned or rented)
  • owned - Only Mullvad-owned servers
  • rented - Only rented servers

ip-version

Set IP protocol preference:
Values:
  • any - IPv4 or IPv6
  • ipv4 - IPv4 only
  • ipv6 - IPv6 only

multihop

Enable or disable multihop (double VPN):

entry

Configure entry relay for multihop:
Same location format as set location.

custom

Configure a custom WireGuard relay:
Arguments:
  • <HOST> - Hostname or IP address
  • <PORT> - Remote port number
  • <PEER_PUBKEY> - Base64-encoded WireGuard public key
  • <TUNNEL_IP>... - One or more tunnel IP addresses
Options:
  • --v4-gateway <IPV4> - IPv4 gateway address (required)
  • --v6-gateway <IPV6> - IPv6 gateway address (optional)
The command reads the private key from standard input.

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:
Options:
  • -y, --confirm - Skip confirmation prompt

Examples

Display Current Constraints

Output:

List Available Relays

Output:

Select Relay by Location

Select country:
Select city:
Select specific relay:

Configure Multihop

Enable multihop:
Set entry location:
Set exit location (regular location constraint):

Filter by Provider

Filter by Ownership

Only owned servers:
Only rented servers:

Update Relay List

Output:

Set Custom Relay

Override Relay IP

Set custom IPv4:
Set custom IPv6:

View Overrides

Output:

Remove Override

Clear All Overrides

Output:
  • connect - Connect using current relay constraints
  • status - View currently connected relay
  • custom-list - Manage custom relay lists
  • tunnel - Configure tunnel options

Exit Status

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