Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-19-2019, 10:35 AM   #1
Registered: May 2007
Posts: 38

Rep: Reputation: 0
Question Connecting to hosts through OpenVPN

I have the following configuration:
  • OpenVPN Server on a raspi with address and for the OpenVPN side.
  • Hardware router with OpenWRT on address
  • File Server to access
The good news is I can connect from the internet using OpenVPN apps without problem. I can login with ssh on my OpenVPN server. I can access all hosts within my local network 192.168.0.* using ping on my OpenVPN-server without problems. But I cannot reach the file server or any other host except the OpenVPN-server and the router directly from the OpenVPN client!

My OpenVPN client gets an address like

I have the following routing tables:
On OpenVPN-Server:
$ netstat -nr
Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface         UG        0 0          0 eth0   UG        0 0          0 tun0 UH        0 0          0 tun0   U         0 0          0 eth0
On Router:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth1   UG        0 0          0 br-lan   U         0 0          0 br-lan   U         0 0          0 eth1
On my file server:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0         UG        0 0          0 eth0
When I ping my file server from the OpenVPN client I get no responce.
When I traceroute my client I get:
$  traceroute
traceroute to (, 30 hops max, 60 byte packets
 1  OpenWrt.lan (  2.156 ms  2.102 ms  2.077 ms
 2  OpenWrt.lan (  2.062 ms  2.797 ms  2.787 ms
When I add the following route:
# route add -net netmask gateway
I can traceroute my OpenVPN client:
$  traceroute
traceroute to (, 30 hops max, 60 byte packets
 1  raspberrypi.lan (  4.336 ms  4.304 ms  4.282 ms
 2 (  89.269 ms  92.398 ms  92.388 ms
Why is it not sufficient to set a route to the VPN-Server on my router?

I would expect that a ping from my client to a host in my network will go the following path:>>>

The responce should go:>>>>

But only with the manually added static route it goes:>>>

As a short workaround I added this static route manually to some of the hosts I want to connect using my OpenVPN clients.

But why is the route to the VPN-Server on the router (default gateway for all hosts in the local network) not sufficient? A packet to a host with address should be sent to the default gateway and the forwarded to the OpenVPN-server by the deafault gateway. Why is that not working?

Can anybody explain?
Old 08-20-2019, 05:43 PM   #2
Senior Member
Registered: May 2009
Location: WV, USA
Distribution: Xubuntu, Slackware, Amazon Linux
Posts: 1,903
Blog Entries: 21

Rep: Reputation: 126Reputation: 126
can you draw a map of your network with IP addresses labled and show us?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Traffic doesn't route through OpenVPN server while connecting by squid excitement Linux - Networking 0 02-25-2019 01:44 PM
Directing OpenVPN client's traffic through the OpenVPN server mohtasham1983 Linux - Networking 1 01-17-2012 06:44 PM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
OpenVPN Question : connecting 5-6 comps with OpenVPN duryodhan Linux - Networking 7 02-15-2007 10:28 PM
Help!. Problem connecting to an Openvpn through proxy server. microsoftguy Linux - Software 1 08-03-2006 09:54 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration