be careful with this. it SHOULD be the same but it is NOT!
i couldn't find an explanation for this but i can definetly tell that on windows and linux ip addresses with and without leading zeroes are NOT the same! maybe this has to do with converting from other formats like hex or binary.
from my experience with windows and linux it is not tool dependend but os dependend it seems because im running in some problem using ips like 10.08.03.100:
- note: "10.08.0.1" and 10.09.0.1 could not be found
- note: "10.010.0.1" is resolved to 10.8.0.1
linux/debian7/8: same results with tool "ping" and "snmpget"
user@test:~$ ping 10.7.0.1
PING 10.7.0.1 (10.7.0.1) 56(84) bytes of data.
^C
--- 10.7.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
user@test:~$ ping 10.07.0.1
PING 10.07.0.1 (10.7.0.1) 56(84) bytes of data.
^C
--- 10.07.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
user@test:~$ ping 10.8.0.1
PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.
^C
--- 10.8.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
user@test:~$ ping 10.08.0.1
**ping: unknown host 10.08.0.1**
user@test:~$ ping 10.9.0.1
PING 10.9.0.1 (10.9.0.1) 56(84) bytes of data.
^C
--- 10.9.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
user@test:~$ ping 10.09.0.1
ping: unknown host 10.09.0.1
user@test:~$ ping 10.10.0.1
PING 10.10.0.1 (10.10.0.1) 56(84) bytes of data.
^C
--- 10.10.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
user@test:~$ ping 10.010.0.1
PING 10.010.0.1 (10.8.0.1) 56(84) bytes of data.
^C
--- 10.010.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1001ms
windows7/8/10: same results with tool "ping" and "telnet"
(sorry, i dont have an english windows at hand, error tells that host could not be found)
C:\Users\user>ping 10.7.0.1
Ping wird ausgeführt für 10.7.0.1 mit 32 Bytes Daten:
STRG-C
^C
C:\Users\user>ping 10.07.0.1
Ping wird ausgeführt für 10.7.0.1 mit 32 Bytes Daten:
STRG-C
^C
C:\Users\user>ping 10.8.0.1
Ping wird ausgeführt für 10.8.0.1 mit 32 Bytes Daten:
STRG-C
^C
C:\Users\user>ping 10.08.0.1
Ping-Anforderung konnte Host "10.08.0.1" nicht finden. Überprüfen Sie den Namen,
C:\Users\user>ping 10.9.0.1
Ping wird ausgeführt für 10.9.0.1 mit 32 Bytes Daten:
STRG-C
^C
C:\Users\user>ping 10.09.0.1
Ping-Anforderung konnte Host "10.09.0.1" nicht finden. Überprüfen Sie den Namen,
C:\Users\user>ping 10.10.0.1
Ping wird ausgeführt für 10.10.0.1 mit 32 Bytes Daten:
STRG-C
^C
C:\Users\user>ping 10.010.0.1
Ping wird ausgeführt für 10.8.0.1 mit 32 Bytes Daten:
STRG-C
^C
16Accoerding to the answers below, 192.168.020.100 should not be the same as 192.168.20.100, but it may be the same if your system allows IPs only to be entered this way (I have seen this with copiers when the IP is entered digit by digit with up-down-arrows). - If your system has that quirk even when "normal" keyboard input is possible (i.e., you can technicall input
192.168.2.100
, but it complains), then I suggest you have a word with the vendor (How trustworthy is the security system if its input validation is so crappy?) – Hagen von Eitzen – 2014-12-28T19:24:54.8674That really is quite a bizarre validation. I'd switch security systems, as @Hagen alludes to. – Lightness Races with Monica – 2014-12-29T13:37:17.833
2This can be software specific, too. They are valid with or without the leading
0
s, but I've run into some applications not supporting an IP address that didn't have 3 digits in each octet. – ps2goat – 2014-12-29T17:51:04.3502All IP(v4) addresses are really just 32 bits represented in a nice way. If
192.168.002.100
is how your tool represents0xc0a80264
/3232236132
/192.168.2.100
, then it's the same thing. – Tim S. – 2015-01-01T04:40:44.2431Can you please accept another answer? The one you accepted is really wrong (or at least incomplete) and has 11 downvotes. – Arjan – 2017-07-15T16:13:00.040
For more fun with doing things in an absurd way, ping 67240450 and also ping 134744072 – TOOGAM – 2017-07-15T18:07:32.683