https://github.com/iiiceoo/overlap
overlap check if multiple IP ranges overlap.
https://github.com/iiiceoo/overlap
iprange ipv4 ipv6 networking overlap
Last synced: 10 months ago
JSON representation
overlap check if multiple IP ranges overlap.
- Host: GitHub
- URL: https://github.com/iiiceoo/overlap
- Owner: iiiceoo
- License: mit
- Created: 2023-08-11T09:02:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-11T09:42:44.000Z (over 2 years ago)
- Last Synced: 2025-01-23T23:59:26.408Z (12 months ago)
- Topics: iprange, ipv4, ipv6, networking, overlap
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# overlap
*overlap check if multiple IP ranges overlap.*
## Supported IP range formats
- `172.18.0.1` / `fd00::1`
- `172.18.0.0/24` / `fd00::/64`
- `172.18.0.1-10` / `fd00::1-a`
- `172.18.0.1-172.18.1.10` / `fd00::1-fd00::1:a`
## Install
```shell
go install github.com/iiiceoo/overlap
```
## Help
```shell
$ overlap
Usage: overlap [-v] [-f file] [IP ranges...]
overlap [-V]
Options:
-V Display the version of overlap.
-f string
The file path of the IP ranges list, which supports the following
formats of IP ranges:
(IPv4) (IPv6)
172.18.0.1 fd00::1
172.18.0.0/24 fd00::/64
172.18.0.1-10 fd00::1-a
172.18.0.1-172.18.1.10 fd00::1-fd00::1:a
-v Be verbose, display details of overlaping IP ranges
```
## Example
```shell
$ cat << EOF > list
172.18.40.1
172.18.40.0/24
172.18.0.1-20
EOF
$ overlap -f list
Overlaping :(
$ overlap -v -f list
Overlaping :(
Details:
172.18.40.1 and 172.18.40.0/24 overlap at [172.18.40.1]
$ overlap -v -f list 172.18.0.10-15
Overlaping :(
Details:
172.18.0.10 and 172.18.0.1-20 overlap at [172.18.0.10-172.18.0.15]
172.18.40.1 and 172.18.40.0/24 overlap at [172.18.40.1]
```
## License
Package iprange is MIT-Licensed.