Skip to content

[Feature Request] merge CIDR ranges #108

@hellodword

Description

@hellodword
$ cidr merge "10.0.0.0/8" --exclude "192.168.2.0/24, 10.4.0.0/16"  --exclude "10.6.0.0/16"   "192.168.0.0/16"
10.0.0.0/14
10.5.0.0/16
10.7.0.0/16
10.8.0.0/13
10.16.0.0/12
10.32.0.0/11
10.64.0.0/10
10.128.0.0/9
192.168.0.0/23
192.168.3.0/24
192.168.4.0/22
192.168.8.0/21
192.168.16.0/20
192.168.32.0/19
192.168.64.0/18
192.168.128.0/17

# or merging only
$ cidr merge "192.168.1.0/31" "192.168.1.2/32" "192.168.1.3/32"
192.168.1.0/30

It should be useful while people are configuring their firewall rules.

For example, AllowedIPs for wireguard1.

What do you think?

Footnotes

  1. https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageWaiting for first response or review from a maintainer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions