管理员身份打开终端

添加端口转发规则

netsh interface portproxy add v4tov4 listenport=445 listenaddress=127.0.0.1 connectport=新端口 connectaddress=服务器IP

删除端口转发规则

netsh interface portproxy delete v4tov4 listenaddress=服务器IP listenport=端口

查看端口转发规则

netsh interface portproxy show v4tov4

查看端口占用

netstat -aon | findstr "端口号"