0.0.3 • Published 8 years ago

netrange v0.0.3

Weekly downloads
2
License
AGPLv3
Repository
github
Last release
8 years ago

netrange

get an accurate range of ips using a hex algorithm. useful for IPv4-based neighbor discovery on a subnet or for other range sniffing activities.

install

$ npm i netrange

use

require('netrange')('1.1.255.254','1.2.0.1') // ['1.1.255.254', '1.1.255.255', '1.2.0.0', '1.2.0.1']

subnet slash

In slash notation, a single number indicates how many bits of the IP address identify the network the host is on. A netmask of 255.255.255.0 has a netmask of 8 + 8 + 8 = 24. For example, writing 192.168.42.23/24 is the same as specifying an IP address of 192.168.42.23 with a corresponding netmask of 255.255.255.0. Often you have to enter the netmask as slash notation, an easy task with the usual 255.255.255.0. However if your network doesn't have 255 hosts, for example only 8 hosts, then the netmask will be 255.255.255.248.

The following table lists the variable length subnets from 1 to 32, the CIDR 3 representation form (/xx) and the Decmial equivalents. (M = Million, K=Thousand, A,B,C= traditional class values)

mask value: HexCIDRDecimal# of addressesClassfull
80.00.00.00/1128.0.0.02048 M128 A
C0.00.00.00/2192.0.0.01024 M64 A
E0.00.00.00/3224.0.0.0512 M32 A
F0.00.00.00/4240.0.0.0256 M16 A
F8.00.00.00/5248.0.0.0128 M8 A
FC.00.00.00/6252.0.0.064 M4 A
FE.00.00.00/7254.0.0.032 M2 A
FF.00.00.00/8255.0.0.016 M1 A
FF.80.00.00/9255.128.0.08 M128 B
FF.C0.00.00/10255.192.0.04 M64 B
FF.E0.00.00/11255.224.0.02 M32 B
FF.F0.00.00/12255.240.0.01024 K16 B
FF.F8.00.00/13255.248.0.0512 K8 B
FF.FC.00.00/14255.252.0.0256 K4 B
FF.FE.00.00/15255.254.0.0128 K2 B
FF.FF.00.00/16255.255.0.064 K1 B
FF.FF.80.00/17255.255.128.032 K128 C
FF.FF.C0.00/18255.255.192.016 K64 C
FF.FF.E0.00/19255.255.224.08 K32 C
FF.FF.F0.00/20255.255.240.04 K16 C
FF.FF.F8.00/21255.255.248.02 K8 C
FF.FF.FC.00/22255.255.252.01 K4 C
FF.FF.FE.00/23255.255.254.05122 C
FF.FF.FF.00/24255.255.255.02561 C
FF.FF.FF.80/25255.255.255.1281281/2 C
FF.FF.FF.C0/26255.255.255.192641/4 C
FF.FF.FF.E0/27255.255.255.224321/8 C
FF.FF.FF.F0/28255.255.255.240161/16 C
FF.FF.FF.F8/29255.255.255.24881/32 C
FF.FF.FF.FC/30255.255.255.25241/64 C
FF.FF.FF.FE/31255.255.255.25421/128 C
FF.FF.FF.FF/32255.255.255.255This is a single host route
0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago