Rinetd 安装

1、CentOS 7可通过编译好的RPM包直接安装

地址:http://li.nux.ro/download/nux/misc/el7/x86_64//rinetd-0.62-9.el7.nux.x86_64.rpm

2、源码编译安装

# 克隆代码
git clone https://github.com/samhocevar/rinetd.git
 
# 进入源码目录,执行如下命令创建配置文件
./bootstrap
 
# 执行如下命令创建构建文件
./configure
 
# 执行如下命令编译并安装
make && make install

3、创建配置文件

# 复制配置文件模板
cp rinetd.conf /etc/rinetd.conf
 
# 编辑配置(例如转发10.10.10.10的80端口)
# vim /etc/rinetd.conf
0.0.0.0       80        10.10.10.10  80

4、 创建服务管理文件并启动服务

# 创建服务启动文件
# vim /etc/systemd/system/rinetd.service
[Unit]
Description=Rinetd Daemon
After=network.service
Wants=network.service
 
[Service]
Type=forking
PIDFile=/var/run/rinetd.pid
ExecStart=/usr/local/sbin/rinetd -c /etc/rinetd.conf
Restart=on-failure
 
[Install]
WantedBy=multi-user.target
 
# 启动服务
systemctl enable --now rinetd
 
# 查看服务启动状态
systemctl status rinetd

参考:

https://github.com/samhocevar/rinetd
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值