seveneels
Posts: 2
Joined: Fri May 16, 2014 4:04 am
Location: bowels of my room

Pi as VPN and portable router at same time?

Thu May 29, 2014 4:54 am

I've got a project idea here that's really two projects in one, and I wanted to know how you guys think I should approach it?

So I started out wanting to use my pi to make a VPN (currently working on getting through the tutorial) for SSH tunneling.

But I also have seen tutorials on how to make a pi into a portable router using a wifi dongle. (which looks relatively simple)

Would it be possible to combine both projects into one? So I can roll with a secure router wherever I go? I imagine that it is possible but I'm just not sure how to go about it. Any suggestions?

n3tm4n
Posts: 29
Joined: Tue Jun 10, 2014 11:34 am
Location: East Midlands, UK
Contact: Website

Re: Pi as VPN and portable router at same time?

Thu Jun 26, 2014 9:16 pm

seveneels wrote:Would it be possible to combine both projects into one? So I can roll with a secure router wherever I go? I imagine that it is possible but I'm just not sure how to go about it. Any suggestions?
Its possible, I used to do something very similar with one of my RPi's when I first got it. I had a situation where there was free (although limited) wired internet, but no wireless. I had the PI configured to fire up an OpenVPN client initially connecting out through the Ethernet port, then create a wireless accesspoint complete with DHCP etc for the WiFi clients.

Final piece of the jigsaw was to use iptables to NAT the WiFi DHCP addresses behind the tunnel interface created by the OpenVPN client.

If I still have an old SD card image kicking around, I'll take a look to see if there is anything helpful on there. I would start with getting the WiFi working, with your own DHCP server and perhaps DNSMASQ with IPtables. There are lots of pages with how-to information for that. Then get the VPN working (in isolation initially), again following the many howto's. It should then be quiet simple to get them to work together by making sure the VPN is up and changing the iptables NAT rule.

HTH.
Jon.
http://0x25.blogspot.co.uk/

Return to “Networking and servers”