|02-27-2008, 04:46 AM||#1|
Join Date: Nov 2004
Change IP address via the terminal
I restarted a new 10.4 dev server from the backup partition but it was set to DHCP and now ifconfig tells me that it's on a self assigned IP, as the port it's been moved to has no DHCP. Dumb, I know.
Please - can anyone post the exact terminal commands needed to set en0 to
(example addresses follow)
I've searched a lot so if you can help, you'd be helping more idiots like me . . .
|02-27-2008, 05:50 PM||#2|
Join Date: Sep 2007
Location: San Jose, CA, USA.
I think ifconfig is the command. The man page says "Ifconfig is used to assign an address to a network interface and/or configure network interface parameters". I've never used it. Man pages looks formidable (and leads off with a typo to inspire confidence). Good Luck!
|02-21-2010, 08:30 PM||#4|
using command "networksetup"
I am running x serve 10.4.11,
I need to change the subnet, router, and ip
This server is at an elementary and runs several networked applications for students. That's all it's used for.
It sounds like "networksetup" is the command I should use to make these changes, but I would like confirmation on that.
|02-28-2010, 12:30 PM||#5|
Join Date: Feb 2010
First use the command to check this command to check the current setup
sudo networksetup -listnetworkserviceorder
You should see something like this:
An asterisk (*) denotes that a network service is disabled.
(Hardware Port: Ethernet, Device: en0)
(Hardware Port: AirPort, Device: en1)
Assuming you do, then issue this command
sudo networksetup -getinfo Ethernet (or whatever your en0 is called)
Again, for your setup, you should see:
Client ID: XXX
To change to the settings you wanted
sudo networksetup -setmanual Ethernet 10.40.21.10 255.255.255.0 10.40.21.1
If your running an Xserve or a G5 with twin Ethernet ports, by default, you'll see:
(1) Ethernet 1
(Hardware Port: Ethernet 1, Device: en0)
(2) Ethernet 2
(Hardware Port: Ethernet 2, Device: en1)
Just make sure you change the first port listed (assuming that's the one connected to your router)
Hope this helps
|03-01-2010, 11:42 AM||#6|
Join Date: Mar 2003
Location: Bay Area, CA
Actually, in OS X Server you want to use the changeip command, as it was designed specifically for this task as servers have more running under the hood than the typical OS. They need to update DNS or IP settings for many different services and this binary does it.
All other methods are not as effective and should not be used in OS X server.
sudo make me a sammich
|03-31-2010, 07:43 AM||#7|
Join Date: Feb 2009
While true that you should run changeip on the server before actually changing the ip, changeip will NOT actually change the ip on an interface. You need to do that as a separate step, and networksetup is the way to do it.
The recommend procedure is:
1) update any dns records this will affect
2) run sudo changeip (actual syntax depends on os version, check man changeip)
3) run networksetup and systemsetup to change ip and computer name (if necessary)
5) check it all looks good with sudo changeip -checkhostname
|Display Modes||Rate This Thread|