V2ray报如下错误:
listen udp 0.0.0.0:60003: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
原因:Hyper-V保留了一些端口,包含这一端口
1.查看系统保留TCP,UDP端口
netsh interface ipv4 show excludedportrange protocol=tcp
netsh interface ipv4 show excludedportrange protocol=udp
2.关闭hyper-v,重启
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
3.再次查看系统保留端口
4.查看需要自定义保留的端口是否已被程序占用
netstat -ano
5.设置自定义保留端口
netsh int ipv4 add excludedportrange protocol=tcp startport=60000 numberofports=500
netsh int ipv4 add excludedportrange protocol=udp startport=60000 numberofports=500
6.若需删除配置项
netsh int ipv4 delete excludedportrange protocol=tcp startport=50051 numberofports=1
netsh int ipv4 delete excludedportrange protocol=udp startport=50051 numberofports=1
7.打开hyper-v,重启
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All