android iptables清空,android中的iptables错误:iptables-save和iptables-restore无法正常工作...

我已经为

Android模拟器编译了Linux,并启用了完整的netfilter功能.从源代码构建android之后获得了iptables二进制文件.

当我把这个二进制文件推送到模拟器

我可以成功执行下面的命令.

iptables -L

iptables -F

iptables -A INPUT -s www.google.com -j DROP

有这个错误:

# # iptables -L

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

Chain INPUT (policy ACCEPT)

target prot opt source destination

Chain FORWARD (policy ACCEPT)

target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

#

# iptables -A INPUT -s www.google.com -j DROP

getsockopt for multiport failed strangely: No such file or directory

getsockopt for multiport failed strangely: No such file or directory

FIX ME! implement getgrnam() bionic/libc/bionic/stubs.c:344

但至少他们上面的命令工作!

但是当我尝试

iptables-save or

iptables-restore

我得到错误说

iptables-save: not found

在我的配置文件中

CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m

问题是什么..??如何在android中启用完整的iptables功能,或者如何安全地保存当前活动的iptables规则并在下次重启时重新加载它们.

请帮忙.谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
序言 1.1. 为什么要写这个指南 1.2. 指南是如何写的 1.3. 文出现的术语 2. 准备阶段 2.1. 哪里能取得iptables 2.2. 内核配置 2.3. 编译与安装 2.3.1. 编译 2.3.2. 在Red Hat 7.1上安装 3. 表和链 3.1. 概述 3.2. mangle 表 3.3. nat 表 3.4. Filter 表 4. 状态机制 4.1. 概述 4.2. conntrack记录 4.3. 数据包在用户空间的状态 4.4. TCP 连接 4.5. UDP 连接 4.6. ICMP 连接 4.7. 缺省的连接操作 4.8. 复杂协议和连接跟踪 5. 保存和恢复数据管理规则 5.1. 速度 5.2. restore的不足之处 5.3. iptables-save 5.4. iptables-restore 6. 规则是如何练成的 6.1. 基础 6.2. Tables 6.3. Commands 6.4. Matches 6.4.1. 通用匹配 6.4.2. 隐含匹配 6.4.3. 显式匹配 6.4.4. 针对非正常包的匹配 6.5. Targets/Jumps 6.5.1. ACCEPT target 6.5.2. DNAT target 6.5.3. DROP target 6.5.4. LOG target 6.5.5. MARK target 6.5.6. MASQUERADE target 6.5.7. MIRROR target 6.5.8. QUEUE target 6.5.9. REDIRECT target 6.5.10. REJECT target 6.5.11. RETURN target 6.5.12. SNAT target 6.5.13. TOS target 6.5.14. TTL target 6.5.15. ULOG target 7. 防火墙配置实例 rc.firewall 7.1. 关于rc.firewall 7.2. rc.firewall详解 7.2.1. 参数配置 7.2.2. 外部模块的装载 7.2.3. proc的设置 7.2.4. 规则位置的优化 7.2.5. 缺省策略的设置 7.2.6. 自定义链的设置 7.2.7. INPUT链 7.2.8. FORWARD链 7.2.9. OUTPUT链 7.2.10. PREROUTING链 7.2.11. POSTROUTING链 8. 例子简介 8.1. rc.firewall.txt脚本的结构 8.1.1. 脚本结构 8.2. rc.firewall.txt 8.3. rc.DMZ.firewall.txt 8.4. rc.DHCP.firewall.txt 8.5. rc.UTIN.firewall.txt 8.6. rc.test-iptables.txt 8.7. rc.flush-iptables.txt 8.8. Limit-match.txt 8.9. Pid-owner.txt 8.10. Sid-owner.txt 8.11. Ttl-inc.txt 8.12. Iptables-save ruleset A. 常用命令详解 A.1. 查看当前规则集的命令 A.2. 修正和清空iptables的命令 B. 常见问题于与解答 B.1. 模块装载问题 B.2. 未设置SYN的NEW状态包 B.3. NEW状态的SYN/ACK包 B.4. 使用私有IP地址的ISP B.5. 放行DHCP数据 B.6. 关于mIRC DCC的问题 C. ICMP类型 D. 其他资源和链接 E. 鸣谢 F. History G. GNU Free Documentation License 0. PREAMBLE 1. APPLICABILITY AND DEFINITIONS 2. VERBATIM COPYING 3. COPYING IN QUANTITY 4. MODIFICATIONS 5. COMBINING DOCUMENTS 6. COLLECTIONS OF DOCUMENTS 7. AGGREGATION WITH INDEPENDENT WORKS 8. TRANSLATION 9. TERMINATION 10. FUTURE REVISIONS OF THIS LICENSE How to use this License for your documents H. GNU General Public License 0. Preamble 1. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 2. How to Apply These Terms to Your New Programs I. 示例脚本的代码 I.1. rc.firewall脚本代码 I.2. rc.DMZ.firewall脚本代码 I.3. rc.UTIN.firewall脚本代码 I.4. rc.DHCP.firewall脚本代码 I.5. rc.flush-iptables脚本代码 I.6. rc.test-iptables脚本代码 List of Tables 3-1. 以本地为目标(就是我们自己的机子了)的包 3-2. 以本地为源的包 3-3. 被转发的包 4-1. 数据包在用户空间的状态 4-2. 内部状态 6-1. Tables 6-2. Commands 6-3. Options 6-4. Generic matches 6-5. TCP matches 6-6. UDP matches 6-7. ICMP matches 6-8. Limit match options 6-9. MAC match options 6-10. Mark match options 6-11. Multiport match options 6-12. Owner match options 6-13. State matches 6-14. TOS matches 6-15. TTL matches 6-16. DNAT target 6-17. LOG target options 6-18. MARK target options 6-19. MASQUERADE target 6-20. REDIRECT target 6-21. REJECT target 6-22. SNAT target 6-23. TOS target 6-24. TTL target 6-25. ULOG target C-1. ICMP类型

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值