A command-line tool for IP address operations and CIDR range manipulations.
- Go 1.24.3 or higher
go install github.com/db757/iptools@latestnix profile install github:db757/iptoolsmake buildThe binary will be created in the dist directory.
make nix-build
make nix-installThe binary will be created in the result/bin directory.
ipt inrange [ip] [ranges]ipt cidrange [cidr]ipt next [ip]ipt prev [ip]ipt getn [cidr] [count] [--offset|-o offset] [--tail|-t]Options:
--offset, -o: Number of IPs to skip before starting to return results--tail, -t: Count backwards from the end of the range--short, -s: Short output format (global flag)
make build: Build the project (includes tidy, clean, fmt, vet, test, nix-update)make test: Run testsmake fmt: Format codemake vet: Run go vetmake lint: Run lintermake clean: Clean build artifactsmake targets: Build for multiple platformsmake govulncheck: Run vulnerability checksmake upgrade: Upgrade dependenciesmake run: Run the application (includes vet)
make nix-build: Build using Nixmake nix-install: Install to Nix profilemake nix-update: Update gomod2nix.tomlmake nix-shell: Enter Nix development shell
- github.com/urfave/cli/v3: CLI framework
- go4.org/netipx: IP address manipulation
- github.com/stretchr/testify: Testing framework