Last active
December 30, 2020 19:20
-
-
Save tmclnk/88fde354c904ec791ad042f35f8fc038 to your computer and use it in GitHub Desktop.
OpenVPN, but allow SSH
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
sudo apt install openvpn-systemd-resolved |
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
#!/usr/bin/env bash | |
ip rule add from $(ip route get 1 | grep -Po '(?<=src )(\S+)') table 128 | |
ip route add table 128 to $(ip route get 1 | grep -Po '(?<=src )(\S+)')/32 dev $(ip -4 route ls | grep default | grep -Po '(?<=dev )') | |
ip route add table 128 default via $(ip -4 route ls | grep default | grep -Po '(?<=via )(\S+)') | |
# To avoid password prompts you can create a file with | |
# username and password on lines 1 and 2 respectively, | |
# then add an auth-user-pass entry, e.g. | |
# auth-user-pass pass.txt | |
openvpn softether_vpn.ovpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment