Setting up a multihoming ethernet network

Sep 19, '02 08:34:09AM

Contributed by: bluehz

Not sure if this has been reported before....

In OS X it is possible to assign more than one IP address to a single ethernet card. You might use this for instance if you wanted to use one IP as an external (public) IP and another as an internal-only secure IP for admin or whatever your needs are.

I was trying to do this via the Terminal in the same way it is done in other Unix variants. That method is:

 % ifconfig eth0:2 192.168.1.132 up
However, it's even easier in OS X. I cannot take credit for discovering this though - it is listed in an article at AFP548.

Let's say you currently have your machine IP set to 192.168.1.100 and you want to add a virtual IP address of 192.168.1.101 so both IP's point to your machine.

  1. Open Network Preferences pane.
  2. Selct "Active Network Ports" from the "Show" pull-down menu. Highlight your ethernet interface and hit the duplicate button.
  3. Configure the NEW ethernet interface with IP 192.168.1.101 and the other items as desired. The article at AFP548 states you should use netmask 255.255.255.255 or you will run into trouble. I ignored that and used my standard 255.255.255.0 and other items the same as my original IP.
Now point your web browser to 192.168.1.101 and it should access your machine via the new interface. Modify your Apahce prefs a bit with virtual servers (search "virtual server" here at macosxhints) and you can point everything going to your new interface at 192.168.1.101 to go wherever you want.

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020919053409391