Skip to main content

Country Via

Naive Scripts to help you manage routes to specific country.

Installation

~> pip install country-via

Usage

~> country-via --help
usage: country-via [-h] (--country COUNTRY_CODE | --file FILE) [--via VIA]
                   [--dev DEV] [--type TYPE] [--table TABLE]
                   [--format {ip_route,systemd_network,plain_list}]

Generate route for given country

optional arguments:
  -h, --help            show this help message and exit
  --country COUNTRY_CODE, -c COUNTRY_CODE
                        fetch addresses from nirsoft with the country code
  --file FILE           read addresses from plain text
  --format {ip_route,systemd_network,plain_list}, -f {ip_route,systemd_network,plain_list}
                        the format of the output

variables for the template:
  --via VIA, -v VIA     the gateway for the country
  --dev DEV, -d DEV     the device name of gateway
  --type TYPE, -t TYPE  the routing type
  --table TABLE         the routing table number to be operated

Examples

To dump networks of China:

~> country-via --country cn --format plain_list

To set up routes for China with systemd-networkd:

~> country-via --country cn --format systemd_network --via 10.233.0.1 > /etc/systemd/network/ol.network.d/cn.conf

To set up routes for China on the fly (with iproute2):

~> country-via --country cn --format systemd_network --via 10.233.0.1 | sudo bash

To set up routes table for custom addresses:

~> country-via --file campus.txt --format systemd_network --via 10.233.0.1 > /etc/systemd/network/ol.network.d/campus.conf

Metadata

Release files for country-via 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for country-via 0.0.6
File Size Uploaded
country_via-0.0.6.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for country-via 0.0.6
File Interpreter ABI Platform
country_via-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.7 kB

Release files / country_via-0.0.6.tar.gz

Download URL country_via-0.0.6.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b1237dd76097359bab4d70b5cd712fa5a909d65647be2cbf32c998a304a381ab
BLAKE2b-256 checksum
How to use checksums
684f1e32b716b9d5a0dac89c6fe3fb69396af98c189b19c8faad55f74fd480b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release files / country_via-0.0.6-py3-none-any.whl

Download URL country_via-0.0.6-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
091a5ad49375243cb8c750a3314b386df983cb682d81cb01d5312e00b38017e9
BLAKE2b-256 checksum
How to use checksums
7ad526d6da8e3d059c18d293a3afa61aaf435313c1bf16722328bd9bba717033
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page