本文介绍: 本文主要介绍linux 环境下 端口转发安装及维护。

修订记录

零 摘要

本文主要介绍linux 环境下 端口转发安装及维护

一 环境

[root@2023001 ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@2023001 ~]#
[root@2023001 ~]# rinetd -v
rinetd 0.62
[root@2023001 ~]#

二 安装及维护

2.1 rinted

2.1.1 安装及配置

2.1.1.1 下载

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

[root@2023001 soft]#  wget  http://li.nux.ro/download/nux/misc/el7/x86_64//rinetd-0.62-9.el7.nux.x86_64.rpm

2.1.1.2 安装

直接rpm -ivh 即可

[root@2023001 soft]# rpm -ivh rinetd-0.62-9.el7.nux.x86_64.rpm
warning: rinetd-0.62-9.el7.nux.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 85c6cd8a: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:rinetd-0.62-9.el7.nux            ################################# [100%]

2.1.1.3 配置

配置文件地址/etc/rinetd.conf

假设通过当前服务器874 端口 ,转发到 mirrors.tuna.tsinghua.edu.cn 服务器873 端口

0.0.0.0 874 mirrors.tuna.tsinghua.edu.cn 873

2.1.2 维护

2.1.2.1 常用命令

启动

[root@2023001 etc]# systemctl restart rinetd
[root@2023001 etc]# systemctl status rinetd
● rinetd.service - SYSV: rinetd is a TCP redirection server
   Loaded: loaded (/etc/rc.d/init.d/rinetd; bad; vendor preset: disabled)
   Active: active (running) since Sun 2024-02-04 16:45:00 CST; 6s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 30257 ExecStart=/etc/rc.d/init.d/rinetd start (code=exited, status=0/SUCCESS)
    Tasks: 1
   Memory: 1.0M
   CGroup: /system.slice/rinetd.service
           └─30266 /usr/sbin/rinetd

配置开机启动

[root@2023001 ~]# systemctl enable rinetd
rinetd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig rinetd on
[root@2023001 ~]# systemctl list-unit-files | grep enable | grep rine
[root@2023001 ~]#

检查开机启动

[root@2023001 ~]# chkconfig --list  | grep rinetd

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

rinetd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@2023001 ~]#

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注