victor_silva
Posts: 4
Joined: Tue Nov 13, 2012 8:19 pm

Can't connect to VPN server running on R-PI

Tue Nov 13, 2012 8:34 pm

Hello folks,
this is my first question and I think it is already pretty complex...
I have managed to setup various servers (http, mail, ssh, ftp) in my Rpi and all of them work perfectly.
Last server I tried to install and configure was a VPN server. I did so by following this tutorial: http://unvexed.blogspot.de/2012/08/how- ... d-vpn.html
Everything seem to work since I didn't get any error during the installation and configuration.
Now, when I try to connect to the VPN the connection does not work.
In the RPI, by executing

Code: Select all

tail -f /var/log/messages
I get the following:

Code: Select all

Nov 13 20:07:51 raspberrypi rsyslogd-2177: imuxsock lost 220 messages from pid 1742 due to rate-limiting
Nov 13 20:08:38 raspberrypi pppd[2654]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
Nov 13 20:08:38 raspberrypi kernel: [  101.964810] PPP generic driver version 2.4.2
Nov 13 20:08:38 raspberrypi pppd[2654]: pppd 2.4.5 started by root, uid 0
Nov 13 20:08:39 raspberrypi pppd[2654]: Using interface ppp0
Nov 13 20:08:39 raspberrypi pppd[2654]: Connect: ppp0 <--> /dev/pts/0
Nov 13 20:08:39 raspberrypi pppd[2654]: Hangup (SIGHUP)
Nov 13 20:08:39 raspberrypi pppd[2654]: Modem hangup
Nov 13 20:08:39 raspberrypi pppd[2654]: Connection terminated.
Nov 13 20:08:39 raspberrypi pppd[2654]: Exit.
In the VPN client I get different errors depending on the VPN client I use. By using a simple connection under windows I get the error 0x8007274 and when I use OpenVPN I get a connection time out.
The user that is trying to connect to the VPN exists in the RPI and has the same password as the one in the

Code: Select all

/etc/ppp/chap-secrets
Could anyone please help me? I'm stucked with this problem and as I'm far from being a Linux expert, I'd appreciate any help you could give me!

Thanks

Víctor

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Can't connect to VPN server running on R-PI

Tue Nov 13, 2012 10:35 pm

Is is not your firewall that's bugging? I made also a vpn server of my pi. I wrote a tutorial for it: https://dl.dropbox.com/u/21429092/OpenV ... y%20Pi.pdf

victor_silva
Posts: 4
Joined: Tue Nov 13, 2012 8:19 pm

Re: Can't connect to VPN server running on R-PI

Wed Nov 14, 2012 8:10 am

Thank's for the answer.
I already saw your tutorial, but I'm ussing pppd as VPN server and not OpenVPN. Do you think that this would make a difference?
And what do you mean when you say that my firewall might be bugging? I don't have any firewall installed in the RPI and the ports in the router are open as required.
Any other hint before I change to OpenVPN?
Thanks!
Víctor

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: Can't connect to VPN server running on R-PI

Wed Nov 14, 2012 9:45 am

If you don't get PPTPd to work, you probably shouldn't start with OpenVPN because it's more complicated.

Are you trying to VPN to the Pi on the local network? Do so to exclude possible ISP/Router/Firewall limitations.

I've used this manual to setup my PPTPd:
http://wellsb.com/post/29412820494/rasp ... vpn-server

What manual/blog/forum post did you follow during installation and configuration?
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Can't connect to VPN server running on R-PI

Wed Nov 14, 2012 11:20 am

Hi,

The first thing I would try and rule out would be your internet router. Unfortunately to get PPTP working its not just as simple as forwarding port 1723, your router also needs to support GRE Protocol 47, this is the problem I had when first trying to get PPTP to work. Support for GRE protocol 47 seems to be random, not really anything to do with a specific brand or price point.

You could probably test this by trying to connect to your VPN via your internal network, if this works, but it doesnt via the internet there is a good chance the problem is your router.

If you still having trouble, try turning on debugging, there is a flag in the pptpd.conf file (I think!) called 'debug' which is commented out i.e. #debug, uncomment this by removing the #, restart pptpd and you will start getting more detailed messages in the log files. This is how I originally worked out that my router was responsible for my issues.

Ive put instructions and some info about my experience of installing PPTP on my blog which might be of some help http://www.stuffaboutcode.com/2012/08/r ... erver.html.

LHIS
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Can't connect to VPN server running on R-PI

Wed Nov 14, 2012 2:45 pm

In my tutorial you must do:

Code: Select all

iptables -t nat -A INPUT -i eth0 -p udp -m udp --dport 1194 -j ACCEPT
and

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source RASPBERRY.PI.IP.ADRESS
Otherwise the vpn aint work. (this is for my tutorial) maybe it's different with your vpn.

victor_silva
Posts: 4
Joined: Tue Nov 13, 2012 8:19 pm

Re: Can't connect to VPN server running on R-PI

Thu Nov 15, 2012 9:27 pm

Hi Minipiuser,
where do I need to put these commandos? do they go in a configuration file?
Thanks!
Víctor

victor_silva
Posts: 4
Joined: Tue Nov 13, 2012 8:19 pm

Re: Can't connect to VPN server running on R-PI

Thu Nov 15, 2012 9:34 pm

Hi again,
sorry, I called you Minipiuser and it's Piminiuser... sorry....
I executed the commands (with sudo) and tried again.
It does not work, even from inside my network.
Any other hint?
Thanks!
Víctor

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Can't connect to VPN server running on R-PI

Fri Nov 16, 2012 12:39 pm

victor_silva wrote:Hi again,
sorry, I called you Minipiuser and it's Piminiuser... sorry....
I executed the commands (with sudo) and tried again.
It does not work, even from inside my network.
Any other hint?
Thanks!
Víctor
I always do

Code: Select all

sudo su
and then just the commands in putty, maybe you need a little tweak for your own. But its a guess..i cant help you further.

User avatar
Thijxx
Posts: 86
Joined: Mon Oct 22, 2012 1:25 pm
Location: The Netherlands

Re: Can't connect to VPN server running on R-PI

Fri Nov 16, 2012 4:25 pm

How far are you with the PPTP VPN?

Did you follow the directions of LetHopeItsSnowing and set the GRE on your router?
And did you enable the #debug so you can provide us with some extra log information?

You are not installing OpenVPN as far as I can see, so you shouldn't use the OpenVPN client :) The default Windows client is ok I suppose. I always use my iPhone or iPad with this PPTP VPN.
Mimi: Where'd you come from?
Doyle: My mom and the authorities are still trying to figure that out.

scottcjordan
Posts: 6
Joined: Sat Jun 30, 2012 11:12 pm

Re: Can't connect to VPN server running on R-PI

Sun Nov 25, 2012 5:42 am

victor_silva wrote:Hello folks,
this is my first question and I think it is already pretty complex...
I have managed to setup various servers (http, mail, ssh, ftp) in my Rpi and all of them work perfectly.
Last server I tried to install and configure was a VPN server. I did so by following this tutorial: http://unvexed.blogspot.de/2012/08/how- ... d-vpn.html
Everything seem to work since I didn't get any error during the installation and configuration.
Now, when I try to connect to the VPN the connection does not work.
I'm the author of that blog post. Sorry you're having trouble.

Both the error 0x8007274 in your Windows VPN client and the conclusion of your Raspberry Pi's log file indicate a timeout has occurred on both sides. Something is not responding, or a protocol is blocked.

o Have you opened port 1723 on your router and pointed it to your Raspberry Pi's LAN address?

o Does your router support the "GRE" (general routing encapsulation) protocol, also known as IP protocol 47? Many don't, and some only support one use of that protocol at a time on their entire LAN. Some routers also have their own pptp VPN functionality; if so you might have to disable that.

Any other details would be helpful in trying to diagnose this. Incidentally, several folks have recommended OpenVPN for its own innate security, but it would seem to offer no security benefit for connecting to a pptp VPN, assuming it even supports pptp VPNs. I'd say just stick with the built-in Windows VPN client until we get this diagnosed.

Return to “Networking and servers”