Some home internet enabled equipment does not implement VPN connectivity which I would like to have. I want to setup one of these devices at a remote location and then have it live as if on my local LAN. The remote location has generic internet access (LAN router). I'm thinking about putting a RaspberryPi in between to smarten up the device's internet connection.

I would like to configure, if possible, the RaspberryPi to accept an incoming connection through ethernet from a device (or several, if using a switch) and then use the wi-fi connection to establish an outgoing internet connection through VPN.

The ethernet connection would control the LAN on that side (assigning IP's and all) The Wi-fi connection would allow traffic to go out once the VPN is established.

Is this possible?

This could be used to have remote devices running as if on the same lan (if at the other end of the VPN I have my LAN).

  • This is perfectly doable. I suggest reading up on iptables for your firewall/NAT configuration, DHCP and OpenVPN.
    – Munkeh
    Dec 15 '12 at 1:36

Your question is very non-specific. I'm not sure if you're looking for a recipe on how to do this, or a loose guide, or simply whether or not it is possible. With regards to the last, this is certainly possible. A brief outline of what you would need:

  • USB Wifi adapter to connect to your Internet (since Ethernet will serve the devices).
  • OS on the Pi (Arch would probably get you running fastest at the time of this writing).
  • VPN Software package, e.g. IPSEC, PPTP, L2TP, OpenVPN, or other.
  • DHCP & DNS service, e.g. dnsmasq
  • Working knowlege of iproute2

If you're looking more for a recipe on exactly how to do this, that would obviously be a bit more involved, but also perfectly doable. Also worth noting an alternative, if you're in control of the entire network and want all devices to be VPN'd, would be to use a USB Ethernet adapter and put the Pi between your other devices and Internet connection functioning as your main router. There are probably hundreds of ways to do what you're looking for.

  • 1
    For the routing and DHCP part, I found this post useful. I used this as a base for connecting the RPi as a router between a LAN and a GSM modem.
    – Frepa
    Dec 14 '12 at 11:16
  • Thank you Kirktis. In the end, I'm looking for a recipe from where to learn from. You've given my a few leads that I will look into but if by chance you could point me to a tutorial, that would make my day.
    – greye
    Dec 15 '12 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.