Skip to content

port-share incompatible with mixed tcp/udp --local entries #1027

@otbutz

Description

@otbutz

Describe the bug

I'd like to run a single OpenVPN instance that listens on 1194/udp and 80/tcp. But apparently the usage of port-share requires dedicated instances:

Apr 28 09:15:21 openvpn systemd[1]: Starting openvpn-server@intern.service - OpenVPN service for udp...
Apr 28 09:15:21 openvpn openvpn[10395]: Options error: --port-share only works in TCP server mode (--proto values of tcp-server, tcp4-server, or tcp6-server)
Apr 28 09:15:21 openvpn openvpn[10395]: Use --help for more information.
Apr 28 09:15:21 openvpn systemd[1]: openvpn-server@intern.service: Main process exited, code=exited, status=1/FAILURE
Apr 28 09:15:21 openvpn systemd[1]: openvpn-server@intern.service: Failed with result 'exit-code'.

To Reproduce

Minimal config:

local * 1194 udp
local * 80 tcp
dev tun0
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/server.crt
key /etc/openvpn/server/server.key
dh /etc/openvpn/server/dh.pem
topology subnet
server 10.64.1.0 255.255.255.0
keepalive 10 120
cipher AES-256-GCM
auth SHA256
user nobody
group nogroup
persist-tun
port-share proxy.internal 80

Expected behavior

OpenVPN should still enforce that a TCP listener is present if port-share is configured, but should simply skip UDP listeners.

Version information (please complete the following information):

  • OS: Ubuntu 26.04
  • OpenVPN version: 2.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions