user900785
user900785

Reputation: 423

iptables 1.4.11 on Android

I have downloaded the Android kernel sources from http://source.android.com/source/building-kernels.html

I have then started the emulator and wanted to play with iptable rules but I get this following error. Is the iptable package not fully installed? why is NAT table missing?

Initially I had started following http://randomizedsort.blogspot.de/2011/03/porting-iptables-1410-to-android.html#comment-form_8482839589527760177 to install iptables, but having seen iptablesv1.4.11.1 on the adb shell, I had abandoned the idea. Has anybody tried porting iptables on newer android kernel sources??

 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.

Please advise!

Upvotes: 2

Views: 5233

Answers (1)

Hans-Christoph Steiner
Hans-Christoph Steiner

Reputation: 2682

Use protocol numbers (-p 6) instead of names (-p tcp):

iptables -t nat -A OUTPUT -p 6 --dport 8000 -j REDIRECT --to-port 8080

See this answer for more info: getprotobyname error iptables

Upvotes: 1

Related Questions