cmd有用的命令

端口转发(需要管理员权限)
netsh interface portproxy add v4tov4 listenaddress=192.168.11.199 listenport=10001 connectaddress=127.0.0.1 connectport=6666
注:listenaddress是指监听的IP,listenport是指监听的端口号;connectaddress是指转发至目标IP,connectport是指目标端口

要查看所有的侦听端口
netsh interface portproxy show all

要删除某条规则
netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=80

查看被占用端口对应的PID
netstat -aon|findstr "49157"

查看PID对应的进程名称
tasklist|findstr "2720"

猜你喜欢

转载自www.cnblogs.com/wjsffzb/p/10339145.html