I am using openfortivpn to connect to a remote network. Unfortunately the remote infrastructure has a lot of subnets, some of which conflict with my local ones. There are only a couple of subnets I need connectivity to (which don't have conflicts). It seems that openfortivpn only accepts all routes or none from the gateway server.

To address this, I added my own script in /etc/ppp/ip-up.d/9000-myvpnlink (-rwxr-xr-x) and a corresponding one in ip-down.d/:


ip route add to via $4 dev $0
ip route add to via $4 dev $0
echo 1>/proc/sys/net/ipv4/ip_forward

However the routes do not appear / forwarding is not enabled. When I check the logs I see...

 Oct 15 15:05:45 liv-i02-sg-ras NetworkManager[679]: <info> 
    [1571148345.2093] device added (path: /sys/devices/virtual/net/ppp0,
    iface: ppp0): no ifupdown configuration found.

How do I get my script to run? Is there a more sensible way to enable the routes?

1 Answer 1


The message in the log file was not relevant. When I added a touch /tmp/afile I discovered the script was running. The issue was that I was passwing $0 as the interface device to route when I should have been using $1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .