rinetd tcp/udp 端口重定向服务

rinetd 支持tcp 以及udp 协议的端口重定向,功能还是比较有用的,比如进行一些流量转发,配置上也是比较方便的,同时支持
一些简单的访问控制处理

构建

 
git clone https://github.com/samhocevar/rinetd.git
cd rinetd
./bootstrap
./confogure
make 

rpm 包

  • 命令
fpm -s dir -t rpm -n rinetd --rpm-os linux  \
  ./rinetd=/usr/local/bin/ \
  ./rinetd.service=/usr/lib/systemd/system/rinetd.service \
  ./rinetd.conf=/etc/rinetd/rinetd.conf
  • 配置
    rinetd.service
 
[Unit]
Description=rinetd
After=network.target
 
[Service]
Type=forking
ExecStart=/usr/local/bin/rinetd -c /etc/rinetd/rinetd.conf
 
[Install]
WantedBy=multi-user.target

配置 rinetd.conf

#
# this is the configuration file for rinetd, the internet redirection server
#
# you may specify global allow and deny rules here
# only ip addresses are matched, hostnames cannot be specified here
# the wildcards you may use are * and ?
#
# allow 192.168.2.*
# deny 192.168.2.1?
# allow fe80:*
# deny 2001:618:*:e43f
 
 
#
# forwarding rules come here
#
# you may specify allow and deny rules after a specific forwarding rule
# to apply to only that forwarding rule
#
# 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]
 
# logging information
logfile /var/log/rinetd.log
 
# uncomment the following line if you want web-server style logfile format
# logcommon

直接基于fpm 构建

说明

rpm 包我已经构建好了,放github 上了,可以支持使用

参考资料

https://github.com/samhocevar/rinetd
https://github.com/rongfengliang/rinetd-rpm

posted on   荣锋亮  阅读(232)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2021-11-26 maven-default-http-blocker 问题
2020-11-26 使用go-fuse开发一个fuse 文件系统
2020-11-26 awesome-fuse-fs
2019-11-26 nexus php composer host 模式repo 试用
2018-11-26 Modern Data Lake with Minio : Part 2
2018-11-26 Modern Data Lake with Minio : Part 1
2018-11-26 使用rclone 进行minio 文件同步

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示