Reference Manual

HOW TO redirect Web traffic to a Web Server running on a machine behind NAT32.

NAT32 users who connect to the Internet via a service which gives your machine a variable IP address can easily redirect Web traffic to a private Web Server using the method described below.

  1. Make your advertised Home Page a file such as index.htm which contains a link to a private Home Page home.htm:

  2. <a href="http://137.92.11.80/home.htm">My Home Page</a>

    That Home Page will be stored on your ISP's site and that is where your users would normally navigate to.

    The IP address in the URL is a dummy address, it will be updated later to your real IP address.
     

  3. Store a copy of file index.htm in your NAT32 directory.

  4. Each time NAT32 detects an IP address change on your Primary Interface, it executes a script file called connect.txt (for a DUN connection) or change.txt (for DHCP-configured interfaces). The relevant script file can be modified to contain any desired NAT32 command(s).
     

  5. Add the following line to that script file:

  6. update index.htm home.htm www.mydomain.com /web/index.htm usercode password

The update command is a TCL script which searches file index.htm for the string home.htm contained in an href statement. If it finds such a reference, it will modify the link to contain whatever IP address your machine has at the time. After modifying the index.htm file, the update command will upload it to your ISP www.mydomain.com via FTP, saving it as /web/index.htm, and using the specified usercode and password.

You could make all this far more elaborate by having a clickable image on your home page or by using browser redirection. The only requirement is that the TCL update script must be able to find and modify the IP address in the link to your private home page.

The update script can easily be modified to meet your needs. In particular, you could modify it to use the NAT32 url command rather than the ftp command to transfer the updated index.htm file to your ISP.

Don't forget to add the needed ppmap command to your startup.txt file.

Be sure you are running the current build of NAT32 Version 2.

Note that an entirely different approach to this problem is described here.

SEE ALSO

ddns, ftp, httpget, url
Edit this page