LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-21-2013, 07:42 AM   #1
depam
Member
 
Registered: Sep 2005
Posts: 861

Rep: Reputation: 30
raspberry PI as gateway to route VPN traffic


I have two RPI on two different location. Both have been installed with OpenVPN Server. On Server B, I have also configured a OpenVPN client to connect to Server A. I want to use this as a gateway for my current LAN. The plan is to add a routing on my DD-WRT router to forward traffic destined to the remote subnet to RPI which is already connected to the remote network via OpenVPN client. Is this possible? I only have one ethernet installed and not sure if this is possible.

On Server B, I have the below interface

eth0 --> Current Network LAN
tun0 --> OpenVPN server that listens for connection to remote user who wants to connect to current network LAN
tun1 --> OpenVPN client connecting remote subnet

I had success with a DD-WRT site to site OpenVPN setup however the only thing that worked for me is using a static key and not PKI. I didn't make it permanent as I am afraid that having a static key compromised can be a security hole to both of my network. My current RPI is configured using a PKI with TLS-AUTH which is a lot secure than the static key. I just not sure how to have site to site routing wotk having this setup.

Do you guys think its worth it to pursue this setup or static key will be a better choice (though I am not really sure how long or easy to compromise the key).
 
Old 06-22-2013, 02:44 AM   #2
cliffordw
Member
 
Registered: Jan 2012
Location: South Africa
Posts: 509

Rep: Reputation: 203Reputation: 203Reputation: 203
Hi there,

I haven't tried this, but see no reason why it shouldn't be possible.

On the router it should be a simple matter of adding a static route to forward the traffic for that specific subnet to Server B.

On server B you'll need to NAT the traffic coming from eth0 and going to tun1, using iptables.

Hope this helps.

Clifford
 
Old 06-22-2013, 06:13 AM   #3
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
I have tried to do masquerading without success on tun1. My DD-WRT also lose control for some unknown reason and my client PC just can't connect to net at all. I am not sure if its a bug on DD-WRT but after recovering from backup, all went back fine again. For testing, I used a static key OpenVPN between two routers but I find that the speed is a bit slow for some reason.

I will give it a try again but can you help to let me know a sample of iptable I need to put in. It seems POSTROUTING doesn't work fine with me.
 
  


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
Ensuring no traffic except VPN goes through the gateway - DD-WRT/OpenVPN router haggismn Linux - Security 0 12-15-2011 03:59 AM
Route only some traffic throw VPN and everything else the "direct" way.. athor Linux - Networking 7 12-30-2009 05:35 PM
OpenVPN route issues, all traffic through VPN tunnel stuartornum Linux - Server 4 03-05-2007 03:07 AM
route traffic onto the net from a lan gateway ulto Linux - Networking 1 04-13-2004 08:54 PM
Wireless traffic stomps isdn traffic on gateway machine Radix999 Linux - Wireless Networking 0 11-14-2003 12:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:33 AM.

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