0

My task is to restrict(only send and accept request from specific ip ) the incoming and outgoing n/w traffic from Android H/W(OS 4.0.4).

After Google this, i found that this could be done by iptables but i didn't found that in which file or place i need to change or update.

Can anyone give the example with command assuming that from 1.1.1.1 ip(wifi n/w) Android h/w will connect.

Geet taunk
  • 294
  • 1
  • 5
  • 19

1 Answers1

0
  1. First set a static IP address for your mobile device, follow the link given below, http://unlockforus.blogspot.in/2012/05/how-to-use-static-ip-address-at-android.html

  2. Now you mobile device also a part of Wifi network, so the incoming and outgoing device IP can be tracked.

  3. Modify IP table to Restrict or Allow an IP address using IpTables, follow the links given below, https://help.ubuntu.com/community/IptablesHowTo and iptables block access to port 8000 except from IP address

Community
  • 1
  • 1
sais
  • 803
  • 6
  • 15
  • I am looking into this. But your answer in nowhere connected to android source code, where do i find the iptable file in android source code which i would modify? or i can modify iptabel via commands if so than how? – Geet taunk Oct 22 '13 at 05:32
  • This link may be useful for you, http://stackoverflow.com/questions/4658619/how-to-use-iptables-in-an-android-application – sais Oct 22 '13 at 06:23
  • can please anybody tell me that in Android Source code directory, in which file i need to change/edit to update the iptable rules. – Geet taunk Oct 26 '13 at 12:58