Page 1 of 1

Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 12:31 pm
by ybo
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

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 1:37 pm
by solo
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

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 1:49 pm
by ybo
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

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 1:58 pm
by solo

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.

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 2:05 pm
by ybo
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 ?

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 2:11 pm
by solo
Feature-patching of an open-source exe has to be legal.

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 3:19 pm
by ybo
Is disable NAT -T could help to solve the problem ?

Re: Setting UDP Port Range in SoftEther VPN Server

Posted: Wed Aug 30, 2023 10:58 pm
by solo
Sure, as long as your SE server's port is forwarded.