TCP protocol and different ports
The default protocol that OpenVPN uses is UDP, as it is generally more suitable for VPN connections. However, if the TCP protocol is required, then the preceding example needs to be modified only slightly:
On the listening end, start the OpenVPN server instance:
[root@server] # openvpn \ --ifconfig 10.200.0.1 10.200.0.2 \ --dev tun \ --proto tcp-server
On the client side, the code is as follows:
[root@client] # openvpn \ --ifconfig 10.200.0.2 10.200.0.1 \ --dev tun \ --proto tcp-client \ --remote openvpnserver.example.com
OpenVPN will now connect over TCP port 1194. It is also possible to override the port number using the --port
parameter, for example, --port 5000
.
The TAP mode
If non-TCP/IP traffic needs to be passed over the VPN tunnel (for example, legacy AppleTalk or IPX traffic), then a tap device is required. The tap device provides an interface to pass full Ethernet frames over the VPN tunnel. The overhead when passing full...