Back to Guides

Using pfSense with Mullvad

Setting up pfSense to connect to Mullvad, in this guide we will connect to the Swedish servers.

When there is an apply icon always click it in this guide so that you reload the new settings.
Keep in mind that this guide is written for pfSense 2.4 or later.

 

Get your ca.crt

  1. In a browser open our website: www.mullvad.net
  2. Click on Download Client.
  3. Click on iOS, Android and other platforms.
  4. Select Linux under Platform by using the drop-down menu.
  5. Enter your account number.
  6. Select a region.
  7. Click on Download and save it to your computer.
  8. Extract the file.

 

Add the Ca.crt to the Certificate Manager.

  1. Log in to your PfSense device click on "System" -> "Cert manager"  -> "CAs" and then click on "+Add"
  2. Edit the descriptive name and name it Mullvad CA .
  3. Paste the second certificate found in mullvad_ca.crt that was extracted earlier into the "Certificate data" field.
  4. Click on Save.

 

Add a VPN connection

Click on VPN -> OpenVPN -> Clients  and then click on +Add

  1. Set Server Mode to: Peer to Peer (SSL/TLS)
  2. Set Protocol to: UDP
  3. Set Device mode to: tun Layer 3 Tunnel Mode
  4. Set Interface to: WAN
  5. Set Server host to: se.mullvad.net
  6. Set Server port to: 1301
  7. Set Description to: Mullvad Sweden
  8. Set your mullvad account number as Username under User Authentication Settings
  9. set M as Password under User Authentication Settings
  10. Set TLS Configuration to: Unchecked
  11. Set Peer: Certificate Authority to: Mullvad CA
  12. Set Client Certificate to: None (Username or Password required)
  13. Set Encryption Algorithm to: AES-256-CBC
  14. Set Enable Negotiate Cryptographic Parameters to: Checked
  15. Set Auth digest Algorithm to: SHA1
  16. Set Compression to: LZO Compression [Legacy style, comp-lzo yes]
  17. Set UDP Fast I/O to : checked
  18. Set Send/Recieve buffer to 512KiB
  19. Click on Save .

 

Add an Interface 

  1. Click on Interfaces -> Interface assignments
  2. Use the Drop-down menu for the Available network ports: and select ovpnc* (Mullvad - Sweden)  and then click on +Add
  3. Click on the New interface name, it is usually named OPT1 or OPT2.
  4. Set Enable:  Enable Interface to be checked
  5. Click on Save.

Add NAT rules

  1. Click on Firewall -> NAT -> Outbound and then select Mode: "Manual Outbound NAT rule Generation (AON) and then click on Save.
  2. Copy the entry that contains your local IP address (The one that does not contain port 500 nor 127.0.0.0 , In this example 172.17.1.0/24 is used, for you this will most like differ and will probably be 192.168.1.0/24)  by clicking on the Copy icon found under Actions to the right of the NAT entry (Add a new mapping based on this one)
  3. Click on the Pen icon (Edit mapping)  and change so that interface is the mullvad one and write a description.
  4. Make sure that both Disabled and do not NAT are unchecked
  5. Delete the other rules that contain your local IP that exists via WAN , (keep the 127.0.0.0) This will ensure that you can not reach the internet if the VPN tunnel is down from your clients behind the pfSense router.
  6. Click on Save.

DNS

  1. Click on Services
  2. Click on DHCP server
  3. Set DNS server 1 to: 193.138.219.228
  4. Set DNS server 2 to: 10.8.0.1
  5. Click on Save

 

After you have completed these steps, click on VPN -> OpenVPN -> Related status icon and then click on the Restart openvpn Service found under Service to reload it all. Then on your client computers, go to https://ifconfig.co to see that they are working as intended.

 

Troubleshooting:

 

Q: I am running an older version of pfSense (2.3.x) and some things are not available or renamed, where do I configure them?

  • TLS authentication is now called TLS Configuration
  • UDP Fast I/O is not available as a checkbox icon pfSense 2.3.x
  • Send / Receive Buffers dropdown menu is not available on pfSense 2.3.x