LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-17-2016, 10:15 AM   #16
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158

And what did you expect? You have the default route through 192.168.5.1. The 192.168.5.0/24 route is automatically added when the interface starts.
The vpn routes are different because for some reason you use tun interface that works a bit differently. I suggest using tap, that is a "standard" network interface (but doesnt work in Android clients).
 
1 members found this post helpful.
Old 12-17-2016, 10:32 AM   #17
evilmonkey1987
LQ Newbie
 
Registered: Nov 2016
Location: Toronto
Distribution: Ubuntu and CentOS
Posts: 10

Original Poster
Rep: Reputation: Disabled
I expected that when a request comes in to the VPN box for an IP in the 192.168.5.x range, it would go to 192.168.5.1, the default route. That does not appear to be happening because of that bizarre last entry.

The main client that connects is android, so tap will not work. Can I add a route just for VPN? If so, what should it look like?

Last edited by evilmonkey1987; 12-17-2016 at 10:43 AM.
 
Old 12-17-2016, 10:47 AM   #18
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
There is no rule to add other than 192.168.5.0/24 via the vpn gateway on the vpn clients.
But as i said before, use masquerade - it works better for vpn->lan access.
 
1 members found this post helpful.
Old 12-17-2016, 08:29 PM   #19
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
If you don't choose to follow the NAT alternative, then, yes, there must either be a routing rule on the VPN clients, or a static route in the router that all of them share.

Traffic sent from a directly-connected VPN user will probably have a "10.8.x.x" IP address (as specified in the VPN config), and traffic passing through a gateway will instead have the address of the remote subnet.

In any case, TCP/IP routing must be round trip. The computers to whom traffic is being sent must have routing (one way or the other) that sends the replies (and connections going the other way ...) back to the appropriate OpenVPN gateway for final delivery. You must have routing for the entire Hobbit's Journey: "There And Back Again."

If you don't have that, it'll be sent to that machine's "default gateway," e.g. on the Internet, which will immediately drop any packet, such as these, which bears a "non-routable" IP address.

Of course, routing in the case of OpenVPN must concern not only the virtual connections that pass through the tunnel, but the physical routing of (encrypted) packets among the OpenVPN gateways themselves.

traceroute is your friend . . . So's a big piece of paper and a number-two pencil to draw it all out ... both "as it should be" and "as it now (incorrectly) is" ... in a big picture.

Last edited by sundialsvcs; 12-17-2016 at 08:32 PM.
 
1 members found this post helpful.
Old 12-19-2016, 11:32 AM   #20
evilmonkey1987
LQ Newbie
 
Registered: Nov 2016
Location: Toronto
Distribution: Ubuntu and CentOS
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks. I was quite confused by the responses because I had the nat set up through the iptables command on the first page,and had a static route set in the router, which should have been enough for the round-trip. It appears that after a server reboot, I needed to re-run the iptables command, which is what was causing the grief. All good again.
 
  


Reply



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
openVPN on Raspberry Pi - Routing Issues fritz44 Linux - Networking 1 10-11-2015 05:01 PM
How does OpenVPN Linux server issues IP and netmask to OpenVPN clients on Windows XP pssompura Linux - Networking 0 12-24-2009 02:42 AM
Error When converting Routing OpenVPN to bridge mode openvpn danmartinj Linux - Software 0 11-06-2009 09:23 AM
OpenVPN and Routing. Eightpock Linux - Networking 2 07-10-2008 06:48 AM
openVPN and routing issues mdkelly069 Linux - Networking 0 07-12-2004 12:19 PM

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

All times are GMT -5. The time now is 07:49 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
Open Source Consulting | Domain Registration