Skip to content

Instantly share code, notes, and snippets.

@kbhaines
Last active March 4, 2017 11:58
Show Gist options
  • Select an option

  • Save kbhaines/f24f5e35147c4b593271f5e4d4bb67b7 to your computer and use it in GitHub Desktop.

Select an option

Save kbhaines/f24f5e35147c4b593271f5e4d4bb67b7 to your computer and use it in GitHub Desktop.
OpenVPN config to randomise vpn connections
# Put this at the end of /etc/default/openvpn
AUTOSTART="nordvpn"
prefix=uk[0-9][0-9]
VPN_HOME=/etc/openvpn
target=`ls $VPN_HOME/${prefix}.nordvpn*udp*|shuf -n 1`
VPN_CONF=$VPN_HOME/nordvpn.conf
cp $target $VPN_CONF
sed -i "s/auth-user-pass.*/auth-user-pass \/etc\/openvpn\/nordvpn-auth/" $VPN_CONF
echo "up $VPN_HOME/update-resolv-conf" >> $VPN_CONF
echo "script-security 2" >> $VPN_CONF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment