Which outbound ports OpenVPN client relies on?

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Which outbound ports OpenVPN client relies on?

Post by Josko » Wed Apr 06, 2022 4:44 pm

Hello!

I know from experience that OpenVPN clients in foreign networks do not require any inbound port to be open.
But what about outbound ports (e.g. in some cases of very strict security policies where outbound ports might be closed) ?

My experiments showed that OpenVPN client's connection work until all outbound ports are open, but as soon I close them (leaving three of them open: 1194, 443 and 2002-it is my default one), OpenVPN does not work then.

Which outbound ports have to be open by the clients ?
Many thanks in advance!!

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Which outbound ports OpenVPN client relies on?

Post by openvpn_inc » Sat Apr 09, 2022 7:49 pm

Hi Josko,

The answer to that depends what port(s) the server is using. OpenVPN Access Server, for example, can accept client connections on either TCP port 443 or UDP port 1194.

Perhaps what you are missing is a rule to accept the replies from the server?

regards, rob0
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Re: Which outbound ports OpenVPN client relies on?

Post by Josko » Sun Apr 10, 2022 10:00 pm

Thanks for reply!
My server (inside the Server.ovpn file) is configured to listen on port 2002.
As I said above: I tried at client to leave these 3 outbound ports 1194, 443 and 2002 open, but seems some other is being used?

Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Re: Which outbound ports OpenVPN client relies on?

Post by Josko » Thu Apr 14, 2022 5:14 pm

Could anybody help please?

Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Re: Which outbound ports OpenVPN client relies on?

Post by Josko » Thu Apr 21, 2022 5:56 pm

Rule for accepting replies from the server: are they accepted through clients' outbound ports: TCP443, UDP1194 and UDP2002 ? Or something else needs to be opened at the client?

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: Which outbound ports OpenVPN client relies on?

Post by TinCanTech » Thu Apr 21, 2022 6:08 pm

Search for ephemeral ports..

And learn about networking.

Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Re: Which outbound ports OpenVPN client relies on?

Post by Josko » Fri Apr 22, 2022 8:27 am

Thanks for reply!

Josko
OpenVpn Newbie
Posts: 7
Joined: Wed Oct 28, 2020 11:27 am

Re: Which outbound ports OpenVPN client relies on?

Post by Josko » Sun Jul 10, 2022 3:51 pm

Hello!
I have run

Code: Select all

sudo netstat -tunlp
command and found out that OpenVPN process uses some strange port (usually between 49 and 55 K), I guess it is "ephemeral port" previous guy has mentioned, the question is now how to make that port fixed so I can make an outgoing port-based rule (in cases when firewall blocks outgoing traffic ) ?
Because port number seems to change after every reboot.

BTW. OpenVPN server listens on port 2002 (no mention of this port under Netstat, what confused me as well).
Netstat's output:
https://ibb.co/rHLNqqg

Post Reply