why unix | RBL service | netrs | please | ripcalc | linescroll



ripcalc - a tool for network addresses



ripcalc -4/--ipv4

ripcalc -6/--ipv6 ::1

ripcalc -f/--format "%a/%c\n"

ripcalc -m/--mask 28

ripcalc -c/--csv path/to/csv [-i/--field network]

ripcalc -l/--list

ripcalc -a/--available

ripcalc -s/--file [-]

ripcalc -e/--encapsulating [-s/--file name]

ripcalc -s/--file name [--inside/--outside]

ripcalc -b/--base [8, 10, 16 etc]

ripcalc -d/--divide [CIDR]

ripcalc -h/--help


ripcalc can read IPv4/IPv6 addresses from command line or standard input and output different formats or associated networks from CSV.

ripcalc can format network addresses, find matches in CSV or process a list.

ripcalc can convert input addresses that are in other number formats such as hex or octal.

Given a list of IP addresses, print only those that match the network. When s and inside are used, only addresses from -s are printed if they are that are inside of the input IP network from the command line. This can be reversed with --outside, (e.g. ripcalc -s - --inside

When -a is used, addresses read from -s will not be shown when listing -l a network, showing only available addresses.

When --reverse is used the inputs, sources or both can be treated as back-to-front.

ripcalc can return a list of subnets when a network is provided along with the divide argument and a subnet CIDR mask.


Network matches can be returned from a CSV.

$ cat nets.csv
rfc1918,,mr nobody
$ ripcalc --csv nets.csv -i range --format '%{owner}\n'

Addresses can be read via file or from stdin (-):

$ cat list
$ ripcalc --csv nets.csv -i range --format '%{range} %{owner}\n' -s list mr nobody bob cliff mr nobody


% denotes a format control character, followed by one of the following:

placeholder effect
%a IP address string
%n Network address string
%s Subnet address string
%w Wildcard address string
%b Broadcast address string

Additional characters prefixing the above placeholder can control the representation:

placeholder effect
%B Binary address string
%S Split binary at network boundary string
%l Unsigned integer string
%L Signed integer string
%x Hex address string

Other format characters:

placeholder effect
%c CIDR mask
%t Network size
%r Network reservation information (if available)
%d Matching device interface by IP
%m Matching media link interface by network
%k RBL-style format
%% %
\n Line break
\t Tab character

%xa gives the address in hex, or %Sa to return the binary address, split at the network boundary.

When using CSV fields can be matched by name when network matched:

--format '%{name}'