I am one of those people who function better by writing things down. One day, I realized that most of my notes don’t have to be private, so here they are - my second brain. Be warned that, if you stumble upon something here that doesn’t make sense to you, it isn’t meant to!
Wireguard client
Note: The following instructions help setup a Wireguard client for a commercial VPN provider. Install Installation instructions for a Raspberry Pi. (As of today, Wireguard isn’t available in the standard distribution): Blogs: https://engineerworkshop.com/blog/how-to-set-up-wireguard-on-a-raspberry-pi/ https://www.wundertech.net/how-to-connect-a-raspberry-pi-to-a-wireguard-vpn-server/ sudo apt install raspberrypi-kernel-headers Mullvad Install configuration files: https://mullvad.net/en/help/wireguard-and-mullvad-vpn/ - it adds configurations to the /etc/wireguard directory. To add a kill-switch, edit the installer shell script before running it. Also, escape all the $ signs: $(..) -> \$(..). Check https://mullvad.net/en/check/ to ensure everything is working as expected. Kill-switch configuration PostUp = iptables -t mangle -A OUTPUT -d 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10 -j MARK --set-mark $(wg show %i fwmark) PreDown = iptables -t mangle -D OUTPUT -d 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10 -j MARK --set-mark $(wg show %i fwmark) 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 Note: ...