版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011192409/article/details/83997846
1、软件下载
http://www.boutell.com/rinetd/http/rinetd.tar.gz
2、软件安装
[root@te tools]# tar -zxvf rinetd.tar.gz --解压
[root@te tools]# cd rinetd --进入文件目录
[root@te rinetd]# make
[root@te rinetd]# make install --安装之前请先建立好对应的目录(/usr/man/man8)。否则会报如下图所示的错误
3、编辑配置文件
[root@te rinetd]# vim /etc/rinetd.conf
插入一下内容
0.0.0.0 8080 xx.xx.xx.xx 80
保存退出
4、配置说明
这里的意思是将所有发往本服务器的80端口请求转发到 xx.xx.xx.xx目标服务器的80端口
5、启动rinetd
[root@te rinetd]# /usr/sbin/rinetd -c /etc/rinetd.conf
6、查看启动情况如下图所示
[root@te rinetd]# ps aux|grep rinetd
7、转发效果如下图
8、关闭rinetd(效果如图)
[root@te rinetd]# pkill rinetd
当然也可以使用kill -9 进程号来进行关闭