ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Standalone Networking



Q: I'm developing TCP/IP client/server applications and want to run the client and the server on the same machine. However, I'm not on an Ethernet network, so I don't have a constant Internet connection or a fixed IP address. How can I get TCP/IP to work on my standalone machine, without having to dial into my ISP every time?

A: The easiest way to set up a single-machine network is to tunnel TCP/IP through AppleTalk, and set AppleTalk to use a "null" connection that won't connect to the outside world. You can use this on a machine with dial-up Internet access (to avoid having to dial up just to test your apps) or even on a totally disconnected PowerBook in the middle of the Kalahari desert.

Here's how to set it up:

  1. Make sure you've installed Remote Access / PPP software -- this is an optional install in Mac OS 8.5. If you didn't install it, you can run the OS installer again and do a custom install, just selecting that one option. (Actually, the only portion of this package that you need is the "Remote Only" extension, so if you already have that, you're set.)

  2. Use a text editor like SimpleText to create a plain text file in your Preferences folder named "hosts". Put the following lines in the "hosts" file:

    localhost CNAME foo.bar.com
    foo.bar.com A 127.0.0.1

    The domain name is arbitrary; the important part is the alias, which lets you use the standard TCP/IP convention of referring to your machine by name as "localhost".

  3. Open the AppleTalk control panel. If you have an existing AppleTalk configuration that you want to preserve, use the Configurations menu command to create a new one first. Now set the "Connect Via:" pop-up to "Remote Only". (If you don't see the pop-up or that item, double-check that the Remote Only extension was installed by the Remote Access/PPP installer.) This will enable AppleTalk via a "loopback" so it won't need or use a physical network connection.
  4. Open the TCP/IP control panel. If you have an existing TCP/IP configuration that you want to preserve, use the Configurations menu command to create a new one first. Set "Connect Via:" to "AppleTalk (MacIP)". Then set the "Configure:" pop-up to "Using MacIP Manually" and set the IP address to "192.168.1.1", which is in the range reserved for private networks. You can leave the rest of the text fields in the control panel blank. Then press the button "Select Hosts File...", and choose your "hosts" file (in the Preferences folder) from the file dialog that appears.

You are now ready to set up TCP/IP connections between applications running on your machine, even if you have no actual network connection. The IP address to connect to is "localhost" or "127.0.0.1".

If you want to be able to switch between this and other networking configurations like PPP or Ethernet, you can create named configurations in the control panels and then set up multiple locations in the Location Manager control panel to switch between the configurations. It takes a little work to set up, but you can then use the Control Strip to switch configurations with a single mouse click.

[Mar 15 1999]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.