Back to Guides

Ipfire and Mullvad VPN

IPFire does not currently have a native OpenVPN client configuration.

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.

 

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 (193.138.219.228) 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@192.168.10.1:/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/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_sweden.ovpn
         done

 

Reboot IPFire and it should be working!