2

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?

0

1 Answer 1

5

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

Not the answer you're looking for? Browse other questions tagged .