Why I cannot ping local IPs on my Mac?

2

1

I'm trying to ping local IPs on my Mac but it's not working as I would expect.

If I ping 127.0.0.1, there's no problem:

PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.056 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.083 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.089 ms

However if I ping any other local IPs, it doesn't work:

PING 127.0.0.99 (127.0.0.99): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3

If I try the same thing on Windows, it's working. Does anybody know why it is not working on Mac OS X?

laurent

Posted 2013-08-06T15:16:06.927

Reputation: 5 258

Question was closed 2013-08-08T12:52:27.837

Answers

4

There's a solution - you have to create an alias to be able to ping it.

sudo ifconfig lo0 alias 127.0.0.99 up

As for why it's not working, seems that Apple decided to implement just a 127.0.0.1, not a 127.0.0.0/8 subnet.

See also How do you get loopback addresses other than 127.0.0.1 to work on OS X

Igor Hatarist

Posted 2013-08-06T15:16:06.927

Reputation: 1 864