OS X and Multiple IP Addresses


I really need to get my OS X to respond to more than one IP address. I would like apache to respond to two different IP addresses for two virtual hosts. I have apache set up properly and it seems to be working but since the machine won't respond to more than one IP addresses, it does me no good on other machines. Has anyone tried this yet and made it work????


Machine info:
Dual Processor G4
(2) 450 Mhz Processors
256Mb RAM
30 Gb Drive
Yeah, but not on purpose.

One of the fellows here was futzing about with a 3rd party network
driver and happened to have the thing set up both in the 3rd party's
startup script and in /etc/iftab. The system happily configured the
network interface to respond to both address, and the system appeared
to be responding to both addresses on the net.

If you take a look at the man page for ifconfig, you'll see the 'alias' option.
That should allow you to set up a second address to which an interface will
Thanks. That seems to be working fine when I ad it but when I restart, everything seems to revert to the old settings. The machine will respond to the new address after I add it and apache will server up the corresponding web pages but as soon as I restart, the machine only responds to the IP address that is in it's Network control panel. Any thoughts?

You're going to have to find or make a script to execute it at boot.

The first thing I'd try is adding it to /etc/iftab; add a line at the end
something like:

en0 alias <address> netmask <netmask>

The man page for iftab is more than a little bit fuzzy.

If that doesn't work, a quick dirty hack would be to add the ifconfig
command to the end of /etc/rc. The official way to start something is
to create a directory in /System/Library/StartupItems containing a
property list and a script. The name of the script must be the same as
the name of the directory.

A quickie startup script could be made like this:

% su
# cd /System/Library/StartupItems
# mkdir alias
# cp SSH/* alias
# cd alias
# mv SSH alias
--- edit StartupParameters.plist as appropriate ---
--- edit alias so it does the ifconfig instead of ssh-keygen and sshd ---

then when you reboot, it should do the ifconfig.
Thanks a million. It seems to be working great. A quicktime streaming server and apache all on a G4. Awesome!