控制rv6688bcm路由器
rvcm的Python项目详细描述
这是用于控制路由器的库和cli实用程序。这取决于 python3.5和请求库。
请参阅源代码中的API—它非常简单和简短。
对于options=,cli还有一个--help。你可以从这个开始 命令:python router.pyz --help,其中python必须是python 3.5或更高。
提供此输出:
usage: router.pyz [OPTIONS] COMMAND [ARGS]... Options: --ip TEXT Router IP --user TEXT Login name --password TEXT Password --help Show this message and exit. Commands: calls Calls operations nat NAT operations router Direct router operations
路由器控制支持基本的环境变量(除了 命令行参数):
- RC_IP-路由器的IP地址
- RC_USER-路由器的登录名(默认:admin)
- RC_PASSWORD-路由器密码(默认:admin)
路由器操作
Usage: router.pyz router [OPTIONS] COMMAND [ARGS]... Direct router operations Options: --help Show this message and exit. Commands: apply Apply changes on the router export Print details about router in json info Print details about router
示例:
命令:python router.pyz --ip 192.168.100.1 router info
NAT操作
Usage: router.pyz nat [OPTIONS] COMMAND [ARGS]... NAT operations Options: --help Show this message and exit. Commands: create Create forwarding rule disable Disable (but not remove) rule enable Enable rule info Print forwarding table remove Remove forwarding rule rename Rename forwarding rule update Update forwarding record
呼叫操作
Usage: router.pyz calls [OPTIONS] COMMAND [ARGS]... Calls operations Options: --help Show this message and exit. Commands: export Print calls history in JSON info Print calls history