VPN does not add network route


Using Openwrt 4.9.120

I have set up a pptp vpn to connect to another site, the link comes up and I can ping Internet sites and the vpn remote gateway, but not any hosts on the remote LAN. Basically, I want to set up a LAN-LAN vpn for traffic between the LANs and all other traffic to go the default local gw to Internet.

Local LAN:
Remote LAN:

`ip -o link show up` -->
11124: pptp-SCD_pptp01: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 3\    link/ppp

route -n gives

root@OpenWrt:~# route -n 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 usb0 UGH   0      0        0 usb0 UH    0      0        0 pptp01   U     0      0        0 br-lan   U     0      0        0 usb0

I can ping, but not any host on the 192.168.1.x LAN.

If I add the route manually with:
/sbin/route add -net gw
all works as desired and expected.

Now, back to the LuCi vpn setup. What do I need to do to have the route added and deleted on this vpn link, in LuCi?

Or, is this a bug or deficiency?


It is expected behavior.
The static routes that are bound to an interface will be erased when the interface goes down. You need to add this route with an if-up script, if there is no option in Luci.
It would be a better idea to leave pptp and go to Wireguard or Openvpn for site-to-site tunnels. Better security and you can automatically install routes.


"expected behavior", no, it is a deficiency: a design deficiency; a not yet implemented issue; or a bug. Beta behavior at best.

So, lets move this to a design recommendation list.

pptp is another issue which will be remedied later, however; this is probably a common denominator issue for any vpn that is used. An option that needs to be implemented.

So, looks like a if-up script is the only answer to my question at this stage. Hopefully, that will be mainline implemented, as a basic route or based on policy-based routing in the future.


I am having to re-visit this problem, for a pptp vpn and later an ip-sec vpn, but for now the pptp. I have added logger line into scripts at various locations, including /etc/hotplug.d/iface/, /etc/ppp/ without getting any log events/messages.

So, when a pptp vpn is brought up (usually via LuCi) and at other times via uci; what file if the location to add a few lines of script code to set routes for the vpn?

I need to automate this as much as possible, as vpn code is not adding the appropriate network route. Thence, removing the network route on closing down the vpn.