Is there a way to add the following to the installer as Surfshark does not support IPv6?
This is what I did to switch IPv6 automatically on and off when connecting to a VPN through the Network Manager:
Create a script in /etc/NetworkManager/dispatcher.d:
$ sudo vi /etc/NetworkManager/dispatcher.d/99vpn-ipv6-switch Add the following content into the file (modify the contents for your requirements):
#!/bin/sh
# Network Manager Dispatcher Hook:
# enables/disables ipv6 on vpn-down/vpn-up respectively
#
# Copyright (c) 2017 ooknosi
# Apache License 2.0
# Args
INTERFACE="$1"
ACTION="$2"
case $ACTION in
vpn-up)
# vpn connected; disable ipv6
sysctl -w net.ipv6.conf.all.disable_ipv6=1
### UNCOMMENT AND EDIT BELOW IF NECESSARY
## add pi-hole nameserver
#echo -n "nameserver 192.168.1.1" | /sbin/resolvconf -a "tun0.openvpn"
### UNCOMMENT AND EDIT ABOVE IF NECESSARY
;;
vpn-down)
# vpn disconnected; enable ipv6
sysctl -w net.ipv6.conf.all.disable_ipv6=0
### UNCOMMENT AND EDIT BELOW IF NECESSARY
## remove pi-hole nameserver
#/sbin/resolvconf -d "tun0.openvpn"
### UNCOMMENT AND EDIT ABOVE IF NECESSARY
;;
esac
exit 0
Make the script executable:
$ sudo chmod 755 /etc/NetworkManager/dispatcher.d/99vpn-ipv6-switch
Pinned Comments
goshawk22 commented on 2024-03-29 15:43 (UTC)
This package is the CLI package provided by Surfshark. It is different to the GUI package. Please only flag this as out of date if Surfshark update the CLI package.