端口转发

Posted by NekouTarou on 09-21,2022

Linux系统

使用rinetd转发

项目地址:https://github.com/samhocevar/rinetd/releases
1、配置rinetd.conf

0.0.0.0     本机端口       目标IP      目标端口

2、启动命令

sudo rinetd -c /etc/rinetd.conf

3、关闭

sudo pkill rinetd

Windows系统

Windows系统自带netsh端口转发

管理员打开power shell
1、查看端口转发情况

netsh interface portproxy show all

2、添加端口转发

netsh interface portproxy add v4tov4 listenaddress=本机IP listenport=本机端口 connectaddress=目标IP connectport=目标端口

3、删除转发

netsh interface portproxy delete v4tov4 listenaddress=本机IP listenport=本机端口

4、删除所有转发

netsh interface portproxy reset