Last active
December 6, 2024 08:28
-
-
Save larsch/9fe268026ef55796c182e7c67de91fc4 to your computer and use it in GitHub Desktop.
Run firefox with Wireguard VPN using network namespaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec ip netns exec vpn su user -c "$*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
firefox -CreateProfile private | |
exec sudo /usr/local/bin/vpnexec firefox -P private -private -new-session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -exu | |
ip link del dev wg-vpn ||: | |
ip -n vpn link del dev wg-vpn ||: | |
ip link add dev wg-vpn type wireguard | |
ip netns add vpn ||: | |
ip link set dev wg-vpn netns vpn | |
ip -n vpn addr add 10.9.7.2/32 peer 10.9.7.1/32 dev wg-vpn | |
ip -n vpn addr add fc01::2/64 peer fc01::1/64 dev wg-vpn | |
ip -n vpn link set dev wg-vpn up | |
ip -n vpn route add default via 10.9.7.2 | |
ip -n vpn route add default via fc01::1 | |
ip netns exec vpn wg set wg-vpn private-key $LOCALPRIVATEKEYFILE peer $PEERPUBLICKEY endpoint $ENDPOINT allowed-ips 0.0.0.0/0,::/0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment