Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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