Created
February 13, 2020 16:10
-
-
Save Cryptophobia/ab19da8440e00fde1f8dfbd8a43f222a to your computer and use it in GitHub Desktop.
/etc/NetworkManager/dispatcher.d/99vpn-ipv6-switch
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 | |
# Network Manager Dispatcher Hook: | |
# enables/disables ipv6 on vpn-down/vpn-up respectively | |
# Args | |
INTERFACE="$1" | |
ACTION="$2" | |
case $ACTION in | |
vpn-up) | |
# vpn connected; disable ipv6 | |
sysctl -w net.ipv6.conf.all.disable_ipv6=1 | |
;; | |
vpn-down) | |
# vpn disconnected; enable ipv6 | |
sysctl -w net.ipv6.conf.all.disable_ipv6=0 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment