2

I've been using a Raspberry Pi 3B (running Raspbian) with OpenVPN connected to a Portuguese IPVanish server for about a month now and everything has been great. In fact I've been amazed at the speeds and quality of service I've been getting.

It was initially very easy to set up, I simply followed this tutorial and it just worked. However, today it just stopped working. Nothing to my knowledge has changed and so I assumed it was a service issue. I contacted IPVanish and they told me all services were running as normal. I thought maybe the router had updated so I checked the firewall and enabled the port forwarding for 1194 on UDP and TCP but this didn't fix the problem. I even turned the firewall off temporarily to see the effect but still didn't fix the issue. I downloaded the cert again in case it was corrupted but still no joy.

Here is the content of my portugal.conf file:

client
dev tun
proto udp
remote lis-c09.ipvanish.com 443
resolv-retry infinite
nobind
persist-key
persist-tun
persist-remote-ip
ca /etc/openvpn/ca.ipvanish.com.crt
verify-x509-name lis-c09.ipvanish.com name
comp-lzo
verb 3
auth SHA256
cipher AES-256-CBC
keysize 256
tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-DSS-WITH-AES-256-CBC-SHA:TLS-RSA-WITH-AES-256-CBC-SHA
auth-user-pass /etc/openvpn/auth.txt

IPVanish don't supply a User Certificate or a Private Key so these have been left out, but this was working fine before as is.

The auth.txt file simply contains my username and password on separate lines as it always has and I've checked my login with these and they work.

In the tutorial it states at the bottom of step 3:

If you are having issues getting the tunnel up first try rebooting your Raspberry Pi and then double check the configuration for errors.

After doing some Googling I found this command to display the log:

grep VPN /var/log/syslog

The output of this is:

...
Jun 19 14:44:09 raspberrypi systemd[1]: Stopping OpenVPN connection to portugal...
Jun 19 14:44:09 raspberrypi systemd[1]: Stopped OpenVPN service.
Jun 19 14:44:09 raspberrypi systemd[1]: Stopping OpenVPN service...
Jun 19 14:44:09 raspberrypi systemd[1]: Starting OpenVPN service...
Jun 19 14:44:09 raspberrypi systemd[1]: Started OpenVPN service.
Jun 19 14:44:09 raspberrypi systemd[1]: Stopped OpenVPN connection to portugal.
Jun 19 14:44:09 raspberrypi systemd[1]: Starting OpenVPN connection to portugal...
Jun 19 14:44:09 raspberrypi ovpn-portugal[655]: OpenVPN 2.4.0 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 18 2017
Jun 19 14:44:09 raspberrypi systemd[1]: Started OpenVPN connection to portugal.

Which seems to suggest that the connaction has been established. But when I run ifconfig I get:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.15  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::cd06:9e93:85bd:e6ca  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:fe:cb:48  txqueuelen 1000  (Ethernet)
        RX packets 39800  bytes 2265408 (2.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 792  bytes 136823 (133.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 4  bytes 156 (156.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 156 (156.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:ab:9e:1d  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Any ideas why this has stopped working, what else should I be looking at?

Thanks,

Stu

3

Not all information about OpenVPN is logged to /var/log/syslog. You can view this information if you run the process manually.

First, stop the OpenVPN service: sudo systemctl stop openvpn

Then, try running OpenVPN manually: sudo openvpn --config /path/to/portugal.conf

This will give you much more detailed error messages to help you diagnose the problem further.

Note that the router port-forwarding you've done only applies to incoming connections on port 1194. You shouldn't need to port-forward because the Raspberry Pi is making an outgoing connection to the OpenVPN server.

  • +1 but better to use systemctl. service is emulated by systemd anyway. – Ingo Jun 20 '18 at 19:03
  • Thanks @WesleyChalmers. Doing this identified the issue as server side due to this error: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity). I didn't think this could be the case because I'd contacted IPVanish and was told everything was fine their side. So I installed the desktop app on my Mac and saw that it was connecting to a different server, lis-c05.ipvanish.com while lis-c09.ipvanish.com was not in their list of options. I changed the server and hey presto, it worked again. Would have been nice for IPVanish to have told me this. – Stuart Clarke Jun 22 '18 at 8:46
  • Sorry, I don't have enough reputation points to up-vote but I have marked it as the correct answer. – Stuart Clarke Jun 22 '18 at 8:47
  • That's fine, I got the ability to upvote just a few days ago 🙂 – Wesley Chalmers Jun 22 '18 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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