Option for OpenVPN to enable floating source port

on January 5th, 2017 by Hades | No Comments »

Sometimes it make sense to change the default ports of an OpenVPN installation, because these are those which are in case of an vulnerability scan attacked first or some company firewall rules makes it necessary.

With the

port 1194

directive in your config file the source and destination port for connections is always 1194.

For outgoing connections there are two ways to alter the source port:

A static source port

lport 12394

or the source port can be allocated dynamically by the IP stack. Then add

nobind

to your config.
Note: This option requires an connection initiated by the remote option.

The destination port can, of course, also be changed:
Append it to the remote option

remote openvpn.yourdomain.local 1194

or define it by the

lport 1194

parameter.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.