Skip to main content

Overview

The mullvad relay command manages relay selection constraints including location, provider, ownership, and custom relay configurations.

Syntax

mullvad relay <SUBCOMMAND>

Subcommands

get

Display current relay constraints:
mullvad relay get

set

Configure relay constraints:
mullvad relay set <CONSTRAINT>

list

List all available relays:
mullvad relay list

update

Update the relay list from Mullvad API:
mullvad relay update

override

Manage custom IP overrides for specific relays:
mullvad relay override <SUBCOMMAND>

Set Subcommands

location

Select relay by country, city, or hostname:
mullvad relay set location <COUNTRY> [CITY] [HOSTNAME]
mullvad relay set location <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:
mullvad relay set custom-list <LIST_NAME>
See custom-list for managing lists.

provider

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

ownership

Filter relays by ownership:
mullvad relay set ownership <OWNERSHIP>
Values:
  • any - Any relay (owned or rented)
  • owned - Only Mullvad-owned servers
  • rented - Only rented servers

ip-version

Set IP protocol preference:
mullvad relay set ip-version <VERSION>
Values:
  • any - IPv4 or IPv6
  • ipv4 - IPv4 only
  • ipv6 - IPv6 only

multihop

Enable or disable multihop (double VPN):
mullvad relay set multihop <on|off>

entry

Configure entry relay for multihop:
mullvad relay set entry location <COUNTRY> [CITY] [HOSTNAME]
mullvad relay set entry custom-list <LIST_NAME>
Same location format as set location.

custom

Configure a custom WireGuard relay:
mullvad relay set custom <HOST> <PORT> <PEER_PUBKEY> <TUNNEL_IP>... [OPTIONS]
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:
mullvad relay override get

override set

Set custom IP for a relay:
mullvad relay override set ipv4 <HOSTNAME> <ADDRESS>
mullvad relay override set ipv6 <HOSTNAME> <ADDRESS>

override unset

Remove IP override for a relay:
mullvad relay override unset ipv4 <HOSTNAME>
mullvad relay override unset ipv6 <HOSTNAME>

override clear-all

Remove all relay overrides:
mullvad relay override clear-all [--confirm]
Options:
  • -y, --confirm - Skip confirmation prompt

Examples

Display Current Constraints

mullvad relay get
Output:
Generic constraints
        Location: Gothenburg, Sweden (got, se)
        Provider(s): any
        Ownership: any
WireGuard constraints
        IP protocol: any
        Multihop state: disabled

List Available Relays

mullvad relay list
Output:
Sweden (se)
        Gothenburg (got) @ 57.70887°N, 11.97456°W
                se-got-wg-001 (10.10.1.1, 2a03:...) - hosted by 31173 (Mullvad-owned)
                se-got-wg-004 (10.10.1.4, 2a03:...) - hosted by 31173 (Mullvad-owned)

United States (us)
        New York (nyc) @ 40.71427°N, -74.00597°W
                us-nyc-wg-301 (10.20.1.1) - hosted by M247 (rented)

Select Relay by Location

Select country:
mullvad relay set location se
Select city:
mullvad relay set location us nyc
Select specific relay:
mullvad relay set location se-got-wg-004

Configure Multihop

Enable multihop:
mullvad relay set multihop on
Set entry location:
mullvad relay set entry location se
Set exit location (regular location constraint):
mullvad relay set location us

Filter by Provider

mullvad relay set provider 31173

Filter by Ownership

Only owned servers:
mullvad relay set ownership owned
Only rented servers:
mullvad relay set ownership rented

Update Relay List

mullvad relay update
Output:
Updating relay list in the background...

Set Custom Relay

echo "private-key-base64" | mullvad relay set custom \
  vpn.example.com \
  51820 \
  peer-public-key-base64 \
  10.64.0.1 fc00::1 \
  --v4-gateway 10.64.0.1 \
  --v6-gateway fc00::1

Override Relay IP

Set custom IPv4:
mullvad relay override set ipv4 se-got-wg-004 10.10.10.10
Set custom IPv6:
mullvad relay override set ipv6 se-got-wg-004 2a03:1b20:5:f011::a10f

View Overrides

mullvad relay override get
Output:
Sweden (se)
    Gothenburg (got)
        se-got-wg-004:
            ipv4: 10.10.10.10
            ipv6: 2a03:1b20:5:f011::a10f

Remove Override

mullvad relay override unset ipv4 se-got-wg-004

Clear All Overrides

mullvad relay override clear-all
Output:
Are you sure you want to clear all overrides? [Y/n]
  • connect - Connect using current relay constraints
  • status - View currently connected relay
  • custom-list - Manage custom relay lists
  • tunnel - Configure tunnel options

Exit Status

CodeDescription
0Command executed successfully
1Invalid 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

Build docs developers (and LLMs) love