TCP Traffic Redirection on Windows

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, April 14, 2010

Follow me on Twitter as @mattiasgeniar

A very nifty tool, called RINETD.

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 configfile.

How to use it

First of, download it from the website. The Windows 2000 version also works on Server 2003.

Create a new config file, called “config.cfg” in the same folder as where you’ve extracted the file. Add the following line. The format is “ ".

0.0.0.0 80 192.168.100.1 80

And start the daemon by executing the following.

C:\Folder\Where\You\Extracted\rinetd>rinetd.exe -cĀ config.cfg

This will start the daemon, using the config file mentioned. The example lets you redirect all traffic (0.0.0.0) on port 80 to a new server (192.168.100.1) on port 80. A perfect HTTP redirection!

You can add multiple rules, change ports, … A new rule should be started on a new line.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.