Lua's Blog

Everythine will be fine.

0%

Windows动态端口限制导致无法绑定端口

启动程序绑定本机端口时提示:
When I try to bind a port to localhost, get the message:

An attempt was made to access a socket in a way forbidden by its access permissions

可通过此命令查看允许绑定的端口范围
This commandline can be show which port can be bind

netsh int ipv4 show dynamicport tcp

通过此命令可修改允许的端口范围
To modify the range of port, try the following commandline

1
2
netsh int ipv4 set dynamicport tcp start=49152 num=16383
netsh int ipv4 set dynamicport udp start=49152 num=16383