1) install the software rinted
Download rinetd.tar
Tar xvzf rinetd.tar.gz # extract the program
Compile and install
Make
Make install
2) edit the configuration file
Vi/etc/rinetd. conf
59.33.120.36 80 192.168.0.72 80
Allow 59.33.120 .*
Logfile/var/log/rinetd. log
3) Run
Rinetd-c/etc/rinetd. conf
4) view the port
Netstat-antup
Done!
Detailed description:
1. Edit Configuration
Vi/etc/rinetd. conf
0.0.0.0 8080 172.19.94.3 8080
0.0.0.0 2222 192.168.0.103 3389
1.2.3.4 80 192.168.0.10 80
Description (0.0.0.0 indicates that the local machine is bound to all available addresses)
Forward all requests sent to port 8080 of the Local Machine to port 8080 of port 172.19.94.3
Forward all requests sent to port 2222 of the Local Machine to port 3389 of 192.168.0.103.
Forward all port 80 requests sent to port 1.2.3.4 to port 80 of 192.168.0.10.
Command Format is
Bindaddress bindport connectaddress connectport
The port to which the bound address is connected
Or
[Source Address] [Source Port] [Destination Address] [Destination Port]
Source Address Source Port Destination Address destination port
2. Start the program
Pkill rinetd # Shut down the process
Rinetd-c/etc/rinetd. conf # start forwarding
Add this command to/etc/rc. local to run automatically upon startup.
3. view the status
Netstat-antup
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
Author "lvinie"