Back to Guides

Port forwarding with Mullvad

Follow these steps to add and manage your forwarded ports with Mullvad.

What this guide covers:

What is port forwarding?

Port forwarding makes it possible for remote computers to access a specific computer or service within a private local area network (LAN).

For example, Gunilla has a web server on her private LAN that she wants Glenn to visit. She first requests a port to be forwarded to her. Then she configures her web server to listen to that port for any other traffic. Glenn can then connect to the exit IP address of the VPN server that Gunilla is using, as well as the port number, and voila – he has access!

It's like dialing a company's phone number (the IP address) and then punching in the extension number (port) to reach a particular person.
 

Add ports via Mullvad website

The simplest way to add and manage your ports is via our website. These instructions work for any operating system.

  1. Log in to your Mullvad account page.
  2. Under "Manage your forwarded ports," click on "Add port." The account page will refresh with a new port number.
  3. To remove a port, simply click on the corresponding number.

Use any of your assigned port numbers to allow external hosts to access your local network.

Note: you cannot request a specific port.
 

Test your port forwarding

Once you've added a port, you can check to make sure that it's working.

Do you have a service listening on the port?

  • Yes – you can use our port-checking tool to test your port.
  • No – such a service is necessary if you want to test your port. Install the service of your choice or follow our instructions below to install iPerf.

How to install iPerf

Although the following steps are specific for Windows users, the instructions are similar for other operating systems.

  1. In a browser, navigate to https://iperf.fr and click on "Download iPerf binaries."
  2. Scroll down to your operating system and click on the iPerf link to download the file.
  3. Open the ZIP file and copy the folder within it.
  4. Open your Downloads folder and paste in the folder you just copied.
  5. Right-click on the Windows Start icon and click on "Run" to open the terminal.
  6. In the command prompt, enter each the following commands, pressing the Enter key after each one:
    1. cd Downloads
    2. cd iperf-3.1.3-win64
    3. iperf3.exe -s -p 5410
      (Replace "5410" with the port that you have been assigned.)
  7. In the Windows Firewall pop-up window, click on "Allow access". If you have a third-party firewall, please make sure that it is not restrictive.
  8. The iPerf service is now installed.
  9. Now you can test your port with our port-checking tool.
     

Linux-specific instructions for port testing

After adding a port via the Mullvad website, follow these instructions, replacing 5555 with the port that you are assigned:

  1. Install curl if you don't already have it.
  2. In a terminal, issue "netcat -l -p 5555".
  3. In another terminal, issue "curl ifconfig.co/port/5555".

If everything is working properly, the result will show "reachable:true".
 

Troubleshooting

Encountering problems? Check the following:

  • Make sure that you disconnect and reconnect the Mullvad client after adding a port.
  • If you are using multiple devices that share the same account and connect to the same server, then only the most recently connected device will have the ports forwarded to it.
  • Make sure that you don't have a third-party firewall that might be blocking your efforts.