I want my static routes to automatically be loaded on VPN reconnect. According to the wiki on Debian this can be done by placing a script in /etc/network/if-pre-up.d/ So I did, this is what it looks like:
#!/bin/bash
ip route add 10.8.0.0/24 dev ppp0
ip route add 192.168.0.0/24 dev ppp0
On linux startup this script runs perfectly, but on VPN reconnect it doesn't run. Why?
My /etc/network/interfaces file:
auto lo eth0 eth1 asus
iface lo inet loopback
iface eth0 inet dhcp
iface eth1 inet dhcp
iface asus inet ppp
provider asus
I tried to add lines on this file:
auto lo eth0 eth1 asus
iface lo inet loopback
iface eth0 inet dhcp
iface eth1 inet dhcp
iface asus inet ppp
provider asus
up sleep 10 && ip route add 10.8.0.0/24 dev ppp0
up ip route add 192.168.0.0/24 dev ppp0
They again runs on startup, but not on reconnect.