https://github.com/willfarrell/ip-cidr-rebase
Rebase CIDR into smaller subnets
https://github.com/willfarrell/ip-cidr-rebase
Last synced: 9 months ago
JSON representation
Rebase CIDR into smaller subnets
- Host: GitHub
- URL: https://github.com/willfarrell/ip-cidr-rebase
- Owner: willfarrell
- License: mit
- Created: 2017-12-23T02:22:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-23T02:54:35.000Z (over 8 years ago)
- Last Synced: 2025-07-07T11:44:39.420Z (10 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ip-cidr-rebase
Rebase CIDR into smaller subnets.
Why does this exist? Well, AWS WAF only allows `[8,16,24,32]`, using this function you can convert `x.x.x.x/20` into
16 `x.x.x.x/24` CIDR Ranges. Great for build scripts.
## Install
```bash
npm i ip-cidr-rebase
```
## Use
```javascript
const cidrRebase = require('ip-cidr-rebase');
const cidr = '192.168.0.0/20';
const cidrs = cidrRebase(cidr, [8,16,24,32]);
```