macOS – How to Configure MacBook for Static IP Address

macbook promacosNetwork

I have a client/server software that uses IP to communicate. It happens that both client and server is located at the same MacBook, and when I travel I disconnect it from the IP network, making it loose the static IP-address obtained by the network card from the IP network. This sets a stop for the IP connection between the client and server.

Both the client and server software is configured to use a specific IP-address and reconfiguration of this address within this software is not possible.
This makes it impossible to change the client/server IP-address configuration to localhost/127.0.0.1, as would be the most obvious solution.

Are there any other way that I can configure my MacBook (Yosemite) network configuration so that it keeps using the static IP-address even if I disconnect it from the IP network?

Best Answer

  1. Open Applications -> Utilities -> Terminal
  2. Enter the following command: sudo ifconfig lo0 alias 192.168.1.100
  3. Type root password
  4. Quit Terminal