Routing Traffic Through Raspi VPN

Samples of working configurations.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Locked
isofox
OpenVpn Newbie
Posts: 7
Joined: Thu Sep 10, 2015 4:58 am

Routing Traffic Through Raspi VPN

Post by isofox » Wed Sep 16, 2015 10:02 pm

Hello,

I was wondering if there is a way to route my home network traffic through my Raspi VPN server?

I followed this tutorial to setup a Raspberry Pi VPN server: http://www.bbc.com/news/technology-33548728

But it would great if I could also route my home network traffic through my Raspberry Pi VPN server.

I already download OpenVPN GUI Client and tried to connect. It connected but with errors which I assume means it is not working properly.

Code: Select all

Tue Sep 15 17:25:48 2015 OpenVPN 2.3.8 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Aug  4 2015
Tue Sep 15 17:25:48 2015 library versions: OpenSSL 1.0.1p 9 Jul 2015, LZO 2.08
Enter Management Password:
Tue Sep 15 17:25:58 2015 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue Sep 15 17:25:58 2015 Control Channel Authentication: tls-auth using INLINE static key file
Tue Sep 15 17:25:58 2015 UDPv4 link local: [undef]
Tue Sep 15 17:25:58 2015 UDPv4 link remote: [AF_INET]X.X.X.X:1194
Tue Sep 15 17:25:58 2015 [RaspberyPiVPN] Peer Connection Initiated with [AF_INET]X.X.X.X:1194
Tue Sep 15 17:26:00 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Sep 15 17:26:00 2015 open_tun, tt->ipv6=0
Tue Sep 15 17:26:00 2015 TAP-WIN32 device [Local Area Connection 2] opened: \\.\Global\{401FF424-2A3B-40F3-BC43-800D820DD607}.tap
Tue Sep 15 17:26:00 2015 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface {401FF424-2A3B-40F3-BC43-800D820DD607} [DHCP-serv: 10.8.0.5, lease-time: 31536000]
Tue Sep 15 17:26:00 2015 Successful ARP Flush on interface [14] {401FF424-2A3B-40F3-BC43-800D820DD607}
Tue Sep 15 17:26:05 2015 Warning: address 192.168.X.X is not a network address in relation to netmask 255.255.255.0
Tue Sep 15 17:26:05 2015 ROUTE: route addition failed using CreateIpForwardEntry: The parameter is incorrect.   [status=87 if_index=14]
Tue Sep 15 17:26:05 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Tue Sep 15 17:26:05 2015 ROUTE: route addition failed using CreateIpForwardEntry: The object already exists.   [status=5010 if_index=14]
Tue Sep 15 17:26:05 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Tue Sep 15 17:26:05 2015 Initialization Sequence Completed
Tue Sep 15 17:26:37 2015 ROUTE: route deletion failed using DeleteIpForwardEntry: The parameter is incorrect.  
Tue Sep 15 17:26:37 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Tue Sep 15 17:26:37 2015 ROUTE: route deletion failed using DeleteIpForwardEntry: Element not found.  
Tue Sep 15 17:26:37 2015 env_block: add PATH=C:\Windows\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Tue Sep 15 17:26:37 2015 SIGTERM[hard,] received, process exiting
This tutorial also said that you cannot connect while on the same network.
Connecting the client
You’ll need to be somewhere other than on your own network for this next part. Otherwise you’re seriously crossing the streams, shutting down the containment grid, etc. Disconnect from your home network and tether yourself to a phone or something before continuing.
Is there a way to change this? Is there a tutorial that I can follow? or Has this topic not been considered yet?

Help with this question would be greatly appreciated. Thank you.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Routing Traffic Through Raspi VPN

Post by Traffic » Thu Sep 17, 2015 10:16 am

isofox wrote:if there is a way to route my home network traffic through my Raspi VPN server?
Is your Raspi in your Home network ?

isofox
OpenVpn Newbie
Posts: 7
Joined: Thu Sep 10, 2015 4:58 am

Re: Routing Traffic Through Raspi VPN

Post by isofox » Sat Sep 19, 2015 6:49 am

Yes. Raspi is connected to home router.

Would modem first need to be connected to raspi and then the router for all network traffic to go through raspi vpn server?

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Routing Traffic Through Raspi VPN

Post by Traffic » Sat Sep 19, 2015 1:18 pm

This is the extent of using a VPN inside your own Home network:

Code: Select all

Home:......................><--Internet---

PC1:===||
       ||
PC2:===||>===:Pi:---:Router:---Internet 
       ||
PC3:===||

<======VPN======><--- NoVPN ----------->
^^^^Encrypted^^^^__Normal_data__________
The only place where the VPN is functional is between your PCs and your PI. Once the packets pass through the Pi to the internet they are no longer encrypted with a VPN.

You can route through your Pi over a VPN but it is, to all intents and purposes, pointless as the only place where encryption takes place is within your home network not on the internet.

isofox
OpenVpn Newbie
Posts: 7
Joined: Thu Sep 10, 2015 4:58 am

Re: Routing Traffic Through Raspi VPN

Post by isofox » Sun Sep 20, 2015 8:06 am

So does that mean it is also not encrypting my traffic when I connect to the my Raspi VPN Server outside of my network?

ie. starbuck's public network

Because the point of the Raspi VPN Server is so I can connect more securely and browse the internet more anonymously over public networks by routing my traffic to my Raspi VPN Server using OpenVPN app.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Routing Traffic Through Raspi VPN

Post by Traffic » Sun Sep 20, 2015 12:22 pm

If you have setup your VPN correctly (Like so: HOWTO: Routing all client traffic (including web-traffic) through the VPN) then your VPN will encrypt all packets between your mobile device (Laptop) and your VPN server (Pi). This provides you with security and privacy on public networks such as coffee shops. However, once those packets leave the Pi and traverse the internet they are no longer encrypted.

isofox
OpenVpn Newbie
Posts: 7
Joined: Thu Sep 10, 2015 4:58 am

Re: Routing Traffic Through Raspi VPN

Post by isofox » Mon Sep 21, 2015 6:15 am

Ok. Got it.

Thanks for you help in answering my question and for helping me understand the limitations of my Raspberry Pi VPN server.

Locked