rinetd软件介绍

热爱生活,虽然她给你无尽的磨难;

珍惜所爱之人,因为她/他就是你所爱的人啊;

热爱技术,因为技术改变世界。

一 简介

1.3 简介

二 具体说明

2.1 原理图

2.2 技术细节

2.3 技术总结

三 例子

3.1 服务器环境

3.2 软件环境

3.3 安装及配置

3.4 测试

3.5 问题总结

四 参考文献

五 后记

5.1 文档总结

5.2 致谢


一 简介

1.3 简介

       rinetd软件是一种简单的tcp端口转发技术,安装和配置都十分简单。

二 具体说明

2.1 原理图

                                                                                  图1 架构图 [3]

2.2 技术细节

    Redirects TCP connections from one IP address and port to another. rinetd is a single-process server which handles any number of connections to the address/port pairs specified in the file . Since rinetd runs as a single process using nonblocking I/O, it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run TCP services on machines inside an IP masquerading firewall.[1]

    rinetd软件实现的是将发往本机某个 口上的某个端口的访问传递到别的服务器的某个 口的某个端口,ip:prot >ip:port,端口为TCP协议的端口。

2.3 技术总结

三 例子

3.1 服务器环境

服务器环境:

络环境:

 

3.2 软件环境

软件版本:

执行文件目录:

3.3 安装及配置

wget https://boutell.com/rinetd/http/rinetd.tar.gz
tar zxvf rinetd.tar.gz
cd rinetd/
mkdir  -p /usr/man/man8
make
make install

配置文件:

启动:

配置后端服务器:

172.16.1.14

172.16.1.15

3.4 测试

 

3.5 问题总结

    其实rinetd的功能完全可以运用iptables来实现,就如本例子中的功能,完全可以由下面的防火墙配置实现:

iptables -t nat -I PREROUTING -p tcp –dport 10021 -j DNAT –to-destination 172.16.1.14:11021
iptables -t nat -I PREROUTING -p tcp –dport 10022 -j DNAT –to-destination 172.16.1.15:11022
iptables -t nat -I POSTROUTING -j MASQUERADE

四 参考文献

五 后记

5.1 文档总结

5.2 致谢

    本人使用第一次使用该软件,完全是由三石磊在一次技术交流中提起引起的,在这里表达对他的感谢,预祝他能快乐的生活,别再继续胖下去了。

                                                                                                                                                         2018年8月26日 于北京昌平

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2018年7月22日
下一篇 2018年7月22日

相关推荐