Client OpenVPN assigned IP:
   ↓ TCP on 1194
Router port-forwards 1194 to server- Public IP
Server LAN IP:

I think the above is what I am trying to do (the is the assigned IP).
I am trying to route multiple remote clients via TCP to my OpenVPN server (otherwise functioning as a samba file share) running Ubuntu 14.04.

As you can see, in my server.conf, I'm push "route ... ..."almost every option with my server assigned IP address, server internal IP address, an my network public IP address, because I am unsure which needs to be routed.

See the details and troubleshooting I have done below, and any suggestions would be much appreciated.


port 1194
proto tcp
mode server
dev tun
ca ca.crt
cert sambasrv.crt
dh dh2048.pem
ifconfig-pool-persis ipp.txt
push "route"
push "route"
push "route"
push "route 255.255.0"
push "route"
client-config ccd
keepalive 10 20
max-clinets 100
user nobody
group nogroup
log-append openvpn.log
verb 4


client dev tun
remote 1194
resolv-retry infinite
user nobody
group no group
persist key
persist tun
ca ca.crt
cert client1.crt
key client1.key
verb 4

I am now getting the socket bind failed on local address[undef], though with different configurations throughout the day, I have had success in getting the OpenVPN server to initialize, but has gone back to it's fatal error state after reboot/ more trouble shooting.

/etc/openvpn server.conf
Tue Dec 11 17:36:18 2012 Socket Buffers: R=[87380->131072] S=[16384->131072]
Tue Dec 11 17:36:18 2012 TCP/UDP: Socket bind failed on local address [undef]: Address already in use
Tue Dec 11 17:36:18 2012 Exiting due to fatal error

The server is able to ping itself (, but not the client.
client ping (server) times out.

Here are some more results from test that have been recommended in previous posts:

telnet 1194

doesn't connect #which I read that means that OpenVPN is fine, but the network isn't

netstat -nlp | grep 1194
udp   0   0 0.0.0:1194*   3593/openvpn

For the above netstat, I don't know why it's udp instead of tcp. Maybe there is an issue there?

Interface config

ifconfig tun0 connect
inet addr: P-t-P: Mask:

ip route show:

default via dev em1 via dev tun0 dev tun0 proto kernel scope link src dev em1 proto kernel scope link src

I've tried:

$iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE
$iptables -A INPUT -i tun0 -j ACCEPT

Enable IP forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Also note that on the client side, I am trying to connect to the server with Tunnelblick, and have successfully added the client.conf, ca.crt, client1.ct, and clinet1.key. Upon trying to connect, there is activity with packets going out, but not in.

  • Did you start another openvpn server process that is already listening, with different configuration by any chance (I say this due to the "Address already in use" bit)? Use fuser -n tcp 1194 to see which process is using tcp port 1194. – c4urself Dec 14 '14 at 21:59
  • @c4urself it doesn't look like there is another openvpn server process running. There is no output for fuser -n tcp 1194, and when running netstat -nlp |grep 1194 i get a one line output: udp 0 0* 9077/openvpn – atavel Dec 14 '14 at 22:47
  • If you stop openvpn, do you still get that netstat output? Just want to double-check. – c4urself Dec 14 '14 at 22:49
  • @c4urself no, I after stopping openvpn I get no output. – atavel Dec 14 '14 at 22:51
  • Ok, so the output seems to indicate that you're listening on UDP -- can you check that you're altering the correct server.conf? – c4urself Dec 14 '14 at 22:52

In the OPENVPN Logfile you find:

TCP/UDP: Socket bind failed on local address [undef]: Address already in use

I solved this problem with "Double-Restart" the OpenVPN Server. It toggles the binding problem. One time it works, next time it works not.

Hope, it helps somebody


  • 1
    I am not sure that helps, so much as happens to work from time to time. It sounds like in both your, and the OP's case, either something that shouldn't be is binding to the port, or the openVPN service isn't properly stopping when it is being restarted. For example, checking, once the error appears, what might actually be listening on 1194. – iwaseatenbyagrue Apr 6 '17 at 16:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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