我已经为 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 规则并在下次重新启动时重新加载它们。
请帮忙。谢谢你!