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

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为什么加载个人密钥库需要这么多时间?   当我使用main创建Android应用程序UI时,如何通过java修改它。xml文件?   java Tomcat 6和7:WebappClassLoader:尝试为名称org/apache/openjpa/persistence/osgi/BundleUtils复制类定义   java`parseInt()`和`parseDouble()`throw`NumberFormatExeption`   JavaSpringMongoDB填充引用   在LinuxMint中打开Eclipse时发生java错误;OpenJDK 64位服务器VM警告:忽略选项MaxPermSize=512m;支持在8.0中被删除   使用PKCS7Padding的AES CBC加密在Java和Objective中有不同的结果   java为什么Jackson要用一个以类命名的额外层来包装我的对象?   json在Java中使用parallelStream提取值   JavaSpring存储库自动生成方法:按给定的顶部编号+按字段描述排序选择   java是否有可序列化的标准闭包接口?   .NET与Java在初创公司的web应用程序开发   如何修复java。java中的lang.unsatifiedLinkError   JavaFX+Spring Boot+Hibernate应用程序对多个环境的java支持   自定义视图组中的java更改未呈现