https://github.com/lumarans30/subnetting-rust
A simple CLI subnet calculator in Rust.
https://github.com/lumarans30/subnetting-rust
csv-import rust subnetting-ipv4-addresses
Last synced: 10 months ago
JSON representation
A simple CLI subnet calculator in Rust.
- Host: GitHub
- URL: https://github.com/lumarans30/subnetting-rust
- Owner: LuMarans30
- License: mit
- Created: 2024-07-19T17:29:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-22T15:42:40.000Z (almost 2 years ago)
- Last Synced: 2025-03-18T01:16:03.060Z (over 1 year ago)
- Topics: csv-import, rust, subnetting-ipv4-addresses
- Language: Rust
- Homepage: https://lumarans30.github.io/Subnetting-rust
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Subnet Calculator




A simple command-line subnet calculator written in Rust.
## What it does
- Calculates subnet info based on a network address, CIDR, and number of hosts
- Handles multiple subnets
- Lets you input data manually or import from a CSV file
- Can save results as CSV or Markdown
## Getting Started
1. Make sure you have Rust installed. If not, grab it from [https://www.rust-lang.org/](https://www.rust-lang.org/).
2. Clone this repo:
```bash
git clone https://github.com/LuMarans30/Subnetting-rust.git
```
3. Enter the directory:
```bash
cd Subnetting-rust
```
4. Build it:
```bash
cargo build --release
```
5. Run it:
```bash
./target/release/subnetting
```
Alternatively, [precompiled binaries for most platforms](https://github.com/LuMarans30/Subnetting-rust/releases/latest) are available.
## Usage
### Manual Input
1. Choose option 1
2. Type in your network address with CIDR (like 192.168.1.0/24)
3. Enter how many subnets you want
4. For each subnet, enter the number of hosts you need
### CSV Import
1. Choose option 2
2. Enter the path to your CSV file
Your CSV should look like this:
(The first line is the initial network address with CIDR, then one line per subnet with the number of hosts)
```csv
,
...
```
Alternatively, you can use a slash ('/') as a delimiter:
```csv
/
...
```
## What You'll Get
For each subnet, you'll see:
- Network address
- Subnet mask
- CIDR
- Subnet class
- Broadcast address
- Gateway
- First and last usable host addresses
- Request number of hosts
- Actual number of hosts
- How many IP addresses are wasted
You can save all this info to a CSV or Markdown file if you want.
## Contributing
This project was created as a learning exercise. While it's primarily for personal use, suggestions and improvements are welcome. Feel free to open an issue or submit a pull request if you have ideas to enhance its functionality.
## License
This project is open-source and available under the [MIT License](LICENSE).