Last active
June 28, 2017 19:15
-
-
Save aadlani/fc6637654020f0387e5d52157de5c51f to your computer and use it in GitHub Desktop.
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
| ifconfig $(ip route list | awk '/^default/ {print $5}') | grep -sw "inet" | tr ":" " " | awk {'print $3"."$7'} | { IFS=. read -r i1 i2 i3 i4 m1 m2 m3 m4; printf "push \"route %d.%d.%d.%d %d.%d.%d.%d\"\n" "$((i1 & m1))" "$((i2 & m2))" "$((i3 & m3))" "$((i4 & m4))" $m1 $m2 $m3 $m4; } | sed '/your local subnet/ r /dev/stdin' /etc/openvpn/server.conf | uniq | sudo tee /etc/openvpn/server.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment