Go back to topic: How to configure Whonix to use Mullvad
This | This guide offers a way to use Whonix Workstation with Mullvad as its NetVM. Which could be needed when you seek similar security and (pseudo)anonymity advantages of the Whonix Workstation, but prefer not to use Tor as your NetVM. |
6. Setup the systemd path and service units ```sudoedit /etc/systemd/system/resolv-reload.path``` | 6. Setup the systemd path and service units Create your path unit ```sudoedit /etc/systemd/system/resolv-reload.path``` |
Create your service unit ```sudoedit /etc/systemd/system/resolv-reload.service``` | |
Extra step for Fedora / SElinux to put the SElinux tag for systemd: ``` /sbin/restorecon -v /etc/systemd/system/resolv-reload.* ``` | |
9. (Optional) Add these firewall rules to `/rw/config/qubes-firewall-user-script` to add another killswitch in case Mullvad`s fails for whatever reason |
6. | 6. Setup the systemd path and service units ```sudoedit /etc/systemd/system/resolv-reload.path``` ``` [Path] PathModified=/etc/resolv.conf [Install] WantedBy=multi-user.target ``` In ```sudoedit /etc/systemd/system/resolv-reload.service``` ``` [Service] ExecStart=/usr/local/bin/mullvad-dns.sh Type=oneshot ``` Enable it to start on boot ``` systemctl daemon-reload systemctl enable resolv-reload.path ``` |
4. Start your new sys-mullvad Qube and open a terminal. Run the command `sudoedit /usr/local/bin/mullvad-dns.sh` and paste in the following contents: | 4. Start your new sys-mullvad Qube and open a terminal. Run the command ```sudoedit /usr/local/bin/mullvad-dns.sh``` and paste in the following contents: |
mullvad_dns_ip=$( | mullvad_dns_ip=$(awk '/nameserver/ { print $2 ; exit }' /etc/resolv.conf) |
qube_vm_ip=$(hostname -I | awk | qube_vm_ip=$(hostname -I | awk '{print $1}') |
nameserver_ips=$( | nameserver_ips=$(awk '/nameserver/ { print $2 }' /etc/resolv.conf) |
update_dns
| update_dns |
`nft add rule ip qubes custom-forward tcp flags syn / syn,rst tcp option maxseg size set rt mtu` | ```nft add rule ip qubes custom-forward tcp flags syn / syn,rst tcp option maxseg size set rt mtu``` |
3. Run this script by Tommy from PrivSec to minimize the template and reduce the attack surface: | 3. Run this script by Tommy from PrivSec to minimize the template and reduce the attack surface: [fedora-gnome.sh script](https://github.com/magazine-qubes/QubesOS-Scripts/blob/main/fedora-gnome/fedora-gnome.sh) |
Big thanks to | Big thanks to @solene and @TommyTran732 from PrivSec as this guide is a mash of both their guides plus a bit of my own. |
Template setup is complete! Now, let’s configure Mullvad for networking. | |
```nft add rule qubes custom-forward oifname eth0 counter drop
nft add rule ip6 qubes custom-forward oifname eth0 counter drop```
| ``` nft add rule qubes custom-forward oifname eth0 counter drop nft add rule ip6 qubes custom-forward oifname eth0 counter drop ``` Keep in mind that when you create an AppVM with your sys-mullvad qube, it must be based on the whonix-workstation-17-vpn template. Big thanks to Solene and Tommy from PrivSec as this guide is a mash of both their guides plus a bit of my own. |