Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories


Configuring port forwarding with rinetd

Ástþór IPÁstþór IP

inetd redirects TCP connections from one IP address and port to another. rinetd is a single-process server which handles any number of connections to the address/port pairs specified in the file /etc/rinetd.conf. Since rinetd runs as a single process using nonblocking I/O, it is able to redirect a large number of connections without a severe impact on the machine. This makes it practical to run TCP services on machines inside an IP masquerading firewall.

1. Install rinetd

apt-get install rinetd

2. Add some forwarding rules (pico /etc/rinetd.conf)

# bindadress bindport connectaddress connectport
0.0.0.0 80 209.85.229.104 80 # HTTP
0.0.0.0 110 209.85.229.109 110 # POP3
0.0.0.0 143 209.85.229.109 143 # IMAP

These rules will forward all http, pop3 and imap connections to Google’s web, pop3 and imap servers. It’s just an example but it may make more sense to forward for example port 80 on a public IP address to the internal network to a server that does not have a public IP address.

3. Restart rinetd

/etc/init.d/rinetd restart

Now enter http://youserver in a web browser and you’ll see Google search.

Comments 0
There are currently no comments.