OpenVPN Configuration - Multiple Ports


I currently have my OpenVPN connection setup to accept connections from: TCP 443, TCP 8080, and UDP 1194. Is there a way that I can have all three of these server configurations assign from just one IP pool? (For ex. 10.7.0.x)

Right now they all assign on their own IP pools:

TCP 443 -

TCP 8080 -

UDP 1194 -

Thank you in advance!

3 Replies

I'm assuming you're currently running 3 different OpenVPN servers - one for each port?

You can run just one OpenVPN server for all TCP ports, and just one OpenVPN server for all UDP ports, and give each server its own IP address pool. Then you can use iptables to redirect ports. Unfortunately it's not possible to combine the TCP and UDP servers because TCP and UDP are very different protocols.

If you want to do this with your TCP servers, choose just one of the ports to run OpenVPN on (let's say 443), and then set up the following iptables rule for the other port (8080):

iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 443 -j DNAT --to-destination :8080

(replace X.X.X.X with your server's IP address)

Thanks for the suggestion. But, the problem I am trying to solve is a little more complicated. My email server is located at and I currently use dnsmasq to set to route to so that my SSL certificate would be valid for *

However, I have now run into the problem where if I connect via TCP 443, there is no set route to and it causes it to try to connect to the local wireless AP I am connected to, which causes my connection to fail.

Is there a solution to this problem? Thanks! :D

Yeah, you can configure each VPN server to push a route to the other VPN subnets, by adding options like these to the config files:

push "route"
push "route"
push "route"

Now when VPN clients connect they should get routes to your mail server at regardless of which VPN server they connected to.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct