Skip to content

giovanni-iannaccone/subnethero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

License Number of GitHub issues that are open Number of GitHub closed issues Number of GitHub pull requests that are open GitHub commit activity Number of GitHub contributors Number of GitHub stars

🦸‍♂️ Subnethero

Subnethero is a powerful C-based command-line tool designed to help network administrators and IT professionals generate subnetting tables and manage IP ranges for different network configurations. Whether you're using a flat approach, FLSM (Fixed-Length Subnet Mask), or VLSM (Variable-Length Subnet Mask), this tool will streamline the process of subnetting and ensure you get precise network breakdowns.

🧮 Features

  • Multiple subnetting approaches (flat, flsm, vlsm)
  • Simple command-line interface
  • Displays subnet information in a clear tabular format
  • Generates subnetting tables with efficient algorithm
  • Save the output to a csv file
  • Parse csv to get network configuration
  • IP lookup to know which subnet owns an IP

📡 Installation

  1. Download subnethero with git
git clone https://github.com/giovanni-iannaccone/subnethero
cd subnethero
  1. Compile it using make
make all

💡 Command-Line Usage

subnethero v1.0

Usage:
subnethero [-t | -f | -v] -c cidr -i ip -s n {n devices for each network}

Options:
  -t | --flat        use the flat approach
  -f | --flsm        use the flsm approach
  -v | --vlsm        use the vlsm approach

  -i | --ip          specify the IP of the base network
  -c | --cidr        the CIDR of the original network
  -s | --subs        number of subnetworks (followed by n devices for each network)

  Optional:
  -p | --input       read network configuration from a csv file
  -o | --output      copy the output into csv file
  -l | --lookup      find which subnet owns an ip

Example: subnethero -v -c 24 -i 192.168.1.0 -s 3 64 5 15

Parameters:

  • -t | --flat
    This option uses a flat approach to subnetting, dividing the network into one big subnet.

  • -f | --flsm
    This option applies the Fixed-Length Subnet Mask method, creating subnets of the same size based on the given number of devices.

  • -v | --vlsm
    This option uses the Variable-Length Subnet Mask method, where each subnet can vary in size according to the number of devices specified.

  • -i | --ip
    Enter the starting IP address of the network you want to subnet (e.g., 192.168.1.0).

  • -c | --cidr
    Specify the CIDR notation for the original network (e.g., /24).

  • -s | --subs
    Define the number of subnets you need, followed by the number of devices in each subnet. The tool will calculate the necessary subnet masks.

  • -p | --input
    Read network configuration from a csv file and do calculations on that configuration (e.g., lookup).

  • -o | --output
    Copy the output to a csv file (e.g., output.csv), don't specify anything to print the table to stdout.

  • -l | --lookup
    To determine which subnet a specific IP address belongs to, simply add the -l IP flag at the end of your command.

🛸 Output Format

For each subnet, the output will generate the following columns:

IP CIDR Broadcast Start End Free from to
192.168.1.0 /26 192.168.1.63 192.168.1.1 192.168.1.32 192.168.1.33 192.168.1.62
192.168.1.64 /26 192.168.1.127 192.168.1.65 192.168.1.69 192.168.1.70 192.168.1.126
192.168.1.128 /26 192.168.1.191 192.168.1.129 192.168.1.143 192.168.1.144 192.168.1.190

🧩 Contributing

We welcome contributing. See CONTRIBUTING.md file for details

⚖️ License

This project is licensed under the GPL-3.0 License. See the LICENSE file for details.

⚔️ Contact

About

Useful CLI tool to generate network segmentation tables, and to export and analyze them in CSV format 🦸‍♂️

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors