首页 > 其他分享 >rinetd tcp/udp 端口重定向服务

rinetd tcp/udp 端口重定向服务

时间:2022-11-26 20:22:06浏览次数:59  
标签:rinetd 0.1 udp tcp 192.168 80 rpm

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

标签:rinetd,0.1,udp,tcp,192.168,80,rpm
From: https://www.cnblogs.com/rongfengliang/p/16928210.html

相关文章

  • Tcpdump
    一、tcpdump1、作用tcpdump指令可列出经过指定网络界面的数据包文件头,可以将网络中传送的数据包的“头”完全截获下来提供分析。它支持针对网络层、协议、主机、网络......
  • 一种通过udp进行无确认ip的双向的通信
    前言udp是一种不可靠的通信,但是有些时候还是会有使用。今天分享一个示例:主体逻辑,一个端口广播地址,接收到ip地址数据后,其他端口基于这个ip进行bind绑定,最后通信,这样可以保......
  • 浅谈TCP三次握手
    前言TCP三次握手和四次挥手是面试题的热门考点,它们分别对应TCP的连接和释放过程,今天先来认识一下TCP三次握手过程,以及是否可以使用“两报文握手”建立连接?1、TCP是什么T......
  • 13、go的TCP网络编程
    创建客户端funcmain(){ //所需的网络编程全都在net包下 conn,err:=net.Dial("tcp","127.0.0.1:8888") fmt.Println("客户端启动") iferr!=nil{//连接失......
  • 一个 TCP 连接可以发多少个 HTTP 请求?
    曾经有这么一道经典面试题:从URL在浏览器被输入到页面展现的过程中发生了什么?相信大多数准备过的同学都能回答出来,但是如果继续问:收到的HTML如果包含几十个图片标签,这些......
  • 【Linux】linux | tcp | 解决CLOSE_WAIT问题 | 查询tcp连接状态
    一、说明        1、linux系统        2、java项目        3、发现CLOSE_WAIT增多,导致服务不可用(不稳定,时而稳定,时而超时)        4、close......
  • win 平台 UDP 客户端与服务器本机数据交互
    #include<stdio.h>#include<winsock2.h>#pragmacomment(lib,"ws2_32.lib")intmain(void){//初始化wsaWORDsockVision=MAKEWORD(2,2);WSADAT......
  • TCP/IP模型
    TCP/IP简介TCP/IP模型(也成为DARPA或DOD模型)仅由四层组成,而OSI参考模型为7层.TCP/IP模型的四个层是:应用层,也成为进程传输层,也成为主机到主机互联网层,也成......
  • Java 网络编程(六)UDP
    UDP发短信:不用连接,需要知道对方的地址客户端://不需要连接服务器publicclassUdpClientDemo01{publicstaticvoidmain(String[]args)throwsException{......
  • freecplus框架-tcp网络通信
    文章目录​​一、源代码说明​​​​二、概述​​​​三、通信的报文格式​​​​四、socket通信客户端​​​​五、socket通信的服务端​​​​六、示例程序​​​​1、客......