Page 1 of 1

[SOLVED] Can connect to server but not internet

Posted: Mon Dec 20, 2010 10:22 am
by hypertyper
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

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

Posted: Mon Dec 20, 2010 11:05 pm
by ytekght
it would help to know a little bit about your setup, config files etc, firewall rule (if any) etc.

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

Posted: Mon Dec 20, 2010 11:54 pm
by hypertyper
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