ip_match

command module
v0.0.0-...-c1b2c49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 7 Imported by: 0

README

ip_match

CircleCI Go Report Card

Filter IPs/networks by matching against a list of prefixes.

Installation

# go install github.com/x-way/ip_match@latest

Usage

# cat filter_prefixes.txt
192.168.128.0/17
2001:db8:1234::/48

# cat iplist.txt
192.168.1.2
192.168.2.3
192.168.128.0/24
192.168.128.123
192.168.160.0/20
3.4.5.6
192.168.134.20
10.10.10.1
2001:db8::1
10.10.100.0/24
10.20.20.123
2001:db8:1234:1234:1234:1234:1234:1234
2001:db8:1234::1234:1234
2001:db8:1233::1234:1234
2001:db8:1234:0:1234:1234::/64
10.20.20.127
10.20.21.0/24

# ip_match -F filter_prefixes.txt iplist.txt
2001:db8:1234:1234:1234:1234:1234:1234/128
2001:db8:1234::1234:1234/128
2001:db8:1234::/64
192.168.128.0/24
192.168.128.123/32
192.168.160.0/20
192.168.134.20/32

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL