2

rinetd 端口转发

 1 year ago
source link: https://www.jansora.com/notebook/107540
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

rinetd 端口转发闲文杂记rinetd 端口转发 导航前往主站应用闲文杂记代码在线代码魔方房价浅析专栏戎码一生

Rinetd是为在一个Unix和Linux操作系统中为重定向传输控制协议(TCP)连接的一个工具。Rinetd是单一过程的服务器,它处理任何数量的连接到在配置文件etc/rinetd中指定的地址/端口对。尽管rinetd使用非闭锁I/O运行作为一个单一过程,它可能重定向很多连接而不对这台机器增加额外的负担。

有参考 http://xstarcd.github.io/wiki/sysadmin/rinetd.html

在 Ubuntu 下使用非常简单

  1. apt install rinetd 安装 rinetd

配置文件 /etc/rinetd.conf

配置文件格式很简单:

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

在每一单独的行中指定每个要转发的端口。源地址和目的地址都可以是

主机名或IP 地址,IP 地址0.0.0.0 将rinetd 绑定到任何可用的本地IP地址上:

0.0.0.0 8080 www.aslibra.com 80
0.0.0.0 3306 192.168.1.77 3306
0.0.0.0 88 127.0.0.1 80

直接运行程序就可以了看到占用端口服务了。

配置windows远程访问

比方说要把某内网的 windows主机 (ip 10.0.2.22) 的远程访问端口 3389 转发到本机的 33890, 代理远程访问, 使用一些命令即可
0.0.0.0 33890 10.0.2.22 3389


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK