LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Mobile (http://www.linuxquestions.org/questions/linux-mobile-81/)
-   -   iptables error in android: iptables-save and iptables-restore not working (http://www.linuxquestions.org/questions/linux-mobile-81/iptables-error-in-android-iptables-save-and-iptables-restore-not-working-872916/)

preetb123 04-04-2011 01:24 PM

iptables error in android: iptables-save and iptables-restore not working
 
I have compiled Linux for android emulator with full netfilter functionality enabled. And got a iptables binary after building android from source.

When i push this binary to the emulator

i can execute commands like below successfully.

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


with this error:

# # 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
#


and

# 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

but atleast the above commands they work!

but when i try

iptables-save or
iptables-restore


i get error saying

iptables-save: not found

In my config file

CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m

what is the problem..?? and how can i enable full iptables functionality in android or how can i save the current active iptables rules safely and reload them when next reboot.

please help. thank you!

archtoad6 04-08-2011 10:03 AM

4 days & no answers, I can move this to Linux - Networking, Linux - Wireless Networking, or Linux - Security if you think you'd get better exposure. Meanwhile, consider adding "Code:" blocks to your OP:
Quote:

Please put code, command line output, config files, etc. inside [CODE] tags, aka "Code:" blocks.

It will make your posts easier to read, & that will get you more, faster, better answers. -- Help us help you.
BTW, You can edit your post(s) to do this retroactively.

Thank you.

preetb123 04-08-2011 12:10 PM

Quote:

Originally Posted by archtoad6 (Post 4318068)
4 days & no answers, I can move this to Linux - Networking, Linux - Wireless Networking, or Linux - Security if you think you'd get better exposure. Meanwhile, consider adding "Code:" blocks to your OP:


Actually i didn't know how to put code blocks. And regarding the question:

I think android team has modified iptables source, to exclude iptables-save than they must have modified some source files which call functions in iptables-save. May be because of that, the error comes
and also i checked iptables 1.3.7 sourcecode from netfilter. It seems that android source has its own modified iptables. Like, the file iptables-1.3.7/extension/libipt_connmark.c is changed to libipt_2connmark.c

I don't think this can be done, if also i want to i will have to modify the source again for android specific iptables...

archtoad6 04-09-2011 09:06 AM

Quote:

BTW, You can edit your post(s) to do this retroactively.
I really think you'd improve your chances of getting someone knows something about your question to take the time to read it thoroughly & reply. OTOH, it's your post, & your choice. Good luck.

preetb123 04-09-2011 11:13 AM

Quote:

Originally Posted by archtoad6 (Post 4319106)
I really think you'd improve your chances of getting someone knows something about your question to take the time to read it thoroughly & reply. OTOH, it's your post, & your choice. Good luck.

Thank you very much! I'll do it from now.

archtoad6 04-11-2011 02:56 PM

Quote:

Originally Posted by preetb123 (Post 4319185)
I'll do it from now.

I assume you mean "from now on"

That's good, thank you; but I was asking you to fix your 1st post in this thread:
http://www.linuxquestions.org/questi...6/#post4313606


All times are GMT -5. The time now is 03:10 PM.