Did you know that IPv4 addresses can be written in shorter representations, like IPv6 addresses?
Everyone have seen form of IPv6 represented as “shorter form”:
Example from IPv6:
- 2001::7334
- ::1
- ::
You can use our free tool ipv6-literal.com to convert these addresses to long form. The result is:
- 2001:0000:0000:0000:0000:0000:0000:7334
- 0000:0000:0000:0000:0000:0000:0000:0001
- 0000:0000:0000:0000:0000:0000:0000:0000
What admins / programmers usually do not know, is that the same principle applies to IPv4 addresses:
- 127.1
- 1
- 192.168.257
- 192.168.65535
- 192.168.65535
- 192.168
- 10.1
To test these, use built in ping command. I used ping in Windows 7 and Ubuntu 10, and the result addresses are:
- 127.1 -> 127.0.0.1
- 1 -> 0.0.0.1
- 192.168.257 -> 192.168.1.1
- 192.168.65535 -> 192.168.255.255
- 192.168 -> 192.0.0.168
- 10.1 -> 10.0.0.1
As a bonus, you can try to ping other IP address representations:
- ping 0x7F000001 – hex
- ping 010 – octal, does not work in Ubuntu
- ping 2130706433 – decimal
Why it works this way? Because network funcions built into OS support a such behavior, for example:
- Windows API function RtlIpv4StringToAddress
- Linux function inet_aton()
Have a fun, and remember, that year of IPv6 is near.