Linux port ing and forwarding tool rinetd installation and use, linuxrinetd
Introduction
Rinetd is a tool for redirecting the Transmission Control Protocol (TCP) connection in Unix and Linux operating systems. Rinetd is a single-process server that processes any number of connections to the address/Port Pairs specified in the configuration file etc/rinetd. Although rinetd uses non-locking I/O operations as a single process, it may redirect many connections without adding additional burden on this machine.
Install
Script directly
Vim install_rinetd.sh
#!/bin/bash wget http://www.boutell.com/rinetd/http/rinetd.tar.gztar zxvf rinetd.tar.gzcd rinetdmkdir -p /usr/man/man8make && make install
Run the script to install sudo sh install_rinetd.sh.
Configuration File
Compile the configuration file vim/etc/rinetd. conf.
The configuration file format is simple:
Port forwarding: [Source Address] [Source Port] [Destination Address] [Destination Port]
Port ing: bindaddress bindport connectaddress connectport
Start the program
/Usr/sbin/rinetd-c/etc/rinetd. conf
Check whether startup is successful
Netstat-tanulp | grep rinetd
Add boot start
Vi/etc/rc. d/rc. local
Add/usr/sbin/rinetd-c/etc/rinetd. conf
Note 1. The local port bound to rinetd. conf must not be occupied by other programs.
2. The system firewall running rinetd should open the bound local port