Setting an IP Alias on OS X Leopard

Posted by rue, Sun Mar 09 11:43:00 UTC 2008

If you need to add a secondary IP or an IP alias to a network interface on Mac, you are in the same situation I was just a moment ago. In the interest of posterity, I am documenting my exploration of Macistan when I encounter something that seems interesting or divergent.

Note that if you are setting up something using a second network interface, this does not apply. You can just set it up normally. My network is rather strange: I have it set up so that the normal operation is through an “intranet” LAN connecting through a router/DNS and firewall but there is also the option of connecting directly using ISP DHCP—still passing through the firewall of course. Because I want to have the internal IP available regardless of external mode, it is set as an alias on each interface for the latter times.

All respectable people would of course first want to just use `ifconfig` to accomplish aliasing but since on a Mac it is more of a wrapper, this task is best done through System Preferences’ Networking pane.

  1. Unlock and authenticate. (You never leave those little locks open, do you?)
  2. Select the current connection you want the alias for
  3. Click the cogwheel and Duplicate Service
  4. Give it a sensible name such as “Intranet IP ()”
  5. Set Configure to Manual
  6. Input the proper values for your setup (only the IP and Subnet Mask are really necessary)
  7. Lock the pane

Filed Under: mac | Tags:

Comments

Have your say

A name is required. You may use HTML in your comments.