Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
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 May 24 '10 at 7:34
add comment

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.

share|improve this answer
1  
sudo wouldn't work because the redirector (>) runs as your user, not root (and you don't have permission to write to /proc). –  squircle May 24 '10 at 19:48
    
Super informative comment... thanks! I suppose I could have looked it up but this is quite useful to know. –  gaoshan88 May 26 '10 at 3:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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