This is what I follow and use ProtonVPN or any VPN on Linux (albeit with less flexibility but with certainty):
Wireguard VPN via Terminal with Killswitch:
Download config file
Open config file
Add the following under “Interface” section:
> PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
> PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT && ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
Save file
Add file in folder: admin:///etc/wireguard
Enter this in terminal: systemctl enable wg-quick@config-file-name
Enter system password to authenticate when prompted
Start VPN: sudo wg-quick up config-file-name
Reboot system with reboot or systemctl reboot
Now you have Wireguard VPN (with any service of your choice) with killswitch enabled that blocks all internet traffic and ensures all traffic goes through that encrypted tunnel as soon as OS connects to the internet and starts transmitting.
Follow Mullvad and Proton support website for more details:
Every website sees or can see where you’re coming from - hence the recommendation to use a VPN to help you mask the same from your ISP and the website you visit (should you want to).
Can you specify which one WireGuard with Network manager or WireGuard Cli?
I tried ProtonVPN Linux gtk, WireGuard with Network manager, WireGuard Cli and Windscribe. Only Windscribe doesn’t leak through any physical interface and others leak real IP only through Wi-Fi/Ethernet.
Edit: Someone can try and update how it goes with Mullvad and IVPN.
You just have to have three config files in that same /etc/wireguard folder and use the sudo wg-quick down config-file-name and the sudo wg-quick up config-file-name commands to disconnect and reconnect to the three locations you want to or as and when you want to. I do recommend a quick reboot too every time you do that.
This is what I got after modifying interface of wireguard conf file
curl --interface <physical interface name> https://ipinfo.io
curl: (7) Failed to connect to ipinfo.io port 443 after 200 ms: Could not connect to server
Before I got real IP and other details.
Also, I tried firewalld workaround in OP’s post but it didn’t work and wireguard cli can’t establish connection with VPN server.
Actually I don’t think there is an IP leak in this scenario because you are choosing to use the existing wired/wireless network interface instead of the network interface created by the VPN client. So there is nothing leaking out of the VPN tunnel because there is no curl traffic going through the tunnel.