So I have been struggling to set up an OpenVPN server on a Pi 2 Model B running Raspbian.
I set up the server, then started it once and it appeared to be running normally. After restarting the Pi I cannot start the server anymore. The error message is TCP/UDP: Socket bind failed on local address. Here is the complete log:
Sat May 7 21:03:45 2016 OpenVPN 2.3.4 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jan 23 2016
Sat May 7 21:03:45 2016 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08
Sat May 7 21:03:45 2016 Diffie-Hellman initialized with 2048 bit key
Sat May 7 21:03:45 2016 Control Channel Authentication: using '/etc/openvpn/easy-rsa/keys/ta.key' as a OpenVPN static key file
Sat May 7 21:03:45 2016 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat May 7 21:03:45 2016 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat May 7 21:03:45 2016 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sat May 7 21:03:45 2016 TCP/UDP: Socket bind failed on local address [AF_INET]192.168.2.35:1593: Address already in use
Sat May 7 21:03:45 2016 Exiting due to fatal error
So I thought some process has taken my port (although I do not use a standard port) but actually this was not the case:
pi@raspberrypi:~ $ sudo netstat -pnta
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 595/Xtightvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 595/Xtightvnc
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 490/sshd
tcp 0 721 192.168.2.35:5901 192.168.2.33:63877 ESTABLISHED 595/Xtightvnc
tcp6 0 0 :::22 :::* LISTEN 490/sshd
I also tried removing the "local 192.168.2.35" line from server.conf but it didn't help.
I am kinda new here.. I have successfully set up one openvpn server on windows but this is pretty much all my experience with openvpn.
So any help is appreciated. Thanks 🙂