Networking Configuration for Mac OS X/Darwin

Justin C Walker

Free Agent
Fat City


    

Rob Braun

Apple Computer, Inc


    

Revision History
Revision 125 January 2002
Published.

Abstract

This HowTo provides information for dealing with the configuration of networking on Mac OS X and on Darwin, the Operating System for Mac OS X. We discuss both systems in this HowTo since they are so closely related for this set of topics.

Mac OS X is configured for networking using the Network Preferences panel in the System Preferences app. This application gives the user a fairly clean and simple interface to control, modify, and verify the state of his configurations.

Darwin is a BSD derivative, so it can be configured through the standard BSD mechanisms, such as ifconfig and route. However, Darwin uses some configuration files that differ from other BSD systems.

First, we'll present the basic scheme used for configuring networking in each system, including some netinfo details that affect networking. With the basics settled, we'll show how to configure alias addresses, multihoming, and PPPoE.

Comments, as well as additional tips, can be sent to the authors, at the above addresses.


Table of Contents

Network configuration in Mac OS X
Network configuration in Darwin
iftab
iftab in Darwin 5.2
hostconfig
NetInfo
Making it Stick
Setting up Alias Addresses
Aliases in Mac OS X and Darwin (10.1.1 and earlier)
Aliases in Mac OS X (10.1.2 and beyond)
Aliases in Darwin
Configuring and running PPPoE
PPPoE on Mac OS X
PPPoE on Darwin
Multihoming
Default Routes
URLs
Copyright

Network configuration in Mac OS X

Configuring your network in Mac OS X involves the use of the Network Preferences panel (NPP) in the System Preferences app. As mentioned above, because this is a BSD-derived system, you actually can effect the running configuration of the system using command-line tools. There use, however, is only effective between reboots. Once you reboot, any changes you make with these commands will be lost, unless you either duplicate them with the control panel, or change startup scripts to include these commands. One advantage of this, for the adventurous, or the developer, is that you can hand-craft an environment that you need, either for experimentation, or to achieve your development goals.

The NPP has several components:

  • A "Location" pop-up menu
  • A "Show" pop-up menu
  • An array of configuration tabs specific to a chosen device
  • A 'lock' icon
  • An "apply now" button

Use of the latter two is clear. The "Locations" menu lets you chose among previously defined location configurations, and lets you create new ones or edit existing ones. The system comes with one ("Automatic") already defined. It includes all the network devices detected on the system, and configures each to use DHCP.

The "Show" menu lets you select indivual active devices, and the tab array shown below it will depend on the selection in this menu. The tabs are specific to the device. For example, generic ethernet differs from Airport in the available tabs. In addition, you can select "Active Network Ports" here, and the tab array changes to a list of interfaces known to the system.

The list of active ports is an ordered list of interfaces, with checkboxes to show which are active. The order of active devices is important, for purposes of determining the default route in a system where interfaces can come and go (or go off-line). See the multihoming discussion for further details on this aspect of network configuration.

If you chose the "Active Network Ports" item from the Show menu, you are presented with a scrolling list of existing port configurations. You can select one, and then either duplicate, rename, or delete it. Of the choices, "Duplicate" may be the most confusing. What happens when I do that? If I chose the built-in ethernet, does that mean I end up with two built-in ethernet devices? Sadly, no. There are certain laws of physics that prevail.

The duplication operation gives you a copy of the configuration record pertaining to that device. This turns out to be useful in two areas: aliases and PPPoE. These are discussed below, but I'll go into the operation of duplication here.

Select the interface/config that you want to use. Then, click Duplicate. This will produce an alert with a pre-selected name. You can change this to something that floats your boat, and click OK. This gives you an additional entry in your list of port configurations presented by the "Show" menu. Any configuration information applied to this duplicated device actually affects the original device, but with this "visual" separation, the system can more easily keep track of the configuration choices.

For alias configuration, you deal with the "TCP/IP" tab for the duplicated device. For PPPoE, you use the PPPoE tab, and you do not modify the "TCP/IP" tab.