Skip to content

VPN Provider Integration

Bifrost supports native integration with major VPN providers, enabling automatic server selection, credential management, and seamless VPN connections without manual configuration.

ProviderAuth MethodWireGuardOpenVPNAuto-Select
NordVPNNone (public API)Yes (NordLynx)YesYes
MullvadAccount numberYesYesYes
PIAUsername/PasswordYesYesYes
ProtonVPNOpenVPN credentialsNoYesYes

NordVPN integration uses the public NordVPN API. No credentials are required for server list access.

backends:
- name: nordvpn-us
type: nordvpn
enabled: true
config:
country: "US" # ISO country code (required)
city: "New York" # Optional: specific city
protocol: "wireguard" # wireguard or openvpn
auto_select: true # Auto-select best server by load
max_load: 50 # Skip servers above this load percentage
OptionTypeDefaultDescription
countrystringrequiredISO 3166-1 alpha-2 country code
citystring""City name (optional)
protocolstring”wireguard”Protocol: “wireguard” or “openvpn”
auto_selectbooltrueAuto-select server with lowest load
max_loadint0Skip servers above this load (0 = no limit)
server_idstring""Connect to specific server by ID

NordVPN selects servers based on:

  1. Country and city filters
  2. Protocol support (WireGuard/NordLynx or OpenVPN)
  3. Server load (lowest load preferred)
  4. Feature requirements (P2P, streaming, etc.)

NordVPN servers support various features:

  • standard - Standard VPN servers
  • p2p - Optimized for P2P/torrenting
  • double_vpn - Double VPN for extra privacy
  • onion_over_vpn - Onion routing
  • dedicated_ip - Dedicated IP servers
config:
country: "NL"
features:
- "p2p"

Mullvad uses a 16-digit account number for authentication. No email or password required.

  1. Visit mullvad.net
  2. Create an account or use existing
  3. Your 16-digit account number is shown on the dashboard
backends:
- name: mullvad-de
type: mullvad
enabled: true
config:
account_id: "1234567890123456" # 16-digit account number
country: "DE"
city: "" # Optional
protocol: "wireguard"
auto_select: true
OptionTypeDefaultDescription
account_idstringrequired16-digit Mullvad account number
countrystringrequiredISO country code
citystring""City name (optional)
protocolstring”wireguard”Protocol: “wireguard” or “openvpn”
auto_selectbooltrueAuto-select best server

When using WireGuard, Bifrost automatically:

  1. Generates a WireGuard key pair
  2. Registers the public key with Mullvad
  3. Receives the assigned IP address
  4. Configures the tunnel

Keys are cached and reused across restarts.

  • Keep your account number secure
  • The account number is the only authentication
  • Consider using environment variables:
config:
account_id: "${MULLVAD_ACCOUNT}"

PIA uses username/password authentication with token-based sessions.

  1. Log in to privateinternetaccess.com
  2. Find your PIA username (looks like p1234567)
  3. Your password is set during signup
backends:
- name: pia-uk
type: pia
enabled: true
config:
username: "p1234567"
password: "${PIA_PASSWORD}" # Use env var for security
country: "UK"
protocol: "wireguard"
port_forwarding: true
OptionTypeDefaultDescription
usernamestringrequiredPIA username
passwordstringrequiredPIA password
countrystringrequiredISO country code
citystring""City name (optional)
protocolstring”wireguard”Protocol: “wireguard” or “openvpn”
port_forwardingboolfalseEnable PIA port forwarding

PIA supports port forwarding on select servers. When enabled:

  1. Bifrost requests a forwarded port after connection
  2. The assigned port is logged
  3. Port forwarding auto-renews while connected
config:
country: "NL" # Port forwarding supported
port_forwarding: true

Note: Port forwarding is not available in all regions.

PIA uses token-based authentication:

  1. Initial login with username/password
  2. Receives access token
  3. Token used for subsequent API calls
  4. Auto-refresh when token expires

ProtonVPN integration uses manual OpenVPN credentials mode due to API limitations.

  1. Log in to account.protonvpn.com
  2. Navigate to DownloadsOpenVPN / IKEv2 username
  3. Copy your OpenVPN username (looks like username+pmp)
  4. Generate or view your OpenVPN password

Important: These are NOT your Proton account credentials!

backends:
- name: proton-ch
type: protonvpn
enabled: true
config:
username: "username+pmp"
password: "${PROTON_PASSWORD}"
country: "CH"
tier: "plus"
secure_core: false
protocol: "openvpn"
OptionTypeDefaultDescription
usernamestringrequiredOpenVPN/IKEv2 username
passwordstringrequiredOpenVPN password
countrystringrequiredISO country code
citystring""City name (optional)
tierstring”free”Account tier: free, basic, plus, visionary
secure_coreboolfalseUse Secure Core servers
protocolstring”openvpn”Only “openvpn” supported

ProtonVPN has different tiers with different server access:

TierDescription
freeFree servers (limited locations)
basicBasic paid tier
plusPlus tier (full server access)
visionaryVisionary tier

Secure Core routes traffic through privacy-friendly countries before exiting:

config:
country: "US"
secure_core: true # Routes via CH/IS/SE first

Secure Core servers provide extra privacy but may reduce speed.

  • WireGuard not supported: ProtonVPN’s WireGuard (NetShield) requires their app
  • OpenVPN only: Uses standard OpenVPN protocol
  • Manual credentials: Requires obtaining credentials from account portal

graph TD
A[User Config] --> B[Backend Factory]
B --> C{Provider Type}
C -->|nordvpn| D[NordVPN Provider]
C -->|mullvad| E[Mullvad Provider]
C -->|pia| F[PIA Provider]
C -->|protonvpn| G[ProtonVPN Provider]
D --> H[Provider API]
E --> I[Provider API]
F --> J[Provider API]
G --> K[Server List Cache]
H --> L[Server Selection]
I --> L
J --> L
K --> L
L --> M[WireGuard Backend]
L --> N[OpenVPN Backend]

Server lists are cached to reduce API calls:

  • Default TTL: 6 hours
  • Cache location: In-memory
  • Refresh: Automatic on expiration or manual via API
Terminal window
# Refresh all provider caches
curl -X POST http://localhost:7080/api/v1/providers/refresh
# Refresh specific provider
curl -X POST http://localhost:7080/api/v1/providers/nordvpn/refresh
  1. Check credentials: Verify username/password or account ID
  2. Check server availability: Some servers may be overloaded
  3. Try different server: Use server_id to test specific servers
  4. Check protocol support: Ensure selected protocol is available
ProviderErrorSolution
NordVPNN/ANo auth required
MullvadInvalid accountVerify 16-digit number
PIAAuth failedCheck username (p-number) and password
ProtonVPNAuth failedUse OpenVPN credentials, not account login
  • Check internet connectivity
  • Verify country code is valid
  • Check provider API status
  • Try clearing cache and refreshing
  1. Select closer servers: Use country/city filters
  2. Avoid overloaded servers: Set max_load limit
  3. Use WireGuard: Generally faster than OpenVPN
  4. Check MTU settings: May need adjustment for your network
  1. Use environment variables for passwords:

    config:
    password: "${VPN_PASSWORD}"
  2. Secure your config file:

    Terminal window
    chmod 600 config.yaml
  3. Don’t commit credentials to version control

  4. Rotate credentials periodically

  5. Monitor connections for unexpected behavior