Skip to content

Instantly share code, notes, and snippets.

@yagizdemirsoy
Last active April 5, 2017 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yagizdemirsoy/97d1f388f488ed959de6b2ba8d33712c to your computer and use it in GitHub Desktop.
Save yagizdemirsoy/97d1f388f488ed959de6b2ba8d33712c to your computer and use it in GitHub Desktop.
Define alias to local ip and redirect localhost:{port} to defined ip.

Define alias to local ip and redirect localhost:{port} to defined ip.

sudo ifconfig lo0 10.0.0.1 alias

echo "rdr pass on lo0 inet proto tcp from any to 10.0.0.1 port 80 -> 127.0.0.1 port 9000" | sudo pfctl -ef -

You can now define a host name for local ip in hosts file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment