OpenWRT and VPN Passthrough

Damn! This was easy! When I approached this I was fully prepared for a mega-Google session hours of swearing. In fact it took only a couple of minutes.

Rewind..

I have a VPN server running on a local machine in my network, like every sane person. When I'm out and about and need to mooch WiFi, I use my internet at home (as well as access local files, network and such) over the VPN. Not only more secure than throwing my data around in plain text over the local hotspot, but seriously handy (plug phone into car - navigate to music folder back home, play album I MUST HEAR RIGHT NOW, for example, as well as other, more serious uses).

So.. To cut a fairly short story even shorter you simply need to do (in OpenWRT)..

opkg install gre
opkg install kmod-gre

You might also need..

opkg install install kmod-ipt-nathelper-extra

If you are using Chaos Calmer or later versions, you will instead need to do..

opkg install kmod-nf-nathelper-extra

Then add a section to your /etc/config/firewall

config redirect
	option name			VPN GRE
	option dest_ip		192.168.0.3
	option target		DNAT
	option src			wan
	option dest			lan
	option proto		gre

192.168.0.3 is the machine running the VPN server. You will also need a rule for the PPTP ..

config redirect
	option name			VPN
	option dest_ip		192.168.0.3
	option src_dport 	1723
	option dest_port	1723
	option target		DNAT
	option src			wan
	option dest			lan
	option proto		tcp

Done!..

Yup, that's it. After you restart your firewall..

/etc/init.d/firewall restart

You are good to go, as in go out, securely. Well, as securely as PPTP is, which is not very. Consider OpenVPN, instead!

;o) corz.org

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!