Table of Contents
Note: You need node.js installed on your PC.
npm install netcalc-cli -g
In your commandline enter the one of the following options:
- When commiting strings use double quotes.
- >_ before the code shall symbolise your commandline input. Don't actually type these.
- // are comments don't type these either.
>_ netcalc // shows usage and options
>_ netcalc -h // shows usage and options
>_ netcalc --help // shows usage and options
>_ netcalc - V // show version of netcalc-cli
// Converts IPv4 to binary representation
>_ netcalc "192.168.150.1" -2
>_ netcalc "192.168.150.1" --ip-to-binary
// result ---> [ '11000000', '10101000', '10010110', '1' ]
// Calculate min (network) and max (broadcast) by IPv4 and CIDR
>_ netcalc "192.168.150.1" 24 -r
>_ netcalc "192.168.150.1" 24 --range
// result ---> ['192.168.150.0', '192.168.150.255']
// Calculates all IPv4s between and including the provided min and max addresses.
>_ netcalc "192.168.150.1" "192.168.150.254" -i
>_ netcalc "192.168.150.1" "192.168.150.254" --inner-range
// result ---> ['192.168.150.0', '192.168.150.1', '192.168.150.2', ..., '192.168.150.254', '192.168.150.255']
// Converts CIDR to netmask
>_ netcalc 24 -c
>_ netcalc 24 --cidr-to-netmask
// result---> [255, 255, 255, 0]