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.