by crote · 2y ago · 0 comments
OpenSSH already seems to take that into account by allowing you to penalize not just a single IP, but also an entire subnet. Enable that to penalize an entire /64 for IPv6, and you're in pretty much the same scenario as "single IPv4 address".
I think there's some limited value in it. It could be a neat alternative to allowlisting your own IP which doesn't completely block you from accessing it from other locations. Block larger subnets at once if you don't care about access from residential connections, and it would act as a very basic filter to make annoying attacks stop. Not providing any real security, but at least you're not spending any CPU cycles on them.
On the other hand, I can definitely see CGNAT resulting in accidental or intentional lockouts for the real owner. Enabling it by default on all installations probably isn't the best choice.
People should write 80/48 or 48/80 to be clear
If you have a /48 then 48 bits are used to determine the address is yours. Any address which matches in the first 48 bits is yours. If you have a /64, any address which matches in the first 64 bits is yours.
$ sipcalc ::/48
-[ipv6 : ::/48] - 0
[IPV6 INFO]
Expanded Address - 0000:0000:0000:0000:0000:0000:0000:0000
Compressed address - ::
Subnet prefix (masked) - 0:0:0:0:0:0:0:0/48
Address ID (masked) - 0:0:0:0:0:0:0:0/48
Prefix address - ffff:ffff:ffff:0:0:0:0:0
Prefix length - 48
Address type - Reserved
Comment - Unspecified
Network range - 0000:0000:0000:0000:0000:0000:0000:0000 -
0000:0000:0000:ffff:ffff:ffff:ffff:ffff
I remember how this works because of the IPv4 examples that I have baked into my head, e.g. 10.0.0.0/8 or 192.168.1.0/24. Clearly the first 24 bits must be 1 for that last one to make any sense.I recently found a case where an "inverted" netmask makes sense - when you want to allow access through a firewall to a given IPv6 host (with auto-config address) regardless of the network that your provider has assigned.
> People should write 80/48 or 48/80 to be clear
The clarity is found implied in your preferred example.
- "80/" would mean "80 bits before"
- "/48" would mean "48 bits after"
99/100 it means the first bits.