[X-Unix] Altering system parameters (e.g. IP addresses) on
MacOSXserver
Eric F Crist
ecrist at secure-computing.net
Sun Mar 9 16:12:35 PDT 2008
Ok Ken, as promised:
You should have a command called networksetup. This allows you to
change all(most?) of the settings you would find in the network
preference pane. To permanently change the static IP address of a
given system, run the following command:
# networksetup -listallnetworkservices
This command will list all your network ports. Why you have to call
them by their name escapes me, but whatver.
Next, run the following command:
# networksetup -setmanual <network_service> <new_ip> <new_mask>
<default_router>
The only funk above is the network_service item. This is really just
the network adapter's name. So, to set an IP of 10.0.0.2 with a
subnet of 255.0.0.0 and a default route of 10.0.0.1 on my MacBook
Pro's ethernet address, I'd do the following:
# networksetup -setmanual Ethernet 10.0.0.2 255.0.0.0 10.0.0.1
Note, you've gotta be root (or sudo it).
This **WILL** persist through reboots.
HTH
Eric
On Mar 9, 2008, at 3:58 PM, Ken Rossman wrote:
> Eric,
>
>> Ken, if you can give me a few hours, I'll get you the complete
>> answer.
>
> Thanks... that would be useful. Awhile back, I took a class in Mac
> OS X server
> admin, and still have the books. Just not sure right now where
> those are, but
> I would think the answer is in there. I remember issuing a whole
> lot of
> (Apple-ish) long and mixed-case command line incantations to do
> various things
> with various system tables and such. Just don't recall any
> particulars.
>
> Glad to see things on Mac OS X moving a good bit more in the
> direction of being
> "Linux-ish" or generally "Unix-ish" in any case...
>
>> You lost your connection because the server IP changed. Connect
>> with the new
>> IP and you should be fine.
>
> Ah, but that was exactly what I did, and it did not work. I had my
> PowerBook
> direct-ether-connected point-to-point to the server, and was able to
> ssh in
> using the old address range. issued the ifconfig command (adding in
> specific
> broadcast and netmask fields as well as the IP address change), then
> changed
> the PowerBook interface address to be in the same subnet range as
> what I just
> changed the server to, but no luck.
>
> I know I must have just done something stupid, but I'm not spotting
> it.
>
>> I'll get you the permanent fix when I'm at a terminal and not my
>> blackberry. :)
>
> OK, I'll take you up on that! :-)
>
> Thanks,
> K
>
-----
Eric F Crist
Secure Computing Networks
More information about the X-Unix
mailing list