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 進程號來進行關閉