I am using a raspberry with the newest stretch version and facing a routing issue. My network:

  • LAN:
  • Subnet Mask
  • Default eth0 Gateway (this network is connected to the raspberry)

Second available VPN Network (not yes used in Raspberry):

  • Subnet Mask
  • Default eth0 Gateway

I want to access from all devices in my LAN to the raspberry (that already works perfectly).

If it comes to internet (running updates in the raspberry or any other traffic caused by my software in the raspberry) the internet traffic should be routed through the VPNLAN.

I think, therefore I have to add a route and have as the only gateway the address of the vpnlan (

Tried some setting with route adding, etc; nevertheless, it did not work.

Is it possible at all, and how?

  • Some more info would be helpful. What kind of VPN solution are you using (IPsec-based - like Strongswan - or rather something like openVPN)? Where is the point of origin for your VPN? Is it on your box or on the Raspberry? The other problem is, if you want to establish a route across your VPN, you need a tunnel device to do that (as is the case with openVPN - you have to specify that one in the route), otherwise you need to intercept the VPN traffic by some other means. Anyhow, the use of iptables in this scenario is highly recommended. – Robidu Sep 7 '19 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.