[X-Unix] Altering system parameters (e.g. IP addresses) on MacOSXserver

Ken Rossman rossman at columbia.edu
Sun Mar 9 16:25:35 PDT 2008


Eric,

> 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.

Ah, yes, I recall that command now, though I never used it much in  
the past.

> To permanently change the static IP address of a given system, run the
> following command:
>
> # networksetup -listallnetworkservices

OK, got it...

> This command will list all your network ports.  Why you have to  
> call them by
> their name escapes me, but whatver.

Just Apple's way of doing things, I guess.

> 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=

OK, thanks, the rest I can figure out, I think...  just needed the  
right command
incantation.  The numbers I can work out for myself...

> Note, you've gotta be root (or sudo it).

Yup.

> This **WILL** persist through reboots.

Thanks a bunch!!!  I appreciate your help!

K



More information about the X-Unix mailing list