NordVPN subnet servers divider
nordiv
is a command-line tool that divides NordVPN servers into subnets. It fetches server information from the NordVPN API, processes it, and groups servers based on specified subnets.
Built with AI with love <3
- Rust (latest stable version)
- Cargo package manager
-
Clone the repository:
git clone https://github.com/stokowski/nordiv.git cd nordiv
-
Build the project:
cargo build --release
-
The compiled binary will be available at
target/release/nordiv
.
You can run nordiv
either by providing command-line arguments or by using a configuration file.
nordiv [OPTIONS]
Options:
-c, --config <FILE> Sets a custom config file
-u, --api-url <URL> Sets the API URL (used only if config is not provided)
-s, --subnet <SUBNET> Sets the subnet (used only if config is not provided)
-p, --new-prefix <PREFIX> Sets the new prefix (used only if config is not provided)
-l, --log-level <LEVEL> Sets the level of logging (used only if config is not provided)
-f, --log-file <FILE> Sets the log file (used only if config is not provided)
-h, --help Print help
-V, --version Print version
You can use a configuration file instead of command-line arguments. Create an INI file with the following structure:
[DEFAULT]
api_url = https://api.nordvpn.com/v1/servers
subnet = 192.168.0.0/24
new_prefix = 26
log_level = info
log_file = nordiv.log
Then run nordiv
with the -c
option:
nordiv -c path/to/your/config.ini
-
Using command-line arguments:
nordiv --api-url https://api.nordvpn.com/v1/servers --subnet 192.168.1.0/24 --new-prefix 26 --log-level info --log-file nordiv.log
-
Using a configuration file:
nordiv -c nordiv.ini
-
Build Docker container
docker build -t nordiv .
-
Run Docker container
docker run --rm -it -v ${PWD}:/app -- nordiv --api-url https://api.nordvpn.com/v1/servers --subnet 192.168.1.0/24 --new-prefix 26 --log-level debug --log-file /app/nordiv.log
The tool will output information about:
- Total and online servers
- Grouped servers by subnet
- Servers without matches
- Detailed server information with matched and missed subnets
Logs will be written to the console or a file based on the configuration.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.