我已经从以下位置下载了 Android 内核源代码http://source.android.com/source/building-kernels.html http://source.android.com/source/building-kernels.html
然后我启动了模拟器并想使用 iptable 规则,但出现以下错误。 iptable 软件包没有完全安装吗?为什么 NAT 表丢失?
最初我开始关注http://randomizedsort.blogspot.de/2011/03/porting-iptables-1410-to-android.html#comment-form_8482839589527760177 http://randomizedsort.blogspot.de/2011/03/porting-iptables-1410-to-android.html#comment-form_8482839589527760177安装 iptables,但在 adb shell 上看到 iptablesv1.4.11.1 后,我放弃了这个想法。有人尝试过在较新的 Android 内核源上移植 iptables 吗?
adb shell
# su root
# iptables -t nat -A OUTPUT -p tcp --dport 8000 -j REDIRECT --to-port 8080
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:450
iptables v1.4.11.1: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
请指教!
使用协议号(-p 6
) 而不是名称 (-p tcp
):
iptables -t nat -A OUTPUT -p 6 --dport 8000 -j REDIRECT --to-port 8080
请参阅此答案以获取更多信息:iptables getprotobyname 错误 https://stackoverflow.com/questions/10331699/getprotobyname-error-iptables/18385413#18385413
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)