Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Remotely change static IP via the command line' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remotely change static IP via the command line
Authored by: dreness on Jan 23, '05 03:21:34AM
Here's how it breaks down:
  • ipconfig is not related to the Windows utility, it just happens to have the same name. ipconfig in OS X is a semi-undocumented tool provided with both client and server. It changes interface configurations using the System Configuration framework, which means that configd is involved and any changes are persistant. Experiment with ipconfig set en0 MANUAL or ipconfig set en0 DHCP for example. It is perfectly okay to use ipconfig in os x or os x server (though with server don't forget about changeip also)
  • ifconfig exists in os x and behaves as it would on other platforms. However, changes made via ifconfig do not go through configd. Not only are changes made via ifconfig not persistant, but they may be overwritten by configd any time it detects a network change. Therefore, it is not advisable to use ifconfig in OS X for anything other than displaying network interface settings.

  • [ Reply to This | # ]
Remotely change static IP via the command line
Authored by: kholburn on Jan 23, '05 08:25:49PM

$ man ipconfig
No manual entry for ipconfig
$ ipconfig --help
usage: ipconfig <command> <args>
where <command> is one of waitall, getifaddr, ifcount, getoption, getpacket, set
$ ipconfig set --help
usage: set  <interface name> < BOOTP | MANUAL | DHCP | INFORM | NONE > <method args>
$ ipconfig set en0 MANUAL --help
usage: ipconfig set en0 MANUAL <ip> <mask>

[ Reply to This | # ]
Remotely change static IP via the command line
Authored by: jzhao on Jan 25, '05 02:21:06PM

I ran into a similar situation as the original poster.

I need to assign static IP address with shell script. I tried ipconfig. It only works half way. The change was propagated by configd. I can see that in system.log. But it didn't get kept. The file /Library/Preferences/SystemConfiguration/preferences.plist was not modified. The old setting came back on reboot.

What I did is: sudo ipconfig set en0 MANUAL

What else do I need? hanks in advance.

[ Reply to This | # ]