Valid IPv4 rule
-
This post did not contain any content.
-
This post did not contain any content.
Just to be pedantic, but was this a valid IPv4 address before IPv6 came out? That mechanism of collapsing a single set of repeating octets of "0" is a feature of IPv6.
So the behavior we're seeing here, does this only result because that machine also supports IPv6?
-
Just to be pedantic, but was this a valid IPv4 address before IPv6 came out? That mechanism of collapsing a single set of repeating octets of "0" is a feature of IPv6.
So the behavior we're seeing here, does this only result because that machine also supports IPv6?
No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
While many systems support these funky IPv4 address formats, not all do. It's a bit of a quirk in that intimate knowledge of IPv4 addressing has largely been lost. If you search for validating IPv4 addresses on StackOverflow, most answers will simplistically check for 4 octets between 0 and 255
The only place I've seen these IPv4 address formats be relevant in the last 10 years is in security. If you're using a block list to block specific IP addresses (which is pretty dumb to do these days), you have to account for someone sending a request with their IP address in hex, octal, or shortened formats. If you block 127.69.69.69 (yes, I know that's a loopback), and are getting a request from 2135246149, will your block list recognize it as a blocked address? Many won't, but that's something you have to engineer for from a security perspective
-
No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
While many systems support these funky IPv4 address formats, not all do. It's a bit of a quirk in that intimate knowledge of IPv4 addressing has largely been lost. If you search for validating IPv4 addresses on StackOverflow, most answers will simplistically check for 4 octets between 0 and 255
The only place I've seen these IPv4 address formats be relevant in the last 10 years is in security. If you're using a block list to block specific IP addresses (which is pretty dumb to do these days), you have to account for someone sending a request with their IP address in hex, octal, or shortened formats. If you block 127.69.69.69 (yes, I know that's a loopback), and are getting a request from 2135246149, will your block list recognize it as a blocked address? Many won't, but that's something you have to engineer for from a security perspective
There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
What do you mean by that? The example did collapse multiple zero sections for IPv4 as well (127.69), and IPv6 can also only collapse one block, namely the longest one, otherwise it'd be ambiguous as to how to pad each. Or am I misunderstanding?
-
There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
What do you mean by that? The example did collapse multiple zero sections for IPv4 as well (127.69), and IPv6 can also only collapse one block, namely the longest one, otherwise it'd be ambiguous as to how to pad each. Or am I misunderstanding?
The example did collapse multiple zero sections for IPv4 as well (127.69), and IPv6 can also only collapse one block, namely the longest one,
The IPv4 example collapsed two "blocks", ".000.000.", or rather octets, and could do so because they were next to one another, which looks to behave the same way IPv6 does. In IPv6 the largest number of all zero hextets can be removed and replaced with double colons. So multiple hextets ( .0000) can be removed in shortening as long as they are next to one another in the IP address.
-
No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
While many systems support these funky IPv4 address formats, not all do. It's a bit of a quirk in that intimate knowledge of IPv4 addressing has largely been lost. If you search for validating IPv4 addresses on StackOverflow, most answers will simplistically check for 4 octets between 0 and 255
The only place I've seen these IPv4 address formats be relevant in the last 10 years is in security. If you're using a block list to block specific IP addresses (which is pretty dumb to do these days), you have to account for someone sending a request with their IP address in hex, octal, or shortened formats. If you block 127.69.69.69 (yes, I know that's a loopback), and are getting a request from 2135246149, will your block list recognize it as a blocked address? Many won't, but that's something you have to engineer for from a security perspective
No, this has been a part of IPv4 for a very long time. The behavior is defined here. There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections
" a.b When a two-part address is supplied, the last part shall
be interpreted as a 24-bit quantity and placed in the
rightmost three bytes of the network address. This makes
the two-part address format convenient for specifying
Class A network addresses as "net.host"."You're right. I'd never seen that usage before, but its in the man page.