Last active
August 29, 2015 14:22
-
-
Save pefoley2/42b762df19e894d34381 to your computer and use it in GitHub Desktop.
Pia
This file contains hidden or 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
alias pia="sudo ip netns exec pia sudo -u peter" |
This file contains hidden or 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/bash | |
case $script_type in | |
up) | |
ip netns add pia | |
ip link set dev "$1" up netns pia mtu "$2" | |
ip netns exec pia ip link set dev lo up | |
ip netns exec pia ip addr add dev "$1" local "$4" peer "$5" | |
;; | |
route-up) | |
ip netns exec pia ip route add default via "$route_vpn_gateway" | |
;; | |
down) | |
ip netns delete pia | |
;; | |
esac |
This file contains hidden or 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
# append this to your ovpn file | |
route-noexec | |
ifconfig-noexec | |
up /etc/openvpn/netns.sh | |
down /etc/openvpn/netns.sh | |
route-up /etc/openvpn/netns.sh | |
script-security 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment