Centos7下Rinetd安裝與應用

安裝篇

1、下載,解壓,安裝

[root@zhenyunode zhenyutest]# cd ~/zhenyutest/
[root@zhenyunode zhenyutest]# wget http://www.boutell.com/rinetd/http/rinetd.tar.gz
[root@zhenyunode zhenyutest]# tar -xvf ~/zhenyutest/rinetd.tar.gz
[root@zhenyunode zhenyutest]# cd ~/zhenyutest/rinetd/
[root@zhenyunode rinetd]# sed -i 's/65536/65535/g' rinetd.c
[root@zhenyunode rinetd]# mkdir /usr/man/
[root@zhenyunode rinetd]# make && make install
cc -DLINUX -g   -c -o rinetd.o rinetd.c
rinetd.c:176:6: 警告:與內建函數‘log’類型衝突 [默認啓用]
   void log(int i, int coSe, int result);
        ^
cc -DLINUX -g   -c -o match.o match.c
gcc rinetd.o match.o -o rinetd
install -m 700 rinetd /usr/sbin
install -m 644 rinetd.8 /usr/man/man8
[root@zhenyunode rinetd]#

 

2、創建配置文件

 

 

[root@zhenyutest rinetd]# vi /etc/rinetd.conf
0.0.0.0 8080 192.168.31.22 8080

配置文件格式很簡單:[Source Address] [Source Port] [Destination Address] [Destination Port]

 

3、啓動、關閉程序

 

 

啓動:
[root@zhenyunode rinetd]# rinetd -c /etc/rinetd.conf
[root@zhenyunode ~]# ps -ef | grep rinetd
root     27346 27300  0 12:34 pts/1    00:00:00 grep --color=auto rinetd
root     32186     1  0 5月16 ?       00:00:00 rinetd -c /etc/rinetd.conf

停止:
[root@zhenyunode rinetd]# killall rinetd

 

4、校驗

 

 

root@zhenyunode rinetd]# netstat -tanulp|grep rinetd
tcp        0      0 0.0.0.0:8080           0.0.0.0:*               LISTEN      32186/rinetd 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章