问题
Background:
I'm trying to setup a VPN server on android phone. For, this I am trying to use android sample application ToyVpn.
To setup the server, I have to add following rule in the nat table
#Pick a range of private addresses and perform NAT over eth0.
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE
But I got following error:
iptables v1.4.14: can't initialize iptables table -nat: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
I do not have any prior knowledge of working with the iptables. But, I searched about it, and replaced "-A" by "-I" i.e. instead of appending rule in the table now I'm inserting rule in the table, because my table was empty.
Problem:
The problem is that, Now in the nat table there is following message:
FIX ME! impliment getnetbyaddr() bionic/libc/bionic/stubs.c:444
above the rule that I inserted. The rule is appearing as:
MASQUERADE all -- 10.0.0.0/8 anywhere
Can anyone please guide me about what I did wrong and how can I fix it!
回答1:
I do not think you did anything wrong - the message seems to indicate that a critical libc function is not implemented in bionic, the C library used by Android.
I do not think there is really anything you can do, short of implementing the function in bionic and then possibly compiling most of an Android system from source.
来源:https://stackoverflow.com/questions/13565475/android-nat-table-fix-me-impliment-getnetbyaddr-bionic-libc-bionic-stubs-c