Can OpenVPN work on both tcp and udp in one configuration?


up to my knowledge one tunnel cannot work with both udp and tcp.

on the other hand i have running configuration with tunnel broker supporting incoming both tcp connections and udp connections defined in separate config files.


Just run two opevpn daemons, on different ports with different protocols.


This is an old question, but generally you do not want to use OpenVPN under TCP because it results in more network traffic.

For example with OpenVPN under UDP, sending single user tcp message looks like this:

client: <OpenVPN UDP msg1><user TCP msg0>
server: <OpenVPN UDP msg2><user TCP ack0>

With OpenVPN under TCP, every OpenVPN message is also TCP, so it has to get ack'd, including the acks that are part of the embedded stream. The same message looks like this:

client: <OpenVPN TCP msg1><user TCP msg0>
server: <TCP ack1>
server: <OpenVPN TCP msg2><user TCP ack0>
client: <TCP ack2>

Also TCP headers are a bit bigger.

With OpenVPN over UDP, the internal TCP layer will take care of any retransmits. The main disadvantage of UDP is that the connection can't tell whether it is really up or not. The default OpenVPN configuration handles this by setting a periodic keepalive ping.

  • True about TCP, but some end-user routers will fragment or timeout UDP connections. I've had issues with some lower-end cisco routers for example. – robbyt Jun 28 '13 at 22:29
  • Indeed: 18 months later, I too have found that sometimes OpenVPN over tcp will work when OpenVPN over udp will not. – Robert Calhoun Feb 2 '15 at 19:42

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.