# How to set static ip-address in terminal



## mozimuyu (Oct 13, 2009)

hi,
i am a newer ,i want to know how to set static ip-address in mac os x leopard 
thx


----------



## ElDiabloConCaca (Oct 13, 2009)

From the GUI, you can set it using the "Network" pane of the System Preferences.

From the command-line, you can control this with the "ifconfig" program.  There is a ton of information on it if you perform a simple Google search for "Mac OS X ifconfig".


----------



## mozimuyu (Oct 13, 2009)

ElDiabloConCaca said:


> From the GUI, you can set it using the "Network" pane of the System Preferences.
> 
> From the command-line, you can control this with the "ifconfig" program.  There is a ton of information on it if you perform a simple Google search for "Mac OS X ifconfig".


i know how to set DHCP ,just execute :ipconfig set en0 DHCP
and i have executed :man ipconfig 
i find the info :ipconfig set interface-name (MANUAL | INFORM) ip-address subnet-mask
so how to set Router and DNS ?


----------



## ElDiabloConCaca (Oct 13, 2009)

Looks like "scutil" may do that:

http://www.macosxhints.com/article.php?story=20050621051643993


----------



## mozimuyu (Oct 13, 2009)

ElDiabloConCaca said:


> Looks like "scutil" may do that:
> 
> http://www.macosxhints.com/article.php?story=20050621051643993



thx very much


----------

