Questions tagged [iptables]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
36 views

How to route all my Android phone own's DNS request to 8.8.8.8 in iptables with root?

su iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to 8.8.8.8:53 The above command is really working, but only for client phones who are using my phone's WiFi hotspot. The result I need is for ...
user avatar
  • 1
1 vote
0 answers
38 views

How to IP forwarding/NAT from WIFI -> Mobile data without creating hotspot/access point

I would like to be able to use my android phone as a backup internet connection if my home broadband goes down. The idea is that if the network went down I would set up a static route on my home ...
user avatar
  • 111
0 votes
0 answers
38 views

How to override (or a least view) the RDNSS ipv6 DNS? (root)

As far as ipv4 DNS is concerned, Android (at least version 9) can override default DNS settings fairly well. Firstly, it is possible to set net.dns* to the desired value. Secondly, iptables -t nat ...
user avatar
3 votes
2 answers
515 views

How to run .sh script (iptables commands) on start up

I am using LineageOS 18.1 When I was on LOS 16, I used to edit the file /system/etc/init.d/00banner and put my iptables commands there, e.g.: #!/system/bin/sh sh -c 'iptables -A OUTPUT -m owner --uid-...
user avatar
1 vote
0 answers
169 views

iptables-restore not working after iptables-save

I am trying the below with iptables-save > test.rules i am saving the saved rules file then with command iptables-restore test.rules, i am trying to restore the rules On iptables-restore, seeing ...
user avatar
1 vote
1 answer
971 views

Android: how to find application locking xtables?

I have Pixel Experience (Android 10) installed on my Redmi K20. + Magisk 21.4. In terminal I enter command iptables -t mangle -L -n | grep TTL which throws Another app is currently holding the xtables ...
user avatar
1 vote
1 answer
458 views

Android cannot forward packets

Target: Perform IP forwarding for devices within the same local network. (The real target is transparent proxy but the IP forwarding is a prerequisite) Network setup: All devices are in the same local ...
user avatar
  • 111
0 votes
0 answers
30 views

Is it possible to change the userID of something like Fused Location Provider?

I have a bunch of apps bundled under userID on my stock rom, including Fused Location Provider. Since I'm using AFWall+ to block said userID to block said apps - it also breaks my location detection ...
user avatar
  • 79
2 votes
0 answers
117 views

How can I bypass android 9 VPN with iptables?

I'm targeting specific app with UID rule -m owner --uid-owner 1337 and I want this app always bypass VPN and use direct Wi-fi/Mobile Data connection. Ideally, I also want it to be universal, if ...
user avatar
  • 79
3 votes
1 answer
10k views

How to send all internet traffic to a SOCKS5 proxy server in local network?

I got the inspiration here. It looks like AFWall+ is able to create a NAT forwarding policy to keep all traffic going through a SOCKS5 proxy and fool Google apps into thinking they are not connected ...
user avatar
0 votes
0 answers
759 views

AFWall+ not blocking consistently

I'm running a rooted pixel 3 (Magisk) with the "liboemcrypt disabler" module for running Netflix, Magisk Hide and the dg.db edit to disable attestation for running Google Pay. The firewall will work ...
user avatar
  • 11
2 votes
1 answer
1k views

Restricting an app to only send internet traffic but not receive that back?

Is there a way or app to restrict some apps on my Android, or the whole device, to only send internet data packets but not receive them back? I want to confuse a game app by doing this. It restricts ...
user avatar
1 vote
0 answers
162 views

Cannot connect to Wifi iptables error

Lately my Google Pixel 2 will not connect to my Homewifi. It tries to connect all the time. Looking into the Log I get an iptables error: 05-06 10:03:56.253 1120-1355/? D/RecurrenceRule: Resolving ...
user avatar
  • 11
2 votes
1 answer
1k views

Android DHCP Port Redirection

I am working on a MirrorLink implementation for the Google Pixel (Android 8.1.0). I must implement a DHCP server; however, Android applications cannot listen on reserved ports. The Android ...
user avatar
1 vote
0 answers
367 views

How to keep iptables changes on android after reboot?

If I do any changes to iptables on Android (my phone is running CyanogenMod 11 - Android 4.4.3), then these changes are lost after phone reboot. What should I do to keep them saved?
user avatar
  • 263
1 vote
0 answers
795 views

Where should I place iptables update on Android at boot time?

I need to write specific values in the routing system using the iptables command for Android. The overall idea is that the user can navigate only using the provided DNS configuration. I've tried to ...
user avatar
1 vote
0 answers
452 views

Android VPN service's policy based routing relative to iptables (specific behavior question, android 5.0, 5.1)

Background: Several phones, different firmwares Elephone p7000, Android 5.0 based rom Xiaomi redmi note 2, three different roms (5.1 based Cyaonogen, 5.0 based AOSP derivative) Rooted. Installed a ...
user avatar
  • 11
1 vote
0 answers
1k views

Configuring Android to IP FORWARDING

Android version : Lollipop. Rooted: Yes. I'm trying to connect a PC to a Laptop via a WLAN. I'm using my android as a WifiAdapter. I connected the android node to the WLAN. With a USB cable ...
user avatar
  • 111
1 vote
0 answers
550 views

reverse tethering - offline for some applications

I try to get internet on my phone from my computer without instlling any tools. My configuration looks like : mybox -----(Ethernet)------[my computer]------(USB)-----[the phone] I enabled usb ...
user avatar
2 votes
0 answers
1k views

How to Reverse Usb Tethering with VPN [tun0 interface] routing?

I have a big problem and after many days I can't find any solution because I'm not Linux experienced user... Problem: I'm using USB [Reverse] Tether (Windows share internet with android phone via USB ...
user avatar
1 vote
1 answer
347 views

Forward tethered device?

Alright, so I have a raspberry pi (192.168.42.53 on rndis0) that is tethered to an android tablet to access the internet. The tablet is connected to my home LAN via WiFi (on wlan0). How do I forward ...
user avatar
2 votes
1 answer
6k views

How to enable Android Ip forwarding

In linux we can, # echo 1 > /proc/sys/net/ipv4/ip_forward or, # sysctl -w net.ipv4.ip_forward=1 There is no sysctl command nor /proc/sys/net/ipv4/ip_forward file in Android. Is there an ...
user avatar
  • 21
1 vote
2 answers
2k views

App that survives a factory reset

My problem is theoretical at this moment. I am investigating if it is possible or not, before spending hours on it. I have a rooted phone. I want to add an entry to the IPTABLES on startup. If the ...
user avatar
  • 113
3 votes
1 answer
13k views

How can I add iptables rules that persist across reboots?

I want to add an iptables rule on my Android phone. I used: iptables -t nat -A PREROUTING -p 6 -d 192.168.66.1 --dport 80 -j DNAT --to 192.168.66.1:808 ...as root. This rule can be checked in adb ...
user avatar
  • 131
2 votes
2 answers
13k views

DNAT iptables rule on rooted Android phone?

How i can set iptables rule like this on my rooted Android phone: iptables -t nat -A PREROUTING -i wlan0 -s 192.168.1.100 -p tcp --dport 80 -j DNAT -–to-destination 192.168.1.101:8080 ... since ...
user avatar
0 votes
1 answer
426 views

How can I debug Droidwall blocking every app?

Starting some time ago, I have noticed that when Droidwall (1.5.7) is enabled, no apps can access wifi. Although the app is checked, it doesn't work, until I turn the firewall completely off. This ...
user avatar
  • 555