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

Notices


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

Rep: Reputation: 0
Question Connecting to hosts through OpenVPN


Hi,
I have the following configuration:
  • OpenVPN Server on a raspi with address 192.168.0.14 and 10.5.5.2 for the OpenVPN side.
  • Hardware router with OpenWRT on address 192.168.0.1
  • File Server to access 192.168.0.11
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 10.5.5.6

I have the following routing tables:
On OpenVPN-Server:
Code:
$ netstat -nr
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags   MSS Fenster irtt Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0
10.5.5.0        10.5.5.2        255.255.255.0   UG        0 0          0 tun0
10.5.5.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
On Router:
Code:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth1
10.5.5.0        192.168.0.14    255.255.255.0   UG        0 0          0 br-lan
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 br-lan
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
On my file server:
Code:
$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         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:
Code:
$  traceroute 10.5.5.6
traceroute to 10.5.5.6 (10.5.5.6), 30 hops max, 60 byte packets
 1  OpenWrt.lan (192.168.0.1)  2.156 ms  2.102 ms  2.077 ms
 2  OpenWrt.lan (192.168.0.1)  2.062 ms  2.797 ms  2.787 ms
When I add the following route:
Code:
# route add -net 10.5.5.0 netmask 255.255.255.0 gateway 192.168.0.14
I can traceroute my OpenVPN client:
Code:
$  traceroute 10.5.5.6
traceroute to 10.5.5.6 (10.5.5.6), 30 hops max, 60 byte packets
 1  raspberrypi.lan (192.168.0.14)  4.336 ms  4.304 ms  4.282 ms
 2  10.5.5.6 (10.5.5.6)  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:

10.5.5.6-->10.5.5.2-->192.168.0.14-->192.168.0.11

The responce should go:

192.168.0.11-->192.168.0.1-->192.168.0.14-->10.5.5.2-->10.5.5.6

But only with the manually added static route it goes:

192.168.0.11-->192.168.0.14-->10.5.5.2-->10.5.5.6

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 10.5.5.6 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
Skaperen
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?
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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