Setting UDP Port Range in SoftEther VPN Server

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
ybo
Posts: 4
Joined: Wed Aug 30, 2023 12:12 pm

Setting UDP Port Range in SoftEther VPN Server

Post by ybo » Wed Aug 30, 2023 12:31 pm

Hello SoftEther VPN community,

I'm reaching out to the forum for some assistance regarding the configuration of UDP port ranges in SoftEther VPN. After going through the source code on GitHub, I learned that the default random UDP port range is from 5000 to 65530. However, I'm interested in understanding how to customize or reduce this range to better suit my needs.

Could someone kindly guide me through the process of modifying the UDP port range in SoftEther VPN? Any insights into the configuration files or settings that need to be adjusted would be greatly appreciated. If there are any considerations or potential pitfalls to be aware of, I'd love to hear about those as well.


Thank you in advance for your time.

YBO

solo
Posts: 1192
Joined: Sun Feb 14, 2021 10:31 am

Re: Setting UDP Port Range in SoftEther VPN Server

Post by solo » Wed Aug 30, 2023 1:37 pm

If it is in the context of NAT-T then don't bother, it is unstable and unreliable, it depends on NAT types along the way and of course on servers.nat-traversal.softether-network.net

ybo
Posts: 4
Joined: Wed Aug 30, 2023 12:12 pm

Re: Setting UDP Port Range in SoftEther VPN Server

Post by ybo » Wed Aug 30, 2023 1:49 pm

Indeed, it's in this context.
I just want to reduce the range because 5000 to 65530 is like set a "any" rule.
I'm wondering why there is no tool -in vpncmd for example- to do this simple task.

If you have any idea, i'd be glad to hear it.

Thanks

solo
Posts: 1192
Joined: Sun Feb 14, 2021 10:31 am

Re: Setting UDP Port Range in SoftEther VPN Server

Post by solo » Wed Aug 30, 2023 1:58 pm

Code: Select all

// Start range of the random UDP port
#define	RAND_UDP_PORT_START			5000
#define	RAND_UDP_PORT_END			65530
#define	RAND_UDP_PORT_DEFAULT_NUM_RETRY	64
Change the value and re-compile it, or patch up the binary.

ybo
Posts: 4
Joined: Wed Aug 30, 2023 12:12 pm

Re: Setting UDP Port Range in SoftEther VPN Server

Post by ybo » Wed Aug 30, 2023 2:05 pm

Thank you.

I wished to not have to re compil the code but if it's the only solution...

By the way, are we allowed to do any modification on the exe. Is it legal ?

solo
Posts: 1192
Joined: Sun Feb 14, 2021 10:31 am

Re: Setting UDP Port Range in SoftEther VPN Server

Post by solo » Wed Aug 30, 2023 2:11 pm

Feature-patching of an open-source exe has to be legal.

ybo
Posts: 4
Joined: Wed Aug 30, 2023 12:12 pm

Re: Setting UDP Port Range in SoftEther VPN Server

Post by ybo » Wed Aug 30, 2023 3:19 pm

Is disable NAT -T could help to solve the problem ?

solo
Posts: 1192
Joined: Sun Feb 14, 2021 10:31 am

Re: Setting UDP Port Range in SoftEther VPN Server

Post by solo » Wed Aug 30, 2023 10:58 pm

Sure, as long as your SE server's port is forwarded.

Post Reply