Back to Guides

Ipfire and Mullvad VPN

IPFire does not currently have a native OpenVPN client configuration.

We have set the IPFire device to and it will assign - to clients connected to it via DHCP.


Click on Download Client


Click on Instructions and configuration files

Click on the Android Tab, Fill in your account number, select a country and then download the configuration file by clicking on Get config, make sure you save it to your computer.



In your browser connect to your IPFire IP, if it is the first time, then click on Advanced and then Add execption, and after that enter user name and password to log in.

Click on System and then SSH access to reach the SSH settings

Enable SSH acces by checking the SSH Access checkbox and then click on Save

Click on Firewall -> Firewall Options and then disable Masqueading on GREEN, followed by clicking on Save.

Click on Network and then Assign DNS-SERVER
Enter the DNS you wish to use, we use the mullvad DNS ( as primary and then click on Save.


Upload the Mullvad_xx.ovpn to the IPFire machine with scp (or copy and paste it)

scp -P 222 Mullvad_se.ovpn root@


Issue the following commands in a terminal on the IPFire machine

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


Add script to /root/

         while [  $COUNTER -lt 1 ]; do
             openvpn --config /root/mullvad_sweden.ovpn


Reboot IPFire and it should be working!