Skip to content

Instantly share code, notes, and snippets.

@sergepetit
Created October 25, 2013 12:39
Show Gist options
  • Save sergepetit/7154039 to your computer and use it in GitHub Desktop.
Save sergepetit/7154039 to your computer and use it in GitHub Desktop.
It is sometimes convenient to have several distinct ip addresses pointing to your loopback. By default in OSX, you only have 127.0.0.1 in ip v4. You can add aliases with ifconfig.
#!/bin/bash
#use -alias do remove an entry
ifconfig lo0 alias 127.0.1.1
ifconfig lo0 alias 127.0.1.2
ifconfig lo0 alias 127.0.1.3
ifconfig lo0 alias 127.0.1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment