News for hackers. Stuff that matters.
Re:Ask HN: Got a /22, cool things to do with it? by brianzelip on Friday January 12, 2024 @09:05AM (#38968047)
What are /22 and ASN?
Re:Ask HN: Got a /22, cool things to do with it? by poxrud on Friday January 12, 2024 @09:16AM (#38968174)
It’s a way to represent a range of IP addresses. Using CIDR notation. https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

OP is saying that they have control of 1022 public IP addresses.

Re:Ask HN: Got a /22, cool things to do with it? by paxys on Friday January 12, 2024 @10:37AM (#38969293)
Normally when you buy a static IPv4 address you get a single "1.2.3.4". OP is basically saying they have access to something like "1.2.[0-3].[0-255]". /22 is a fancy way of describing that kind of slice in CIDR notation. So they have 256*4=1024 IP addresses in total.
Re:Ask HN: Got a /22, cool things to do with it? by diggan on Friday January 12, 2024 @10:53AM (#38969535)
> Normally when you buy a static IPv4 address you get a single "1.2.3.4"

Is it common to purchase (to own, not "rent" as what you get from cloud platforms) single IP addresses? I thought they were always bought/sold in blocks.

Re:Ask HN: Got a /22, cool things to do with it? by paxys on Friday January 12, 2024 @10:59AM (#38969621)
I should have said lease instead of buy, yes.
Re:Ask HN: Got a /22, cool things to do with it? by kdklol on Friday January 12, 2024 @02:34PM (#38972818)
No, in general, the smallest block of IPv6 addresses you can "own" is /24. You have to pay yearly fees to your RIR (Regional Internet Registry) as an ANS (Autonomous system). Think of it as owning land and paying a land tax.
Re:Ask HN: Got a /22, cool things to do with it? by icedchai on Friday January 12, 2024 @06:27PM (#38975577)
I have a /24 registered in the early 90's. I pay no registration fees for it since it's a legacy block.
Re:Ask HN: Got a /22, cool things to do with it? by iFreilicht on Friday January 12, 2024 @10:46AM (#38969423)
I think it's 1022, as the first and last one in the block are the gateway and broadcast address, right?
Re:Ask HN: Got a /22, cool things to do with it? by paxys on Friday January 12, 2024 @10:50AM (#38969490)
That's the recommendation, yes, but even then all 1024 are in your control and you can do whatever you want with them.
Re:Ask HN: Got a /22, cool things to do with it? by marginalia_nu on Friday January 12, 2024 @09:08AM (#38968085)
IP Subnet with IIRC 1024 IPs, and Autonomous System Number respectively.

ASN:s are related to BGP, the Border Gateway Protocol, which is part of how the IP network is organized.

Re:Ask HN: Got a /22, cool things to do with it? by tgv on Friday January 12, 2024 @09:13AM (#38968140)
To explain a bit more: the first 22 bits (of the 32 bit IPv4 address) are fixed, so there are 10 free bits = 1024 addresses.
Re:Ask HN: Got a /22, cool things to do with it? by geocrasher on Friday January 12, 2024 @11:12AM (#38969796)
This is a fantastic, simple explanation of subnetting and CIDR notation. Well done.
Re:Ask HN: Got a /22, cool things to do with it? by the_third_wave on Friday January 12, 2024 @09:50AM (#38968641)
.22s are light calibre weapons good for plinking and vermin...

Oh, not that kind of .22. An IPv4 /22 is a network segment where the /22 stands for the number of bits used for the network address. Since an IPv4 address is 32 bits wide this leaves 10 bits which can be freely assigned by the address 'owner'. Those 10 bits (1024 addresses) can be used for individual hosts or the range can be further subdivided into smaller networks, e.g. 4 /24 networks.

This type of network address is called a Classless Inter Domain Routing (CIDR [1]) address, this in opposition to 'class A/B/C' addresses which identify networks in 8-bit steps. A class A network is a /8, class B a /16 and class C a /24.

[1] https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Re:Ask HN: Got a /22, cool things to do with it? by thsksbd on Friday January 12, 2024 @10:51AM (#38969496)
I thought he meant .22 for a moment but asked myself: "of all the places to ask what to do with a case of ammo, why all HN?".

Then I realized it was probably some neteorking stuff

Re:Ask HN: Got a /22, cool things to do with it? by thedynamicduo on Friday January 12, 2024 @09:54AM (#38968677)
Thanks, that was a really good explanation.