@MarkusUlm the script is meant to reset the DNS to only include the 2 default DNS of your VPN. Onlu that. I have the defautl route set up correctly. But I still have the other default route set for the network LAN so I have updated my script like this
#!/bin/sh
interface=$1
status=$2
case $status in
vpn-up)
# because dnsmasq keep DNS LAN and leak our DNS, reset DNS servers to PIA ones
dbus-send --system --dest=org.freedesktop.NetworkManager.dnsmasq --type=method_call /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers
dbus-send --system --dest=org.freedesktop.NetworkManager.dnsmasq --type=method_call /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers uint32:3520991966
dbus-send --system --dest=org.freedesktop.NetworkManager.dnsmasq --type=method_call /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers uint32:3520991962
ip route del default via 192.168.0.254 dev eth0
;;
vpn-down)
ip route add default via 192.168.0.254 dev eth0
;;
esac
First you need to change the DNS server IP
and second change the default router IP to be deleted and re added when VPN is down.
I delete the default route because I end up with 2 default route even if it does not cause problem.
@MarkusUlm the script is meant to reset the DNS to only include the 2 default DNS of your VPN. Onlu that. I have the defautl route set up correctly. But I still have the other default route set for the network LAN so I have updated my script like this
#!/bin/sh
interface=$1
status=$2
case $status in org.freedesktop .NetworkManager .dnsmasq --type=method_call /uk/org/ thekelleys/ dnsmasq uk.org. thekelleys. SetServers org.freedesktop .NetworkManager .dnsmasq --type=method_call /uk/org/ thekelleys/ dnsmasq uk.org. thekelleys. SetServers uint32:3520991966 org.freedesktop .NetworkManager .dnsmasq --type=method_call /uk/org/ thekelleys/ dnsmasq uk.org. thekelleys. SetServers uint32:3520991962
vpn-up)
# because dnsmasq keep DNS LAN and leak our DNS, reset DNS servers to PIA ones
dbus-send --system --dest=
dbus-send --system --dest=
dbus-send --system --dest=
ip route del default via 192.168.0.254 dev eth0
;;
vpn-down)
ip route add default via 192.168.0.254 dev eth0
;;
esac
First you need to change the DNS server IP
and second change the default router IP to be deleted and re added when VPN is down.
I delete the default route because I end up with 2 default route even if it does not cause problem.