on my MacbookPro 15'' Retina, with OSX 10.9.4, I want to be able to: route all single ip traffic to localhost.
My Goal is this:
I type http://192.168.1.54/test.html in the browser and I get what I normally get from http://localhost/test.html
This is what I tried (en4 is the one I get internet connection from):
______$ sudo route add 192.168.1.54 localhost -ifp en4
checking the list
______$ sudo route add 192.168.1.54 localhost -ifp en4
add host 192.168.1.54: gateway localhost
______$ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 42 4 en4
127 127.0.0.1 UCS 0 3 lo0
127.0.0.1 127.0.0.1 UH 50 15380 lo0
...
192.168.1.54 127.0.0.1 UGHS 0 0 en4
...
But the ping of 192.168.1.54 isn't working
I tried also the loopback interface with
______$ sudo route add 192.168.1.54 localhost -ifp lo0
getting the same result: nothing.
I'm kind of a newbie in this stuff, so any help will be great
Fire up your Terminal and type the following:
sudo ifconfig lo0 alias 192.168.66.66
After entering your password, that will redirect requests for 192.168.66.66 to the localhost/loopback adapter.
And if you need to remove this redirect, try
sudo ifconfig lo0 -alias 192.168.66.66
Source: http://www.vincecutting.co.uk/web-development/redirect-ip-address-back-to-localhost-on-mac-osx/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With