I want to use OpenVPN to access the web and email from China. How?

1

My question: How do I use my already existing OpenVPN setup to enable secure, remote web surfing and email checking from open wireless hotspots?

edit3 - Bride of Edit The final solution is below but in case no one reads that far the final solution was to forward the data using: sudo -s echo 1 > /proc/sys/net/ipv4/ip_forward

edit2 I've implemented the directions in the "How To" but all I get is my internet connection timing out. What I did was enable push "redirect-gateway def1" in the conf and then set iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE. This is as they suggest in the manual but it does not work.

edit: I see in their manual that they explain the first bit of how to do this and then say "The server will need to be configured to deal with this traffic somehow," and offer a few options. But that "somehow" has me bugged because it seems like there should a "best way" and I'm not sure I understand enough about the options provided to determine this way.

Some long winded details:

I am running Ubuntu and have OpenVPN up and working fine as a server. My client machine connects fine as well. However, that just gets me a secure connection to my home network.

What I want is to be able to access my VPN server and surf the web or check email securely from anywhere with an open wireless connection. I am frequently in China and having secure, unblocked access would be a boon (especially since I like to work from tea houses and coffee shops and I've already had a password sniffed and hacked once).

I already know how to tunnel over SSH via a SOCKS proxy using something like:

ssh -ND 8887 -p 22 yaddayadda@84.26.421.796  

but since I have OpenVPN I figure why not try it? So... what are the steps involved in making it so I can connect to my VPN and the surf and check mail to my hearts content (slowly to be sure but at least it wold be secure). Thx!

gaoshan88

Posted 2010-05-23T06:00:09.733

Reputation: 145

Answers

2

it's worth checking your server is set up to forward/route packets

on my machine, I can check that with "cat /proc/sys/net/ipv4/ip_forward" if that's 0, do "echo 1 > /proc/sys/net/ipv4/ip_forward"

if that isn't it, and you don't have the FORWARD iptables chain denying you somehow, I'd post a traceroute and see how far it gets.

frymaster

Posted 2010-05-23T06:00:09.733

Reputation: 582

I entered my comment without refreshing... oops. Your tip is the correct answer. For some reason even using sudo would still deny me permission to do this but sudo -s (logging me in as root) did it. Thanks! – gaoshan88 – 2010-05-24T07:34:36.567

0

The needed command was: sudo -s echo 1 > /proc/sys/net/ipv4/ip_forward

Note the sudo -s... for some reason a simple sudo would not cut it on my server.

gaoshan88

Posted 2010-05-23T06:00:09.733

Reputation: 145

1sudo wouldn't work because the redirector (>) runs as your user, not root (and you don't have permission to write to /proc). – squircle – 2010-05-24T19:48:59.753

Super informative comment... thanks! I suppose I could have looked it up but this is quite useful to know. – gaoshan88 – 2010-05-26T03:24:43.557