GitXplorerGitXplorer
h

country_via

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
48d134f2cc5d04a76982c0aa6205a46993b34bf6

update README

hhuiyiqun committed 6 years ago
Unverified
857b2f2bb8ff937d63fafcba7e1fdfa07dfbcf75

add README

hhuiyiqun committed 6 years ago
Unverified
2c697f0443a0ec3a22954323f89e33a63039c5f5

release 0.0.5

hhuiyiqun committed 6 years ago
Unverified
1de2d48886449a1f7be087f88d727e4f98489db9

remove useless print

hhuiyiqun committed 6 years ago
Unverified
ce4d0de368f6827b35384caf791d7ec2ff7f2dcb

release 0.0.4

hhuiyiqun committed 6 years ago
Unverified
66ec1d983b7e91d38640771be891c11fbd1a9607

support reading addresses from plain text

hhuiyiqun committed 6 years ago

README

The README file for this repository.

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