国家/地区的路线配置工具

country-via的Python项目详细描述


国家/地区via

帮助您管理到特定国家/地区的路线的简单脚本。

安装

~> pip install country-via

用法

~> 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

示例

要转储中国的网络:

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

systemd-networkd

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

为飞行中的中国建立航线(带iproute2):

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

为自定义地址设置路由表:

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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Eclipse Helios for Web项目   java指定行。作为编译器设置的分隔符?   osm映射中带有osmdroid的java标记   java Android ClassNotFoundException在路径:DexPathList上未找到类   java从j2me调用GWT方法   更新到java 8后的aspectj问题   如何仅从根元素java,com提取文本内容。滴虫软件。是的。html   安卓公司。谷歌。火基。数据库DatabaseException:未能转换java类型的值。将字符串改为长字符串   从java中的方法返回arraylist变量   java如果将引用重新分配给同步块内的锁对象,会是什么?   java下载。使用spring mvc的资源文件中的xlsx文件   java Eclipse提供了什么工具来运行Eclipse中未包含的程序?   spring boot Java泛型如何读取传递给泛型方法的类型上的字段或调用方法   Javacard中的javaecdsa签名