How to get extract individual IP addresses from an IP range?

Disclaimer: Most IP operation does not involve expanding the IP address ranges to their individual IP address. You do not need de-aggregate the IP ranges to query them. To query IP address data your default choice should be our MMDB database and the MMDBctl tool.

IPinfo CLI’s prips command can de-aggregate/explode IP to their individual IP addresses.

Usage

prips command

prips Documentation:

Usage: ipinfo prips [<opts>] <ip | ip-range | cidr | file>

Description:
  Accepts CIDRs (e.g. 8.8.8.0/24) and IP ranges (e.g. 8.8.8.0-8.8.8.255).

Examples:
  # List all IPs in a CIDR.
  $ ipinfo prips 8.8.8.0/24

  # List all IPs in multiple CIDRs.
  $ ipinfo prips 8.8.8.0/24 8.8.2.0/24 8.8.1.0/24

  # List all IPs in an IP range.
  $ ipinfo prips 8.8.8.0-8.8.8.255

  # List all IPs in multiple CIDRs and IP ranges.
  $ ipinfo prips 1.1.1.0/30 8.8.8.0-8.8.8.255 2.2.2.0/30 7.7.7.0,7.7.7.10

  # List all IPs from stdin input (newline-separated).
  $ echo '1.1.1.0/30\n8.8.8.0-8.8.8.255\n7.7.7.0,7.7.7.10' | ipinfo prips

Options:
  --help, -h
    show help.