[Solved] Socket bind failed on local address [undef]: Address already in use

Samples of working configurations.
Locked
johnaaronrose
OpenVpn Newbie
Posts: 3
Joined: Thu Apr 09, 2015 12:00 pm

[Solved] Socket bind failed on local address [undef]: Address already in use

Post by johnaaronrose » Thu Apr 09, 2015 12:18 pm

I configured about a year ago an OpenVPN Server (using tun0 on version 2.3.2-7) on my Ubuntu desktop. I haven't changed any of the /etc/openvpn files. My router does port forwarding of 1194 to my desktop. My desktop's firewall allows UDP of 1194. However, when I 'cd /etc/openvpn' followed by 'openvpn server.conf', I get "Thu Apr 9 12:46:28 2015 us=981954 TCP/UDP: Socket bind failed on local address [undef]: Address already in use". 'netstat -anp | grep 1194' shows 'udp 0 0 0.0.0.0:1194 0.0.0.0:*'. 'netstat -plnt' shows nothing for 1194. I feel that I'm missing something obvious. Any ideas?
PS I'm just a beginner with OpenVPN. I used a tutorial, but I don't remember its URL. I've attached a copy of the tutorial as a tar.gz of the .odt file, slightly adapted for me.
You do not have the required permissions to view the files attached to this post.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

Re: Server now shows "Thu Apr 9 12:46:28 2015 us=981954 TCP

Post by Traffic » Thu Apr 09, 2015 3:30 pm

johnaaronrose wrote:Socket bind failed on local address [undef]: Address already in use
Openvpn is already started and you try to start it again without stopping it first ..

johnaaronrose
OpenVpn Newbie
Posts: 3
Joined: Thu Apr 09, 2015 12:00 pm

Re: Server now shows "Thu Apr 9 12:46:28 2015 us=981954 TCP

Post by johnaaronrose » Fri Apr 10, 2015 9:30 am

Thanks, you were right: it's obvious even to me now! It was confirmed by 'service openvpn status' displaying ' * VPN 'server' is running'. I guess that openvpn must automatically start when I login to Ubuntu: something that I didn't realise before.

johnaaronrose
OpenVpn Newbie
Posts: 3
Joined: Thu Apr 09, 2015 12:00 pm

Re: Server now shows "Thu Apr 9 12:46:28 2015 us=981954 TCP

Post by johnaaronrose » Sat Apr 11, 2015 10:24 am

I thought that I'd already replied but I don't see my reply. Thanks for the reply. You were correct. My openvpn noobyness certainly showed. Interestingly openvpn server starts automatically on my Ubuntu Trusty desktop i.e. without my invoking it. How does that happen?

I just tried to test starting openvpn client on my Ubuntu Trusty laptop and it refused:
john@Laptop:~$ openvpn --remote 88.97.74.226 --comp-lzo --dev tun --auth-user-pass --ca /etc/openvpn/ca.crt --client
Sat Apr 11 11:23:14 2015 OpenVPN 2.3.2 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Dec 1 2014
Enter Auth Username:john
Enter Auth Password:
Sat Apr 11 11:23:23 2015 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sat Apr 11 11:23:23 2015 UDPv4 link local (bound): [undef]
Sat Apr 11 11:23:23 2015 UDPv4 link remote: [AF_INET]88.97.74.226:1194
Sat Apr 11 11:23:23 2015 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Sat Apr 11 11:23:24 2015 [VPNServer] Peer Connection Initiated with [AF_INET]88.97.74.226:1194
Sat Apr 11 11:23:26 2015 ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Sat Apr 11 11:23:26 2015 Exiting due to fatal error
Any ideas on diagnosing this error?

User avatar
Traffic
OpenVPN Protagonist
Posts: 4081
Joined: Sat Aug 09, 2014 11:24 am

Re: Server now shows "Thu Apr 9 12:46:28 2015 us=981954 TCP

Post by Traffic » Mon Dec 28, 2015 2:04 pm

johnaaronrose wrote:Sat Apr 11 11:23:26 2015 ERROR: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Sat Apr 11 11:23:26 2015 Exiting due to fatal error
Maybe you are not running as root.

Locked