Jul 121998

Redirecting port requests

This example shows you how to redirect incoming http requests to a machine on your internal LAN.  You could also use this method to redirect telnet, ftp, etc.

The www uses the http protocol.  I run MS FrontPage 98 on NT1.  I wanted to redirect http requests from the gateway machine to the web server on NT1.  It was pretty easy, but a few hurdles along the way.

Please note, that this was for my testing and education only.  I don’t intend to continue to redirect such requests.  But I wanted to try it.  Just to see.   Eventually, I plan to add http to my gateway machine as yet another place to publish my webpage.

Looking at the natd manual, it shows that redirect_port is the command line option to use.  I added the following line to my natd.conf file.  Please note, the IP address has been changed for security reasons.

redirect_port tcp 111.222.333.444:80
redirect_port ucp 111.222.333.444:80

And I tried to access the page from my own subnet.  But I couldn’t.  So I jumped on EFnet IRC Network #freebsd to verify my solution.  I received confirmation that what I was doing was correct.  And to as a test, it was suggested that I get an external shell and try that.  External shell?  What’s that?

In the end, my helper asked for the URL and they tried it.  No luck.

Brain wave!

Filter rules…. kill the filter rules.  I cleared out the filter rules and asked him to try again.  This time, success!

  2 Responses to “Redirecting port requests”

  1. As on my understading this option that was added in the
    natd.conf is incomplete.. Its missing the origin port so the sintax
    would be:

    Parameter destinationaddres:port Origin port
    redirect_port tcp 111.222.333.444:80 80

    Let me know if i’m doing something wrong in here..
    (I tried to do the same thing on my side but it only worked when
    I added the origin port)