【工具】rinetd 使用教程(linux 下的端口转发工具 )


日期:2019-07-30 20:00:36
更新:
作者:Bay0net
介绍:使用 rinetd 来转发某端口的流量。


0x01、 安装

官网 RINETD

安装方法很简单,一条语句就 OK 了。

apt-get install rinetd

配置文件

/etc/rinetd.conf

0x02、配置

使用方法

配置规则

方法 1:

bindaddress bindport connectaddress connectport

# 将所有发往本机 8080 端口的请求转发到 172.19.94.3:8080
0.0.0.0 8080 172.19.94.3 8080

# 将所有发往本机 2222 端口的请求转发到 192.168.0.103 的 3389 端口
0.0.0.0 2222 192.168.0.103 3389

方法 2:

[Source Address] [Source Port] [Destination Address] [Destination Port]

# 将所有发往 1.2.3.4 的 80 端口请求转发到 192.168.0.10 的 80 端口
1.2.3.4 80     192.168.0.10 80

0x03、启动和关闭

# 关闭进程
pkill rinetd  

# 启动转发
rinetd -c /etc/rinetd.conf  

本机开启的是 80 端口:

此时,访问 8080 和访问 80 完全一样。

原文地址:https://www.cnblogs.com/v1vvwv/p/rinetd.html