I have the setup like this:

VPN Clients     VPN Server   ---> Internet
   \ LAN

The VPN clients are using the VPN server as default gw to the internet and they can see each other (for example I can ssh in from to without problems).

Now what I would like to accomplish is to reach a subnet where the client is connected to from the machine.

You would think that:

   route add -net gw 

Would do the trick but I get: "SCIOADDR Network is unreachable" error message. Why is that? If I would try to use this machine as default gw that would be understandable but I only want to use it as a gateway to a subnet which by the way does not overlap with any other.

I use openvpn but I doubt it matters from routing perspective.

How to accomplish this without any proxies etc?

On the I have:

 echo 1 > /proc/sys/net/ipv4/ip_forward
 iptables -t nat -A POSTROUTING -s -o eth0 -j MASQUERADE


  • If this was just two lans connected to the .1.5 machine I would have said you need to also bridge the connections so the machine know to route traffic between the two interfaces. I'm not sure you can do that with a vpn "interface" – Drifter104 Jun 5 '15 at 8:31
  • If I understand you correctly trying to add route add -net gw at some client VPN client for example, if you print and show us route table (from this client) route -n at this client then answer will be there. My suspicion is that you don't have route to whole VPN network in that clients routing table, you probably use tun, and point to point network. IHMO you should paste VPN configs as well. – Michal Sokolowski Jun 5 '15 at 13:14

Regarding the error "SCIOADDR Network is unreachable" raised by the route add -net gw, this happens 'cause the IP address you're declaring as the gateway ( is NOT directly reachable by your local host ( Please consider that both IP addresses ( and are assigned to "tun" interfaces and... those are treated very differently from ethernet ones.

To solve your problem, the first step is to point to proper gateway. As for OpenVPN client and related "tun" interfaces, the gateway to be used is the one reported as the P2P address in the tun interface. As an example, with a "tun" interface defined like in the following case:

    user@client_1:~$ ifconfig tun0
    tun0      Link encap:UNSPEC  [...]
              indirizzo inet:  P-t-P:  Maschera:

the gateway should be

So your route add should be (with such a P2P):

route add -net gw

Unfortunatly this will not solve your routing problem 'cause the network you're going to reach ( is totally unknown to OpenVPN. To solve this other issue, you'll need an "iroute" param to be defined/associated to client I'm not going to discuss this in detail, as a detailed discussion about this problem can be found to this other SF answer: please refer to it.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.