How to change the ip address?

dlucio

Registered
Hi! Does anyone knows how to change or edit the network configuration (ip, gateway, dns,..) permanently of a MacOs X system using the command line? I used 'ipconfig', 'ifconfig', 'hostname' .... but these commands only make temporary changes, so whenever I restart the system, all the changes are lost! My problem is that I have a headless system, so I can not use the GUI to make the changes. :confused:

Thanks
 
Hey. All you need to do is edit the /etc/hosts file and add this entry:

<ip address> <Hostname>

edit the rc.boot file and search for the line 'hostname localhost' or 'hostname xxx' and change it to 'hostname <machine name

You may also need to edit the inetd.conf file <-- this I am a little uncertain about. I am new to the OS X confifguration, although I know a lot about other unix operating systems.

Hope this helps you
 
Do you have a DHCP server set up to serve this box an IP? That is where I would make the change but then again my favorite boxes were always the headless diskless ones. Ah SunOS I hardly ever knew ya....

-Eric
 
Hi everybody!

Well, I was configuring a web server, that is why is not using DHCP.
Also, I believe is not good idea to try to hack directly into the flat configuration files (/etc/*) in a MacOS X system, as it seems that even MacOs is a UNIX like OS, the configuration of it works in a different way! :mad: So, most of the tricks from other OS's do not work here because of the infamous NetInfo!! :confused:
Any way, I finally found that the command I was looking for is /usr/sbin/networksetup. In fact, I realize that the administration command that every MacOS administrator should know are:

/usr/sbin/networksetup
/usr/sbin/systemsetup
/usr/sbin/softwareupdate
/usr/sbin/installer

With this commands you can achieve some of the most important administartion activities on a MacOS X server system.
BUT, I do not know why it seems that these commands only work on the 'server'edition!!! :mad:

Regards!
 
Back
Top