Linux 上简单的 rinted 端口转发工具

2022年12月24日 1792点热度 0人点赞 0条评论

在此下载源码: rinted.tar.gz

1. 安装

yum -y install gcc gcc-c++ make automake
tar zxvf rinetd.tar.gz
cd rinetd
./bootstrap
./configure
make && make install
# 编译安装后要把文件拷贝的指定目录,否则开不起来
cp rinetd /usr/bin/
cp rinetd.conf /etc/

 

2. 配置转发

转发的时候会在本地起一个监听端口,确认服务器没有使用到该端口。

以下内容分别为:

本机监听IP, 本机监听端口, 转发目标地址, 转发目标端口, 额外参数信息

# bindadress  bindport  connectaddress  connectport  options...
# 0.0.0.0     80        192.168.1.2     80
# ::1         80        192.168.1.2     80
# 0.0.0.0     80        fe80::1         80
# 127.0.0.1   4000      127.0.0.1       3000
# 127.0.0.1   4000/udp  127.0.0.1       22           [timeout=1200]
# 127.0.0.1   8000/udp  192.168.1.2     8000/udp     [src=192.168.1.2,timeout=1200]

 

3. 启动服务

/usr/bin/rinetd -c /etc/rinetd.conf
ps -aux|grep -v grep|grep rinetd.conf

[root@rinetd]# netstat -nltp|grep rinetd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      4720/rinetd

可将启动脚本放入 rc.local 以方便开机时自动启动转发

 

4. 关闭服务

pkill rinetd

 

5. 日志

/var/log/rinetd.log

 

6. 帮助

[root@rinetd]# man rinetd

路灯

这个人很懒,什么都没留下

文章评论