Tech 16 Dec 2004 03:42 pm

Rant of the day - changing IP address

Many years ago, I remember that everyone used to complain that, in order to change the IP address of a Windows NT server, you had to reboot the server. It is, I agree, stupid, as this is the kind of thing you can acomplish in a Linux server with a couple of ifconfigs and the occasional restart of the odd daemon that does not handle the change well. But this has been fixed, and it’s now very quick and easy to change the IP address of any computer running any Microsoft OS relased after 2000.

So, when I had to change the IP address of a Mac server in late 2004 (earlier this week, to be more precise), I did not expect it to be very hard. After all, Macs are easy to use, right? Well, almost. It turns out that, if you run OS X 10.2.x and the “Permanent IP address” option was selected during the server setup, you’re out of luck: when it says “permanent”, it means it. The only “official” way of changing the IP address is by reinstalling the server (note that I am talking about a Mac OS X server, not a regular desktop machine). Yes, reinstalling, not rebooting.

As Donald Trump would say, very disappointing. Very, very disappointing. And I couldn’t simply fire the server, unfortunately. So I decided to ignore what Apple said and try anyway. It almost worked: the server kept trying to talk to itself on its old address, and a few minutes after rebooting it deteriorated so much that you couldn’t start new applications any more. And “ls -l” didn’t work at all (”ls” without the “-l” did work).

Since there was nothing visible in the server configuration pointing to the old address, I did a large “grep” and found a binary file under /private/var/db with a mention to it. I bravely used vi to edit the file, changed the address, rebooted… and it worked!

After all of this, we found out that Apple makes available a script to change the IP address of a Mac server. It’s a shell script that asks you for all the information (including the old IP address and netmask, which it should be able to get from the server configuration) and does everything. It seems to work very well, so, if you need to do it, I recommend this process instead of the massive grep. But the manual way is more satisfying.

One Response to “Rant of the day - changing IP address”

  1. on 07 Feb 2005 at 9:12 am 1.xxx_basketballa_xxx said …

    Can Somebody please tell me how do i change my ip address if im on dsl

Subscribe to the comments through RSS Feed

Leave a Reply