VanDyke Software



This tip explains how to assign local IP addresses to connections and map names to these connections using the Windows HOSTS file.

Note: This tip is for use with SecureCRT® for Windows®.

Setting Up Remote Server Connections Using Local IP Addresses

Do you use SecureCRT port forwarding to connect to multiple web servers on different networks? This tip for more advanced users shows you a way to manage connections with localhost addresses and the Windows HOSTS file. It assumes a basic knowledge of TCP/IP and Secure Shell port forwarding.

A port forwarding user struggled with how to meet the requirement that each web server use port 80. He had been identifying servers by assigning them different port numbers, but found that some servers did not work properly. He also ended up with a list of URLs that weren't easily identifiable when he wanted to find a particular server in the Connect dialog:


It would be more intuitive to access a given port forward using a name that could be easily identified, such as http://mysite/.

Two steps are required to do this. First, rather than using the same localhost ID ( for each connection and then giving each connection a separate port number, you can assign any local IP address (127.x.y.z) to a connection.

For example:

This allows you to use the proper port and assign different IP address for each site.

A quick explanation of local IP addresses: In IP addressing, the network address with the initial number "127", like those shown above, is reserved for internal functions. You may also hear it called the "loopback address". "Localhost" is an alias or placeholder name for the current machine on which a program is running.

Once you have set up the correct local IP addresses, you can use a Windows HOSTS file to associate a hostname with any IP address. In Windows XP, the HOSTS file is located in the directory c:\windows\system32\drivers\etc\hosts, and contains IP addresses, domain names, and comments. Your sample entries would look like this:         news         # News server         dev          # Development web server         corp         # Corporate web server

Once this is done, you can use the hostname when setting up port forwarding in SecureCRT instead of having to remember IP addresses. Then, the servers would appear in the Connect dialog something like this:


The HOSTS file usually takes precedence over other services such as DNS (Domain Name System). Be aware that in certain complex environments setting this up may require the assistance of a system administrator.

For basic information on TCP/IP networking, one valuable resource is "TCP/IP For Dummies, 6th Edition", by Candace Leiden et. al. ISBN: 978-0-470-45060-4.

VanDyke Software uses cookies to give you the best online experience. Before continuing to use this site, please confirm that you agree to our use of cookies. Please see our Cookie Usage for details.