[SOLVED] Can connect to server but not internet

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please visit (and READ) the OpenVPN HowTo http://openvpn.net/howto prior to asking any questions in here!
Post Reply
hypertyper
OpenVpn Newbie
Posts: 2
Joined: Mon Dec 20, 2010 10:18 am

[SOLVED] Can connect to server but not internet

Post by hypertyper » Mon Dec 20, 2010 10:22 am

Solution: follow the guide and in the iptables section replace the line that similar to the what I'm posting now and you'll be golden. I'm a total linux noob and got it to work. If you want to make life easier for yourself get putty and filezilla to interact with your VPS. Here is the line that should change in the guide:

iptables -t nat -A POSTROUTING -j SNAT --to-source YOURVPSIP


I've followed this guide to the letter and finally managed to get OpenVPN to start and I can even connect to via OpenVPN but I don't have contact to the outside world from there onwards. No internet, nothing. I tried a traceroute and he just gets to the server and that's where he stays. I'm no good with OpenVPN so I don't know where to start looking for a possible error source.

I'd appreciate any help.

Cheers
Last edited by hypertyper on Wed Dec 22, 2010 8:58 pm, edited 1 time in total.

ytekght
OpenVpn Newbie
Posts: 13
Joined: Tue Oct 26, 2010 8:26 am

Re: Can connect to server but don't have internet afterwards

Post by ytekght » Mon Dec 20, 2010 11:05 pm

it would help to know a little bit about your setup, config files etc, firewall rule (if any) etc.

hypertyper
OpenVpn Newbie
Posts: 2
Joined: Mon Dec 20, 2010 10:18 am

Re: Can connect to server but don't have internet afterwards

Post by hypertyper » Mon Dec 20, 2010 11:54 pm

Sorry my post isn't very good. I was sleep deprived and desperate. I think I've narrowed it down to the ip table because I can connect which I assume wouldn't be possible if something major was messed up. This is the config from the guide that I posted, which is what I'm using. I don't want to post the whole article but this should be the interesting bit.

Code: Select all

#!/bin/sh

iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

touch /var/lock/subsys/local
If there is more information you need it's probablu easiest if you skim the article but I'm fairly sure this is it.

Thanks for your help.

I find this guide really good otherwise so I'm hoping that fixing this will help a lot of people.

I haven't been able to test it but this has been suggested to me:

iptables -t nat -A POSTROUTING -j SNAT --to-source YOURVPSIP

Cheers

Post Reply