将iptables命令集转换为iptables保存格式
iptables-converter的Python项目详细描述
iptables转换器
iptables converter:将iptables转换为iptables保存格式,输出 附带[0:0]用于iptables还原-c
ip6tables converter:将ip6tables转换为ip6tables保存格式, ip6tables restore-c的输出带有[0:0]
source:https://github.com:sl0/conv.git
版本:0.9.10
日期:2017-11-16
许可证:
- GNU GENERAL PUBLIC LICENSE Version 3 later
- Apache License Version 2.0
作者:johannes hubertzjohannes@hubertz.de
iptables converter通过 将它们转换为iptables保存格式,然后通过 iptables恢复比加载普通命令快得多。 加载本身不是iptables转换器的一部分。
用法:
iptables-converter [ -d destination ] [ -s source ] [ --sloppy ] ip6tables-converter [ -d destination ] [ -s source ] [ --sloppy ]
这假设source是一个包含行的纯ascii文件 从iptables开始构建防火墙规则集。线路起始 使用/sbin/iptables也可以理解。省略-s源 默认为读取名为rules的文件。可选的sloppy 参数使任何用户定义的定义过早(-n name) 链不必要,它们是通过第一次提及自动定义的 他们。可选地-d目的地将所有内容写入给定的 从0.9.10节起的目标文件。忽略此选项将导致 将输出写入stdout,这是默认行为。数据包计数器 字节计数器包括[0:0],它与 iptables restore以及iptables restore-c。
ip6tables converter同样适用于ip6tables。
它们都适用于filter、mangle、nat和raw表, security目前不支持表。
从0.9.10版本开始,它作为一个使用入口点的python模块工作。 以便于进口。为了方便起见,该模块命名为 iptables\u conv。
在travis-ci.org上,tests会自动运行,这要感谢guido! 要在本地运行它们,请使用python:
python setup test
或者tox,这是首选的测试运行程序。 iptables converter经过测试,与python2.7、python3.5配合使用效果良好 还有Python3.6。测试是 使用pytest完成,以便于将来编写测试用例。一些狮身人面像 准备好文件。Debian包提供给 binaries和 sphinx-documentation。 git buildpackage动态创建它们。RPM可以由python创建:
setup.py bdist_rpm
欢迎评论。
玩得开心!
约翰内斯