CentOS 7 下端口转发rinetd

1、下载,解压,安装

$ wget http://www.boutell.com/rinetd/http/rinetd.tar.gz&&tar -xvf rinetd.tar.gz&&cd rinetd
$ sed -i 's/65536/65535/g' rinetd.c (修改端口范围)
$ mkdir /usr/man&&make&&make install

创建配置文件

配置文件格式很简单:[Source Address] [Source Port] [Destination Address] [Destination Port]

vi /etc/rinetd.conf
0.0.0.0 8080 192.168.31.22 8080
logfile /var/log/rinetd.log

3、启动、关闭程序

$ rinetd -c /etc/rinetd.conf
ps -ef | grep rinetd

$ killall rinetd

4、校验

$ netstat -tanulp|grep rinetd
0%