Can't figure out how to insert iptables rule first
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't figure out how to insert iptables rule first
Greetings,
I have an app for Android that leverages IPTABLES to block apps based on UID.
It works great with one exception on some devices using Android 4.x. When a user enables "Set Mobile Data Limit" on some devices the iptables for cellular data are negated.
How would I insert my rules to offset this?
pkts bytes target prot opt in out source destination
37 7848 costly_rmnet_sdio0 all -- any rmnet_sdio0 anywhere anywhere [goto]
I currently insert into the beginning of the chain and reapplying the rules doesn't change anything.
IPTABLES -I OUTPUT 1 -j droidwall
Here is the full output on a device that is affected by this issue.
root@android:/ # iptables --list OUTPUT --verbose
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
108 6758 all -- any !lo+ anywhere anywhere ! quota globalAlert: 2097152 bytes
37 7848 costly_rmnet_sdio0 all -- any rmnet_sdio0 anywhere anywhere [goto]
1321 85531 ACCEPT all -- any lo anywhere anywhere
39239 2701K all -- any any anywhere anywhere owner socket exists
273 21255 droidwall all -- any any anywhere anywhere
Any help is greatly appreciated!
Thanks in advance!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.