-2

Today I mistyped the IP address of ping command by ignoring dot between zeros, like this:

ping 127.001

However, the command works, it outputs:

PING 127.001 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.095 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.093 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.066 ms

I'm confused and then try something like:

ssh [email protected]

to replace

ssh [email protected]

It works! And it even works in firefox browser:

http://192.168.01

But why? Is there any special case for addresses like these? What's the specification of this kind of "abbreviation" in ipv4? I can't find anything related to this by googling "ipv4 abbreviation", "ip abbreviation", "ipv4 address rule", etc.

2

1 Answer 1

0

Your question is well described in Wikipedia (https://en.wikipedia.org/wiki/IPv4):

Other address representations were in common use when classful networking was practiced. For example, the loopback address 127.0.0.1 was commonly written as 127.1, given that it belongs to a class-A network with eight bits for the network mask and 24 bits for the host number. When fewer than four numbers were specified in the address in dotted notation, the last value was treated as an integer of as many bytes as are required to fill out the address to four octets. Thus, the address 127.65530 is equivalent to 127.0.255.250.

1
  • 2
    Network address classes are dead (please let them rest in peace), killed in 1993 (two years before the commercial Internet in 1995) by RFCs 1517, 1518, and 1519, which defined CIDR (Classless Inter-Domain Routing). We have not had network address classes in this century.
    – Ron Maupin
    Commented May 22 at 12:57

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