0

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.

Aydar
  • 1
  • Most likely your VPN software doesn't use `ifup` / `ifdown` scripts for bringing interface up/down or the VPN software doesn't bring up / down the interface on reconnect. Therefore these scripts are not executed. You should look for proper options in your VPN software. – Tero Kilkanen Oct 11 '14 at 22:48

1 Answers1

0

I find solution: for ppp scripts must be located in /etc/ppp/ip-up.d/ folder.

Aydar
  • 1