‹ projects

netscan

tool for scanning networks and calculating available subnets
Log | Files | Refs | README

README.md (2077B)


      1 # Network Interface Subnet Allocation Tool
      2 
      3 ## Overview
      4 
      5 This tool scans network interfaces, identifies groups connected to the same physical network, detects existing DHCP servers, and calculates available subnets. The outputs are designed to be line-oriented for easy integration with shell scripts and automation.
      6 
      7 ## Features
      8 
      9 - Scans network interfaces and identifies groups sharing the same Layer 2 network.
     10 - Detects pre-existing DHCP servers and their offered subnets.
     11 - Calculates available subnets based on user-provided pools and existing allocations.
     12 - Outputs data in a simple, parseable line-oriented format.
     13 
     14 ## Dependencies
     15 
     16 Install required system packages (Void Linux) and install `define-networks` to the system path:
     17 ```bash
     18 sudo bash install.sh
     19 ```
     20 
     21 ## Usage
     22 
     23 Run the tool with appropriate arguments:
     24 ```bash
     25 define-networks -i eth -t 10 -s 10.0.0.0/8 -m eth0 192.168.1.0/24 -d 24
     26 ```
     27 
     28 ### Arguments:
     29 - `-i, --interfaces`: Specify interface types (e.g., `eth`, `wlan`, `tap`).
     30 - `-t, --timeout`: Set the timeout for ARP scanning (in seconds).
     31 - `-s, --subnets`: Define subnet pools in CIDR format (e.g., `10.0.0.0/8`).
     32 - `-m, --manual`: Assign manual interface-subnet pairs (e.g., `eth0 192.168.1.0/24`).
     33 - `-d, --subnetsize`: Set the default subnet size for dynamic allocations (e.g., `/25`).
     34 - `-j, --join`: Specify interfaces assumed to share the same Layer 2 network.
     35 
     36 ### Example Command:
     37 ```bash
     38 define-networks -i eth wlan -t 5 -s 192.168.0.0/16 -m eth0 192.168.1.0/24 -d 24 -j eth0 eth1
     39 ```
     40 
     41 ### Example Output:
     42 The output is line-oriented and looks like this:
     43 ```
     44 ifaces: eth0 eth1 status: discovered subnet: 192.168.1.0/24
     45 ifaces: eth2 status: none subnet: 10.0.0.0/24
     46 ```
     47 
     48 ## Notes
     49 
     50 - **Permissions**: Root or sudo access is required to interact with network interfaces and run ARP scans.
     51 - **Output-Only**: This tool does not configure DHCP servers or modify network settings. It outputs discovery and allocation data for manual or automated use.
     52 - **Line-Oriented Output**: Designed for easy parsing in shell scripts and automation workflows.