AmazingTomato

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

命令行下用netsh实现端口转发(端口映射)

netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=22 connectaddress=192.168.56.101 connectport=22
netsh interface portproxy delete v4tov4 listenaddress=192.168.193.1 listenport=22
netsh interface portproxy show all

重要说明,像localhost,127.0.0.1这样的内部地址,一般映射过一次以后会一直有效,但是外部地址就不是这样了,建议删除重来,同时注意防火墙问题。

netsh interface portproxy delete v4tov4 listenaddress=192.168.2.2 listenport=1521
netsh interface portproxy add v4tov4 listenaddress=192.168.2.2 listenport=1521 connectaddress=192.168.56.101 connectport=1521

端口号占用

netstat -ano|findstr "80"
tasklist|findstr 4764
taskkill /f /t /im 4764
posted on 2018-12-16 11:33  AmazingTomato  阅读(236)  评论(0编辑  收藏  举报