Rinetd is a daemon program for redirecting TCP connections.

It is a single-process server that handles any number of connections to the address/port pairs specified in /etc/rinetd.conf
Because rinetd runs as a single process using non-blocking I/O, it is capable of redirecting a large number of connections without severely affecting the machine
This makes it practical to run services on machines inside the IP firewall.

Let's start the installation.

sudo apt update  
sudo apt install rinetd  

Now create a configuration file for rinetd, using the nano editor:

nano /etc/rinetd.conf  

At the end of the document we need to add lines:

85.85.85.85 12341 192.168.1.5 1234  
85.85.85.85 12342 192.168.1.6 1234  
85.85.85.85 12343 192.168.1.7 1234  
85.85.85.85 12344 192.168.1.8 1234  
85.85.85.85 12345 192.168.1.9 1234  
  • 1st column - IP listened to by rinetd
  • 2nd column - port listened to by rinetd
  • 3rd column - IP to which we redirect traffic
  • 4th column - port to which we redirect traffic from the port from the second column.

The values should be inserted without brackets and with spaces. For each connection you must add a different line, in order.

Next, we will restart the service:

service rinetd restart  

This completes the configuration.

Updated July 29, 2019