Why can I ping 127.257, 127.1 etc?

Not only IPv6 allows consecutive zeros to be omitted.

Operating systems allow to skip octets when using dot-decimal notation.
It’s a relic from the old days of classful addressing. 127.1 means network 127, host 1.

Note that this isn’t limited to the ping command.
It will accept decimal values too:

Upon finding that dot, it makes sure that you didn’t give it a value beyond 255 since that particular trick is only allowed for the last position, and a dot means more stuff is coming up. Per the comments:
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
Try to ping some of these and watch the differences:×09
P.S. And, yes, 127.257 is legal, because network 127 can have more than 256 hosts.

Җавап калдыру

All fields are required. Your email address will not be published.