by c7DJTLrn · 4y ago · 0 comments
$ ipcalc 2600:1ff2:4000::/40
Address: 2600:1ff2:4000:: 0010011000000000:0001111111110010:0100000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000
Netmask: 40 1111111111111111:1111111111111111:1111111100000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000
Prefix: 2600:1ff2:4000::/40 0010011000000000:0001111111110010:0100000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000:0000000000000000https://github.com/ba9f11ecc3497d9993b933fdc2bd61e5/ipcalc6
user@box:~/Documents/code/rust/ipcalc6$ cargo run 2600:1ff2:4000::/40
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/ipcalc6 '2600:1ff2:4000::/40'`
WARNING : netmask /40 is smaller than /48, this is unusual if ip of type : Global Unicast Address and Link-Local
AddressType: Unicast Global
Address: 2600:1ff2:4000:0000:0000:0000:0000:0000
NetMask: 40
Hosts/Net: 19342813113834066795298816
Address: 0010011000000000.0001111111110010.0100000000000000.0000000000000000.0000000000000000.0000000000000000.0000000000000000.0000000000000000
NetMask: 1111111111111111.1111111111111111.1111111111111111.0000000000000000.0000000000000000.0000000000000000.0000000000000000.0000000000000000
HostMin: 0010011000000000.0001111111110010.0100000000000000.0000000000000000.0000000000000000.0000000000000000.0000000000000000.0000000000000000
HostMax: 0010011000000000.0001111111110010.0100000000000000.1111111111111111.1111111111111111.1111111111111111.1111111111111111.1111111111111111
"HostMax" = Prefix followed by all f's.
"Hosts" = some ungodly large number (i.e. "small" for this is 2^64) you typically don't care about anymore.
If someone did something atypical like use a /123 (mask >64, mask not a multiple of 4) and you do actually want to see host max and host count as a result you can pass "--all-info". Otherwise a combination of the ridiculous size and hex encoding makes everything but "what is the prefix and netmask" irrelevant.