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/, 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?

  • Can you change the network settings of the client/server at all? If, for example, you could change it to use a full domain name instead of an IP, you could put an entry in /etc/hosts that redirects all traffic to your.domain.name to
    – Asmus
    Oct 30, 2015 at 8:50
  • I can understand that the question is a bit unclear on this point. I will rephrase. It is possible to reconfigure network settings in Yosemite as I have administrator-access. The problem is that the client and server software will still need to use the static IP-address. I think editing /etc/hosts may be a solution. I will check how I can do that. Oct 30, 2015 at 8:59
  • 1
    DHCP with fixed address in Network CP?
    – Tetsujin
    Oct 30, 2015 at 9:29
  • If reconfiguring the IP address to a FQDN is not possible, you'd best be using pfctl to redirect traffic coming from localhost to your static IP back to localhost (it would possibly be best also specifying which port).
    – Asmus
    Oct 30, 2015 at 16:59
  • Serverfault had a good answer to the question that uses ifconfig: http://serverfault.com/questions/402744/assigning-multiple-ip-addresses-to-localhost-os-x-10-6 I answered the question below. Nov 5, 2015 at 21:14

1 Answer 1

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

You must log in to answer this question.

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