My computer routinely receives connection from another host in the local network. However, the router changes its ip address quite frequently, and maybe netsh's equivalent, networksetup, can help?

  • This is not clear as to what you're doing nor what you want to accomplish. Please add details as to what you're looking to accomplish, what you have tried and how things are configured.
    – Allan
    Aug 13, 2018 at 12:14
  • I want to set my osx host's ip address to locally, as simple as this. What don't you understand? Also, I have no other configuration details to offer, because the mechanism is not clear yet. Aug 13, 2018 at 15:45
  • Just out of curiosity...why aren't you doing this in the GUI via System Preferences -> Network?
    – Allan
    Aug 13, 2018 at 15:57
  • I only switched to osx recently and am unfamiliar with its configuration. Aug 13, 2018 at 16:08

1 Answer 1


The command to manually set an IP address is:

networksetup -setmanual Ethernet

This assumes the following:

  • netmask is a /24 (254 hosts)
  • the router/gateway is the "common"
  • Your interface is Ethernet

You will need to adjust your settings accordingly. To get a list of network services (interfaces), you can issue the command:

networksetup -listallnetworkservices

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .