[Questions & Answers]
[Mac WWW FAQ]

Networking Questions

How can I configure my TCP (MacTCP or OpenTransport) to allow me to run network applications locally without actually being connected to a network?

In order to run TCP/IP applications (including servers like MacHTTP) without being connected to a network, a Mac still needs to be setup as if it were part of a network. There are some special requirements in doing this for a standalone machine.

The following method has been tested on a number of systems and requires no extra software (beyond MacTCP or OpenTransport).

Ethernet cannot be used unless you are connected to a hub or another ethernet device (if you are, you don't need the following method). So, you will instead have to use AppleTalk over LocalTalk (whether or not you're actually connected to a LocalTalk network. This method uses MacIP which is a way of using TCP/IP within AppleTalk.

AppleTalk must be on. To turn it on, you can use the 'Chooser' (usually found under the Apple menu). Simply select the 'Active' radio button next to the word 'AppleTalk'.

[Graphic of Chooser AppleTalk selection]

Depending on which you're using, MacTCP or OpenTransport TCP/IP need to be configured to connect using AppleTalk/MacIP.

You need to pick an arbitrary IP Address. I recommend 192.0.1.2.

  1. MacTCP Local Setup

    Set the Network control panel to LocalTalk.

    Set your TCP connection to LocalTalk (usually shown as an icon of a mac with network wires coming out the bottom).

    [Graphic of MacTCP Control Panel]

    Set your IP address to the arbitrary address you've chosen to use (192.0.1.2 is recommended).

    [Graphic of MacTCP Control Panel]

    Then click on the 'More...' button in the MacTCP control panel to bring up an additional dialog box. The settings in the "More" dialog need to be as follows:

    [Graphic of MacTCP Control Panel Second Dialog]

    Obtain Address:
    Manually
    Routing Information: Gateway Address:
    0.0.0.0
    IP Address: Class:
    C
    Domain Name Server Information:
    (the fields under this heading should be blank unless you are running a Domain Name Server on your Mac)

    To initiate the changes to the MacTCP configuration, restart your computer. You will then be able to launch your TCP/IP software, including servers, and access it using http client software on the same mac.

  2. OpenTransport Local Setup

    Configure the "TCP/IP" control panel as follows:

    [Graphic of OpenTransport TCP/IP Control Panel]

    Connect via:
    AppleTalk (MacIP)
    Configure:
    Using MacIP Manually
    IP Address:
    192.0.1.2

    Click the 'Select Zone...' button in the "TCP/IP" control panel to bring up the "Select MacIP Server Zone" dialog.

    Select "Current AppleTalk zone" in the dialog.

    [Graphic of OpenTransport MacIP zone dialog]

You will have to address server software you run on your local machine by the IP address you assigned in the TCP/IP configuration (192.0.1.2). For example, a web server would be addressed using the url "http://192.0.1.2/" from your client software.

If you are running server software (such as a web server) using this method, you should turn off DNS (domain name server) lookups in your server configuration.

If you want to use domain names instead of IP addresses, you will need to configure domain names in your TCP "hosts" file. This file is found in your "System Folder". Instructions for setting up the hosts file are contained in the default "hosts" file supplied with MacTCP or OpenTransport.

An alternative method

An alternative to the above is to use your SLIP or PPP setup (if you're using one) to provide a 'local only' connection.

You will need to set up a local setting with the SLIP/PPP application/control-panel. This should be set to use TCP without dialing out. You can use your usual SLIP/PPP IP address (or 192.0.1.2 if you don't have one).


How can I switch between networked and non-networked configurations?

OpenTransport

Use the "Configurations..." menu item in the "File" menu.

MacTCP

MacTCP Switcher or MacTCP NetSwitch may be useful to users who access their TCP Networks by modem (using protocols such as SLIP or PPP). It provides for relatively easy switching between MacTCP configurations. I use this to switch between my SLIP configuration for when I'm a client of other sites, and my Local, no-network, configuration (as described above).

Using MacTCP Switcher

You configure MacTCP the way you want, then run the tcp switcher to save the current configuration. Repeat the process for every different configuration you use. Then, when you want to reload a configuration, just open the MacTCP Switcher file you created for that configuration. You should restart your Mac after switching the tcp configuration in order for MacTCP to reset itself.


How can I use MacTCP on a LocalTalk network?

Generally, you should be using a hub or gateway that supports MacIP over LocalTalk. If all you want is to connect a couple Macs on a simple LAN, you can often (but don't consider this anything close to guaranteed) have two Macintosh computers perform TCP communication using MacTCP over LocalTalk without any special routing devices or software.

Make sure AppleTalk is on. You can do this using the Chooser (usually found in the Apple menu), or with OpenTransport's AppleTalk control panel. You may (but probably not) have to restart your computer for AppleTalk to come on. You will be informed by the Chooser if this is the case.

Configure MacTCP on both machines as described in the section on using MacTCP without a network. However, you should set one of them to have an IP address one more than the other. IE. if one is set to 192.0.1.2 the other should be 192.0.1.3 or 192.0.1.1.

After restarting, (or possibly even without restarting) you should be able to use a TCP client application on one mac to talk to a TCP server application on the other. Be sure to use the address (IE. http://192.0.1.2/) to reference the machines in this configuration. Domain names (IE. http://my.mac.home/) will not work unless you've configured your "Hosts" file with names mapped to the IP addresses you are using.


Why can't I get Netscape to access a server when using MacTCP with no network?

Netscape may become 'confused' about the address it was accessing and end up trying to access 255.255.255.255 instead of 192.0.1.2. You may want to switch your IP from 192.0.1.2 to 255.255.255.255 or 1.1.1.1.


How can I use domain names when I don't have a name server available?

You need to modify your "Hosts" file which is a plain text file that should be in your "System Folder". If it isn't there, just create a new one. You can make a domain name for your local IP by including a line like the following:

   www.mysite.home.  A      192.0.1.2.

The first part is the domain name to use, the A indicates that this is an address mapping, and the number is the IP address to map the name to.

You can also make shortcuts for the names, so that you don't have to type in the whole name every time.

   home.             CNAME  www.mysite.home.

The first part is the 'nickname', the CNAME indicates that this is a nickname mapping, and the third part is the 'real' name to map the nickname to.


How can I have multiple names for a single machine?

Any number of domain names may be assigned to a particular IP address, but they will all amount to the same thing. For example, a machine with IP address 123.45.67.89 could have different names such as (the fictional) one.two.three.com, mac.serv.school.edu and house.here.net. Any machine accessing one of those names will first resolve the name to the IP address 123.45.67.89 before establishing a connection.


How do clients use domain names to locate servers?

Client software never actually does TCP access using the domain name. Before connecting, the client software (IE. Netscape) does a domain name lookup to retrieve the actual IP address of the machine. The IP address is then used to locate and connect to the server. So, the server does not know what domain name the client accessed from, only the IP address used.


What is "in-addr.arpa."?

In the MacHTTP log file, when an IP address cannot be mapped to a domain name, it will be identified by the IP address string (reversed) followed by ".in-addr.arpa.". IE. if 192.0.1.2 does not have a domain name, it will map to "2.1.0.192.in-addr.arpa."

This does not indicate any problems with the accessing site or with MacHTTP. It just means that the IP address hasn't been mapped (reverse DNS tables) to a domain name.


See Also


[Contents]
[Index]
[Feedback]
[Previous]
[Next]


Copyright ©1994-1998 Grant Neufeld.
Mac WWW FAQ, Nisto and nisto.com are trademarks of Grant Neufeld.