{"id":16726322,"url":"https://github.com/brunobonacci/easy-subnet","last_synced_at":"2025-07-30T13:33:12.547Z","repository":{"id":147148471,"uuid":"181292569","full_name":"BrunoBonacci/easy-subnet","owner":"BrunoBonacci","description":"A command-line tool for easy split subnets into equally sized networks","archived":false,"fork":false,"pushed_at":"2020-07-01T10:37:34.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T15:29:33.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrunoBonacci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-14T10:28:13.000Z","updated_at":"2023-04-11T00:06:53.000Z","dependencies_parsed_at":"2023-06-09T21:30:20.037Z","dependency_job_id":null,"html_url":"https://github.com/BrunoBonacci/easy-subnet","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BrunoBonacci/easy-subnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoBonacci%2Feasy-subnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoBonacci%2Feasy-subnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoBonacci%2Feasy-subnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoBonacci%2Feasy-subnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrunoBonacci","download_url":"https://codeload.github.com/BrunoBonacci/easy-subnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrunoBonacci%2Feasy-subnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267875610,"owners_count":24158781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T22:52:52.054Z","updated_at":"2025-07-30T13:33:12.516Z","avatar_url":"https://github.com/BrunoBonacci.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easy-subnet\n\nA command line tool to easily split subnets.\n\n## Installation\n\n  * Installation via Homebrew\n  ``` bash\n  brew tap BrunoBonacci/lazy-tools\n  brew install easy-subnet\n  ```\n\n  * Install command line tool (Native binary for Mac-OSX and Linux)\n  ``` bash\n  mkdir -p ~/bin\n  wget https://github.com/BrunoBonacci/easy-subnet/releases/download/0.4.1/easy-subnet-$(uname -s)-$(uname -m) -O ~/bin/easy-subnet\n  chmod +x ~/bin/easy-subnet\n  export PATH=~/bin:$PATH\n  ```\n\n  * Install command line tool (for Windows and other platforms, requires Java JRE)\n  ``` bash\n  mkdir -p ~/bin\n  wget https://github.com/BrunoBonacci/easy-subnet/releases/download/0.4.1/easy-subnet -O ~/bin/easy-subnet\n  chmod +x ~/bin/easy-subnet\n  export PATH=~/bin:$PATH\n  ```\n\n\n## Usage\n\n``` text\n\n     --=  Easy Subnetting Tool =--\n  (v0.4.1) - (C) Bruno Bonacci - 2019\n\n - To subnet a given network:\n   easy-subnet -c 10.10.0.0/16 -l '{\"dc1\" [\"net1\" \"net2\"], \"dc2\" [\"net1\" \"net2\" \"net3\"]}'\n\n - To list all the IPs of a subnet:\n   easy-subnet list -c 10.10.0.0/16\n   easy-subnet list --from 192.168.12.1 --to 192.168.15.1\n\n - Show network details:\n   easy-subnet net -c 10.10.0.0/16\n\nOptions:\n  -c, --cidr CIDR                   CIDR of the subnet to split\n  -l, --layout LAYOUT               The layout of how to split the subnets\n  -f, --file-layout LAYOUT          The layout of how to split the subnets\n  -p, --print SELECTION     :both   Displays a table with the given selection.\n                                   Can be one of: `both`, `free`, `nets`, default `both`\n  -o, --order ORDER         :net    Diplay ordering: name, net, (default: net)\n      --format FORMAT       :table  The format to display the output. One of: `table`, `json`\n                                    (default: `table`)\n      --from IP                     Starting IP for listing\n      --to IP                       Last IP for listing\n      --stacktrace                  Display full stacktrace in case of errors\n  -h, --help\n\nPlease refer to the following page for more information:\nhttps://github.com/BrunoBonacci/easy-subnet\n\n```\n\nThe layout is a hierarchical structure representing the desired split.\n\nFor example:\n\n``` text\n$ easy-subnet  -c 10.12.15.0/24 -l '[\"net1\" \"net2\"]'\n\n| :name | :network        | :first       | :bcast       | :size |\n|-------+-----------------+--------------+--------------+-------|\n| net1  | 10.12.15.0/25   | 10.12.15.0   | 10.12.15.127 | 128   |\n| net2  | 10.12.15.128/25 | 10.12.15.128 | 10.12.15.255 | 128   |\n```\n\nThe splits must be power of 2, otherwise it cannot be split equally\nand some unused ranges are left.\nThe layout is expressed in [EDN format](https://github.com/edn-format/edn).\n\n\n``` text\n$ easy-subnet  -c 10.12.15.0/24 -l '[\"net1\" \"net2\" \"net3\"]'\n\n| :name  | :network        | :first       | :bcast       | :size |\n|--------+-----------------+--------------+--------------+-------|\n| net1   | 10.12.15.0/26   | 10.12.15.0   | 10.12.15.63  | 64    |\n| net2   | 10.12.15.64/26  | 10.12.15.64  | 10.12.15.127 | 64    |\n| net3   | 10.12.15.128/26 | 10.12.15.128 | 10.12.15.191 | 64    |\n| free/1 | 10.12.15.192/26 | 10.12.15.192 | 10.12.15.255 | 64    |\n```\n\nYou can split networks hierarchically as well:\n\n``` text\n$ easy-subnet -c 10.10.0.0/16 -l '{\"dc1\" [\"net1\" \"net2\"], \"dc2\" [\"net1\" \"net2\" \"net3\"]}'\n\n| :name      | :network       | :first      | :bcast        | :size |\n|------------+----------------+-------------+---------------+-------|\n| dc1.net1   | 10.10.0.0/18   | 10.10.0.0   | 10.10.63.255  | 16384 |\n| dc1.net2   | 10.10.64.0/18  | 10.10.64.0  | 10.10.127.255 | 16384 |\n| dc2.net1   | 10.10.128.0/19 | 10.10.128.0 | 10.10.159.255 | 8192  |\n| dc2.net2   | 10.10.160.0/19 | 10.10.160.0 | 10.10.191.255 | 8192  |\n| dc2.net3   | 10.10.192.0/19 | 10.10.192.0 | 10.10.223.255 | 8192  |\n| dc2.free/1 | 10.10.224.0/19 | 10.10.224.0 | 10.10.255.255 | 8192  |\n```\n\nYou can nest many levels:\n\n``` text\n$ easy-subnet -c 10.10.0.0/16 -l '\n{\"mgmt\" {\"mgmt\"   [\"az1\" \"az2\" \"az3\" ]}\n\n \"dev\"\n {\"public\" [\"az1\" \"az2\" \"az3\" ]\n  \"int-lb\" [\"az1\" \"az2\" \"az3\" ]\n  \"db\"     [\"az1\" \"az2\" \"az3\" ]\n  \"app\"    [\"az1\" \"az2\" \"az3\" ]\n  \"emr\"    [\"az1\" \"az2\" \"az3\" ]\n  \"lambda\" [\"az1\" \"az2\" \"az3\" ]}\n\n \"uat\"\n {\"public\" [\"az1\" \"az2\" \"az3\" ]\n  \"int-lb\" [\"az1\" \"az2\" \"az3\" ]\n  \"db\"     [\"az1\" \"az2\" \"az3\" ]\n  \"app\"    [\"az1\" \"az2\" \"az3\" ]\n  \"emr\"    [\"az1\" \"az2\" \"az3\" ]\n  \"lambda\" [\"az1\" \"az2\" \"az3\" ]}\n\n \"prd\"\n {\"public\" [\"az1\" \"az2\" \"az3\" ]\n  \"int-lb\" [\"az1\" \"az2\" \"az3\" ]\n  \"db\"     [\"az1\" \"az2\" \"az3\" ]\n  \"app\"    [\"az1\" \"az2\" \"az3\" ]\n  \"emr\"    [\"az1\" \"az2\" \"az3\" ]\n  \"lambda\" [\"az1\" \"az2\" \"az3\" ]}}'\n\n| :name             | :network       | :first      | :bcast        | :size |\n|-------------------+----------------+-------------+---------------+-------|\n| mgmt.mgmt.az1     | 10.10.0.0/20   | 10.10.0.0   | 10.10.15.255  | 4096  |\n| mgmt.mgmt.az2     | 10.10.16.0/20  | 10.10.16.0  | 10.10.31.255  | 4096  |\n| mgmt.mgmt.az3     | 10.10.32.0/20  | 10.10.32.0  | 10.10.47.255  | 4096  |\n| mgmt.mgmt.free/1  | 10.10.48.0/20  | 10.10.48.0  | 10.10.63.255  | 4096  |\n| dev.public.az1    | 10.10.64.0/23  | 10.10.64.0  | 10.10.65.255  | 512   |\n| dev.public.az2    | 10.10.66.0/23  | 10.10.66.0  | 10.10.67.255  | 512   |\n| dev.public.az3    | 10.10.68.0/23  | 10.10.68.0  | 10.10.69.255  | 512   |\n| dev.public.free/1 | 10.10.70.0/23  | 10.10.70.0  | 10.10.71.255  | 512   |\n| dev.int-lb.az1    | 10.10.72.0/23  | 10.10.72.0  | 10.10.73.255  | 512   |\n| dev.int-lb.az2    | 10.10.74.0/23  | 10.10.74.0  | 10.10.75.255  | 512   |\n| dev.int-lb.az3    | 10.10.76.0/23  | 10.10.76.0  | 10.10.77.255  | 512   |\n| dev.int-lb.free/1 | 10.10.78.0/23  | 10.10.78.0  | 10.10.79.255  | 512   |\n| dev.db.az1        | 10.10.80.0/23  | 10.10.80.0  | 10.10.81.255  | 512   |\n| dev.db.az2        | 10.10.82.0/23  | 10.10.82.0  | 10.10.83.255  | 512   |\n| dev.db.az3        | 10.10.84.0/23  | 10.10.84.0  | 10.10.85.255  | 512   |\n| dev.db.free/1     | 10.10.86.0/23  | 10.10.86.0  | 10.10.87.255  | 512   |\n| dev.app.az1       | 10.10.88.0/23  | 10.10.88.0  | 10.10.89.255  | 512   |\n| dev.app.az2       | 10.10.90.0/23  | 10.10.90.0  | 10.10.91.255  | 512   |\n| dev.app.az3       | 10.10.92.0/23  | 10.10.92.0  | 10.10.93.255  | 512   |\n| dev.app.free/1    | 10.10.94.0/23  | 10.10.94.0  | 10.10.95.255  | 512   |\n| dev.emr.az1       | 10.10.96.0/23  | 10.10.96.0  | 10.10.97.255  | 512   |\n| dev.emr.az2       | 10.10.98.0/23  | 10.10.98.0  | 10.10.99.255  | 512   |\n| dev.emr.az3       | 10.10.100.0/23 | 10.10.100.0 | 10.10.101.255 | 512   |\n| dev.emr.free/1    | 10.10.102.0/23 | 10.10.102.0 | 10.10.103.255 | 512   |\n| dev.lambda.az1    | 10.10.104.0/23 | 10.10.104.0 | 10.10.105.255 | 512   |\n| dev.lambda.az2    | 10.10.106.0/23 | 10.10.106.0 | 10.10.107.255 | 512   |\n| dev.lambda.az3    | 10.10.108.0/23 | 10.10.108.0 | 10.10.109.255 | 512   |\n| dev.lambda.free/1 | 10.10.110.0/23 | 10.10.110.0 | 10.10.111.255 | 512   |\n| dev.free/1.free/1 | 10.10.112.0/21 | 10.10.112.0 | 10.10.119.255 | 2048  |\n| dev.free/2.free/2 | 10.10.120.0/21 | 10.10.120.0 | 10.10.127.255 | 2048  |\n| uat.public.az1    | 10.10.128.0/23 | 10.10.128.0 | 10.10.129.255 | 512   |\n| uat.public.az2    | 10.10.130.0/23 | 10.10.130.0 | 10.10.131.255 | 512   |\n| uat.public.az3    | 10.10.132.0/23 | 10.10.132.0 | 10.10.133.255 | 512   |\n| uat.public.free/1 | 10.10.134.0/23 | 10.10.134.0 | 10.10.135.255 | 512   |\n| uat.int-lb.az1    | 10.10.136.0/23 | 10.10.136.0 | 10.10.137.255 | 512   |\n| uat.int-lb.az2    | 10.10.138.0/23 | 10.10.138.0 | 10.10.139.255 | 512   |\n| uat.int-lb.az3    | 10.10.140.0/23 | 10.10.140.0 | 10.10.141.255 | 512   |\n| uat.int-lb.free/1 | 10.10.142.0/23 | 10.10.142.0 | 10.10.143.255 | 512   |\n| uat.db.az1        | 10.10.144.0/23 | 10.10.144.0 | 10.10.145.255 | 512   |\n| uat.db.az2        | 10.10.146.0/23 | 10.10.146.0 | 10.10.147.255 | 512   |\n| uat.db.az3        | 10.10.148.0/23 | 10.10.148.0 | 10.10.149.255 | 512   |\n| uat.db.free/1     | 10.10.150.0/23 | 10.10.150.0 | 10.10.151.255 | 512   |\n| uat.app.az1       | 10.10.152.0/23 | 10.10.152.0 | 10.10.153.255 | 512   |\n| uat.app.az2       | 10.10.154.0/23 | 10.10.154.0 | 10.10.155.255 | 512   |\n| uat.app.az3       | 10.10.156.0/23 | 10.10.156.0 | 10.10.157.255 | 512   |\n| uat.app.free/1    | 10.10.158.0/23 | 10.10.158.0 | 10.10.159.255 | 512   |\n| uat.emr.az1       | 10.10.160.0/23 | 10.10.160.0 | 10.10.161.255 | 512   |\n| uat.emr.az2       | 10.10.162.0/23 | 10.10.162.0 | 10.10.163.255 | 512   |\n| uat.emr.az3       | 10.10.164.0/23 | 10.10.164.0 | 10.10.165.255 | 512   |\n| uat.emr.free/1    | 10.10.166.0/23 | 10.10.166.0 | 10.10.167.255 | 512   |\n| uat.lambda.az1    | 10.10.168.0/23 | 10.10.168.0 | 10.10.169.255 | 512   |\n| uat.lambda.az2    | 10.10.170.0/23 | 10.10.170.0 | 10.10.171.255 | 512   |\n| uat.lambda.az3    | 10.10.172.0/23 | 10.10.172.0 | 10.10.173.255 | 512   |\n| uat.lambda.free/1 | 10.10.174.0/23 | 10.10.174.0 | 10.10.175.255 | 512   |\n| uat.free/1.free/1 | 10.10.176.0/21 | 10.10.176.0 | 10.10.183.255 | 2048  |\n| uat.free/2.free/2 | 10.10.184.0/21 | 10.10.184.0 | 10.10.191.255 | 2048  |\n| prd.public.az1    | 10.10.192.0/23 | 10.10.192.0 | 10.10.193.255 | 512   |\n| prd.public.az2    | 10.10.194.0/23 | 10.10.194.0 | 10.10.195.255 | 512   |\n| prd.public.az3    | 10.10.196.0/23 | 10.10.196.0 | 10.10.197.255 | 512   |\n| prd.public.free/1 | 10.10.198.0/23 | 10.10.198.0 | 10.10.199.255 | 512   |\n| prd.int-lb.az1    | 10.10.200.0/23 | 10.10.200.0 | 10.10.201.255 | 512   |\n| prd.int-lb.az2    | 10.10.202.0/23 | 10.10.202.0 | 10.10.203.255 | 512   |\n| prd.int-lb.az3    | 10.10.204.0/23 | 10.10.204.0 | 10.10.205.255 | 512   |\n| prd.int-lb.free/1 | 10.10.206.0/23 | 10.10.206.0 | 10.10.207.255 | 512   |\n| prd.db.az1        | 10.10.208.0/23 | 10.10.208.0 | 10.10.209.255 | 512   |\n| prd.db.az2        | 10.10.210.0/23 | 10.10.210.0 | 10.10.211.255 | 512   |\n| prd.db.az3        | 10.10.212.0/23 | 10.10.212.0 | 10.10.213.255 | 512   |\n| prd.db.free/1     | 10.10.214.0/23 | 10.10.214.0 | 10.10.215.255 | 512   |\n| prd.app.az1       | 10.10.216.0/23 | 10.10.216.0 | 10.10.217.255 | 512   |\n| prd.app.az2       | 10.10.218.0/23 | 10.10.218.0 | 10.10.219.255 | 512   |\n| prd.app.az3       | 10.10.220.0/23 | 10.10.220.0 | 10.10.221.255 | 512   |\n| prd.app.free/1    | 10.10.222.0/23 | 10.10.222.0 | 10.10.223.255 | 512   |\n| prd.emr.az1       | 10.10.224.0/23 | 10.10.224.0 | 10.10.225.255 | 512   |\n| prd.emr.az2       | 10.10.226.0/23 | 10.10.226.0 | 10.10.227.255 | 512   |\n| prd.emr.az3       | 10.10.228.0/23 | 10.10.228.0 | 10.10.229.255 | 512   |\n| prd.emr.free/1    | 10.10.230.0/23 | 10.10.230.0 | 10.10.231.255 | 512   |\n| prd.lambda.az1    | 10.10.232.0/23 | 10.10.232.0 | 10.10.233.255 | 512   |\n| prd.lambda.az2    | 10.10.234.0/23 | 10.10.234.0 | 10.10.235.255 | 512   |\n| prd.lambda.az3    | 10.10.236.0/23 | 10.10.236.0 | 10.10.237.255 | 512   |\n| prd.lambda.free/1 | 10.10.238.0/23 | 10.10.238.0 | 10.10.239.255 | 512   |\n| prd.free/1.free/1 | 10.10.240.0/21 | 10.10.240.0 | 10.10.247.255 | 2048  |\n| prd.free/2.free/2 | 10.10.248.0/21 | 10.10.248.0 | 10.10.255.255 | 2048  |\n```\n\nYou can separate the free (unused) networks from the ones allocated using\n`-p nets` for the allocated ones and `-p free` to display only the unused\nranges.\n\n\n\n### List IPs in subnet\n\nIf you want to list all the IPs in a given subnet you can run:\n\n``` text\n$ easy-subnet list -c 10.12.15.128/28\n10.12.15.128\n10.12.15.129\n10.12.15.130\n10.12.15.131\n10.12.15.132\n10.12.15.133\n10.12.15.134\n10.12.15.135\n10.12.15.136\n10.12.15.137\n10.12.15.138\n10.12.15.139\n10.12.15.140\n10.12.15.141\n10.12.15.142\n10.12.15.143\n```\n\nOr between two IPs:\n\n``` text\n$ easy-subnet list --from 10.12.15.251 --to 10.12.16.6\n10.12.15.251\n10.12.15.252\n10.12.15.253\n10.12.15.254\n10.12.15.255\n10.12.16.0\n10.12.16.1\n10.12.16.2\n10.12.16.3\n10.12.16.4\n10.12.16.5\n10.12.16.6\n```\n\nAlso in reverse order\n``` text\n$ easy-subnet list --from 10.12.16.6 --to 10.12.15.251\n10.12.16.6\n10.12.16.5\n10.12.16.4\n10.12.16.3\n10.12.16.2\n10.12.16.1\n10.12.16.0\n10.12.15.255\n10.12.15.254\n10.12.15.253\n10.12.15.252\n10.12.15.251\n```\n\n### Show network details\n\nYou can display the details of a network via:\n\n``` text\n$ easy-subnet net -c 10.12.16.6/20\n\n| :property    | :value                           |\n|--------------+----------------------------------|\n| network      | 10.12.16.0/20                    |\n| type         | :ip4                             |\n| first-ip     | 10.12.16.0                       |\n| broadcast-ip | 10.12.31.255                     |\n| size         | 4096                             |\n| network-mask | 255.255.240.0                    |\n| bit-mask     | 20                               |\n| ip           | 10.12.16.6                       |\n| bits:ip      | 00001010000011000001000000000110 |\n| bits:bitmask | 11111111111111111111000000000000 |\n```\n\n\n## License\n\nCopyright © 2019 Bruno Bonacci - Distributed under the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobonacci%2Feasy-subnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunobonacci%2Feasy-subnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobonacci%2Feasy-subnet/lists"}