Issue with setting up OpenVPN on raspberryPI
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Issue with setting up OpenVPN on raspberryPI
Hello,
I need help with setting up my OpenVPN server on raspberryPI, I have followed the tutorial on https://www.pivpn.io/ and after I imported my config file to mobile app it does not want to connect... It keeps saying connecting to "ip:port", then stops after timeout. I have opened the ports on both routers aswell (ISP one and mine) for the TCP port number... Does anyone have an idea what could be wrong, when I type lsod command on pi it does not show openvpn port listening, but systemctl command shows that service is running...?
Thank you in advance.
I need help with setting up my OpenVPN server on raspberryPI, I have followed the tutorial on https://www.pivpn.io/ and after I imported my config file to mobile app it does not want to connect... It keeps saying connecting to "ip:port", then stops after timeout. I have opened the ports on both routers aswell (ISP one and mine) for the TCP port number... Does anyone have an idea what could be wrong, when I type lsod command on pi it does not show openvpn port listening, but systemctl command shows that service is running...?
Thank you in advance.
-
- OpenVPN Expert
- Posts: 685
- Joined: Tue May 01, 2012 9:30 pm
Re: Issue with setting up OpenVPN on raspberryPI
You need check your server it is running openvpn yes and firewall to let client connect first. Then come bach here when something is wrong. Only say not connect dont help at all .
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
I said that I have service running and that port is opened..?
-
- OpenVPN Expert
- Posts: 685
- Joined: Tue May 01, 2012 9:30 pm
Re: Issue with setting up OpenVPN on raspberryPI
Ok now let check port first .type this into terminal to see what port open and if openvpn as list on port or not. If there is no openvpn list port so your server not running.
sudo lsof -i -P -n | grep LISTEN
sudo lsof -i -P -n | grep LISTEN
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
pi@pi:~ $ sudo lsof -i -P -n | grep LISTEN
sshd 558 root 3u IPv4 16981 0t0 TCP *:22 (LISTEN)
sshd 558 root 4u IPv6 16983 0t0 TCP *:22 (LISTEN)
mysqld 674 mysql 25u IPv4 18255 0t0 TCP 127.0.0.1:3306 (LISTEN)
lighttpd 685 www-data 4u IPv4 18183 0t0 TCP *:8000 (LISTEN)
lighttpd 685 www-data 5u IPv6 18184 0t0 TCP *:8000 (LISTEN)
apache2 717 root 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
pihole-FT 725 pihole 5u IPv4 18240 0t0 TCP *:53 (LISTEN)
pihole-FT 725 pihole 7u IPv6 18242 0t0 TCP *:53 (LISTEN)
pihole-FT 725 pihole 12u IPv4 18247 0t0 TCP 127.0.0.1:4711 (LISTEN)
pihole-FT 725 pihole 16u IPv6 18249 0t0 TCP [::1]:4711 (LISTEN)
smbd 1093 root 32u IPv6 23813 0t0 TCP *:445 (LISTEN)
smbd 1093 root 33u IPv6 23814 0t0 TCP *:139 (LISTEN)
smbd 1093 root 34u IPv4 23815 0t0 TCP *:445 (LISTEN)
smbd 1093 root 35u IPv4 23816 0t0 TCP *:139 (LISTEN)
apache2 7201 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7202 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7203 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7204 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7205 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
cupsd 7206 root 6u IPv6 55159 0t0 TCP [::1]:631 (LISTEN)
cupsd 7206 root 7u IPv4 55160 0t0 TCP 127.0.0.1:631 (LISTEN)
sshd 12768 pi 10u IPv6 83489 0t0 TCP [::1]:6010 (LISTEN)
sshd 12768 pi 11u IPv4 83490 0t0 TCP 127.0.0.1:6010 (LISTEN)
pi@pi:~ $ sudo lsof -i -P -n | grep openvpn
openvpn 511 openvpn 6u IPv4 17764 0t0 UDP *:1194
sshd 558 root 3u IPv4 16981 0t0 TCP *:22 (LISTEN)
sshd 558 root 4u IPv6 16983 0t0 TCP *:22 (LISTEN)
mysqld 674 mysql 25u IPv4 18255 0t0 TCP 127.0.0.1:3306 (LISTEN)
lighttpd 685 www-data 4u IPv4 18183 0t0 TCP *:8000 (LISTEN)
lighttpd 685 www-data 5u IPv6 18184 0t0 TCP *:8000 (LISTEN)
apache2 717 root 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
pihole-FT 725 pihole 5u IPv4 18240 0t0 TCP *:53 (LISTEN)
pihole-FT 725 pihole 7u IPv6 18242 0t0 TCP *:53 (LISTEN)
pihole-FT 725 pihole 12u IPv4 18247 0t0 TCP 127.0.0.1:4711 (LISTEN)
pihole-FT 725 pihole 16u IPv6 18249 0t0 TCP [::1]:4711 (LISTEN)
smbd 1093 root 32u IPv6 23813 0t0 TCP *:445 (LISTEN)
smbd 1093 root 33u IPv6 23814 0t0 TCP *:139 (LISTEN)
smbd 1093 root 34u IPv4 23815 0t0 TCP *:445 (LISTEN)
smbd 1093 root 35u IPv4 23816 0t0 TCP *:139 (LISTEN)
apache2 7201 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7202 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7203 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7204 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
apache2 7205 www-data 4u IPv6 19937 0t0 TCP *:80 (LISTEN)
cupsd 7206 root 6u IPv6 55159 0t0 TCP [::1]:631 (LISTEN)
cupsd 7206 root 7u IPv4 55160 0t0 TCP 127.0.0.1:631 (LISTEN)
sshd 12768 pi 10u IPv6 83489 0t0 TCP [::1]:6010 (LISTEN)
sshd 12768 pi 11u IPv4 83490 0t0 TCP 127.0.0.1:6010 (LISTEN)
pi@pi:~ $ sudo lsof -i -P -n | grep openvpn
openvpn 511 openvpn 6u IPv4 17764 0t0 UDP *:1194
-
- OpenVPN Expert
- Posts: 685
- Joined: Tue May 01, 2012 9:30 pm
Re: Issue with setting up OpenVPN on raspberryPI
All service is LISTEN but openvpn is not. Remove it and install again. Server is not running how can client connect to it?
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
I have already done that it does not help... Why does the service say its running?
openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2021-07-22 13:03:32 CEST; 21h ago
Process: 495 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 495 (code=exited, status=0/SUCCESS)
Jul 22 13:03:32 pi systemd[1]: Starting OpenVPN service...
Jul 22 13:03:32 pi systemd[1]: Started OpenVPN service.
pi@pi:~ $ systemctl status openvpn@server.service
● openvpn@server.service - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled-runtime; vendor preset: enabled)
Active: active (running) since Thu 2021-07-22 13:03:33 CEST; 21h ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w ... n24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 511 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2062)
CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
└─511 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid
Jul 22 13:03:33 pi ovpn-server[511]: /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Jul 22 13:03:33 pi ovpn-server[511]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Jul 22 13:03:33 pi ovpn-server[511]: Socket Buffers: R=[180224->180224] S=[180224->180224]
Jul 22 13:03:33 pi ovpn-server[511]: UDPv4 link local (bound): [AF_INET][undef]:1194
Jul 22 13:03:33 pi ovpn-server[511]: UDPv4 link remote: [AF_UNSPEC]
Jul 22 13:03:33 pi ovpn-server[511]: GID set to openvpn
Jul 22 13:03:33 pi ovpn-server[511]: UID set to openvpn
Jul 22 13:03:33 pi ovpn-server[511]: MULTI: multi_init called, r=256 v=256
Jul 22 13:03:33 pi ovpn-server[511]: IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
Jul 22 13:03:33 pi ovpn-server[511]: Initialization Sequence Completed
openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2021-07-22 13:03:32 CEST; 21h ago
Process: 495 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 495 (code=exited, status=0/SUCCESS)
Jul 22 13:03:32 pi systemd[1]: Starting OpenVPN service...
Jul 22 13:03:32 pi systemd[1]: Started OpenVPN service.
pi@pi:~ $ systemctl status openvpn@server.service
● openvpn@server.service - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled-runtime; vendor preset: enabled)
Active: active (running) since Thu 2021-07-22 13:03:33 CEST; 21h ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/w ... n24ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 511 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2062)
CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
└─511 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid
Jul 22 13:03:33 pi ovpn-server[511]: /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Jul 22 13:03:33 pi ovpn-server[511]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Jul 22 13:03:33 pi ovpn-server[511]: Socket Buffers: R=[180224->180224] S=[180224->180224]
Jul 22 13:03:33 pi ovpn-server[511]: UDPv4 link local (bound): [AF_INET][undef]:1194
Jul 22 13:03:33 pi ovpn-server[511]: UDPv4 link remote: [AF_UNSPEC]
Jul 22 13:03:33 pi ovpn-server[511]: GID set to openvpn
Jul 22 13:03:33 pi ovpn-server[511]: UID set to openvpn
Jul 22 13:03:33 pi ovpn-server[511]: MULTI: multi_init called, r=256 v=256
Jul 22 13:03:33 pi ovpn-server[511]: IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
Jul 22 13:03:33 pi ovpn-server[511]: Initialization Sequence Completed
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Issue with setting up OpenVPN on raspberryPI
Your server is working, you have not done port-forwarding correctly.
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
I have 2 routers 1 from my isp and mine and I have portforwarded port 1194 udp on both of them...TinCanTech wrote: ↑Fri Jul 23, 2021 11:53 amYour server is working, you have not done port-forwarding correctly.
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Issue with setting up OpenVPN on raspberryPI
You are using UDP:1194 not TCP ..
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
Sorry, I did a mistake while writing, I have just checked and the ports are TCP...
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Issue with setting up OpenVPN on raspberryPI
The ports are a number, the protocol is TCP and your is not TCP, it is UDP.
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
Here is the link to screenshot from my router: https://prnt.sc/1gl9ybk
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
And the other router: https://prnt.sc/1glaos2
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Issue with setting up OpenVPN on raspberryPI
Your VPN is not using TCP, it is using UDP.
-
- OpenVpn Newbie
- Posts: 9
- Joined: Thu Jul 22, 2021 11:18 am
Re: Issue with setting up OpenVPN on raspberryPI
Okay, sorry for misunderstanding. I have changed my ports to UDP and the issue still persists
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm