Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

According to everything I read, the entire 127.x.x.x subnet should loopback.

However, on my Mac, I can only ping

I know I've done this before (though possibly on another OS) and has come in very useful for developing multiple SSL sites locally and for tunneling remote services for access on a local IP (for example I could ssh into my MySQL server, and just port forward the standard port to the same port on my local machine but on while my local server ran at

share|improve this question

2 Answers 2

up vote 24 down vote accepted

Here is the short answer: sudo ifconfig lo0 alias 127.0.0.* up

Each alias must be added individually (sudo ifconfig lo0 alias up, sudo ifconfig lo0 alias up). It can be done manually for testing, or a subset or the complete list of the other 250 available numbers in that subnet can be made into StartupItems script that will do it automagically at boot time.

The long answer: According to RFC3330, - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an address anywhere within this block should loop back inside the host. This is ordinarily implemented using only for loopback, but no addresses within this block should ever appear on any network anywhere.

share|improve this answer
If only there was a way to make it work for 127.*.*.* – Matthew Schinckel Dec 12 '12 at 4:27
If this turns out to also work on CentOS, you sir are getting a bounty from me. – Parthian Shot Jul 18 '14 at 19:33
Actually, either way you get a bounty. Since it doesn't work for CentOS, I'll just ask and answer that question once I find out the answer. – Parthian Shot Jul 18 '14 at 19:42

For those interested, here is a little bash script that adds all the aliases for the IPs 127.0.0.*:

for ((i=2;i<256;i++))
    sudo ifconfig lo0 alias 127.0.0.$i up
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.