Back to Guides

IPFire and Mullvad VPN

IPFire currently does not have a native OpenVPN client configuration.

In this example, we have set the IPFire device to 192.168.10.1 and it will assign 192.168.10.100 - 192.168.10.150 to clients connected to it via DHCP.
 

Download configuration file

  1. First, go to our download page for configuration files.
  2. Enter your account number in the first field.
  3. Select Android from the Platform field.
  4. Select your desired region in the Region field (in this example, we chose Sweden).
  5. Click on the Download button.


 

Connect to IPFire IP

In your browser, connect to your IPFire IP. If this is the first time, you might be shown a page like the one below.

If so, you'll need to click on Advanced, then Add exception, and finally you'll need to enter your IPFire username and password to log in.
 

SSH Settings

  1. Click on System and then SSH access to reach the SSH settings.
  2. Enable SSH access by checking the SSH Access checkbox and then click on Save.
  3. Click on Firewall --> Firewall Options. Next to Masquerade GREEN, choose Masquerading disabled, then click on Save.
     

Assign DNS server

  1. Click on Network and then Assign DNS-SERVER.
  2. Enter the DNS you wish to use. In this example, we use the Mullvad DNS (193.138.219.228) as primary.
  3. Click on Save.

     

Upload Mullvad config file

Upload the mullvad_config_xx.ovpn file to the IPFire machine with scp (or copy and paste it). You will need to replace xx in the file name with the corresponding letters of the config file you downloaded.

scp -P 222 mullvad_config_xx.ovpn root@192.168.10.1:/root/

Issue the following commands in a terminal on the IPFire machine.

cat mullvad_config_xx.ovpn | grep -v "tun-ipv6\|update-resolv-conf" | sed s'/ping-restart 60/ping-exit 30/' > mullvad_config_xx.ovpn
echo "modprobe tun" >> /etc/sysconfig/rc.local
echo "/root/mullvad.sh &" >> /etc/sysconfig/rc.local
echo "iptables -I FORWARD ! -o tun0 -m iprage --src-range 192.168.10.100-192.168.10.150 -j DROP" >> /etc/sysconfig/rc.local
echo "iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o tun0 -j MASQUERADE" >> /etc/sysconfig/rc.local
chmod 755 /root/mullvad.sh

Add mullvad.sh script to /root/.

#!/bin/bash
     COUNTER=0
         while [  $COUNTER -lt 1 ]; do
             openvpn --config /root/mullvad_config_xx.ovpn
         done

 

Reboot IPFire

Reboot your IPFire and it should be working!
 

Easily check your online privacy with Am I Mullvad

While you're connected to Mullvad, your browser could still be leaking information and therefore jeopardizing your privacy. With our Am I Mullvad online tool, you can now get a quick overview of your connection status.