Questions tagged [iptables]
35 questions
4
votes
2 answers
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 via a VPN (Google apps implement additional…
Aero Windwalker
- 1,124
- 8
- 16
- 27
3
votes
1 answer
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 shell, and I can see that it was added:
# iptables…
mmm2006
- 131
- 1
- 1
- 5
3
votes
2 answers
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-owner 10195 -d 203.205.255.78/23 -j REJECT'
All…
user363569
2
votes
2 answers
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 Android iptables implementation doesn't support…
programings
- 143
- 1
- 1
- 6
2
votes
0 answers
Why is the 'iptables' target 'NFLOG" not sending log messages to the Kernel?
I recently started using an old cell phone, Samsung Galaxy J7 model SM-J700M. I rooted it, flashed LineageOS and installed a SIM card and it works just fine. I decided to work on a script with iptables rules, run it and noticed there are a few…
Joel Vázquez
- 21
- 2
2
votes
0 answers
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 router to point all internet-bound traffic at the…
Oenotria
- 121
- 3
2
votes
0 answers
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 below error.
iptables-restore v1.8.4 (legacy): quota2:…
DarkKnight
- 121
- 1
2
votes
0 answers
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 possible, because I might switch the VPN app I use…
Kirikan
- 79
- 1
- 8
2
votes
1 answer
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 me to have only two games simultaneously. But I…
Behroozfar
- 133
- 6
2
votes
1 answer
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 application is listening for DHCP DISCOVERY broadcasts on…
Chris Hutchinson
- 121
- 4
2
votes
0 answers
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 cable) everything working ok (dns, HTTP browser,…
hamedsbt
- 21
- 3
2
votes
1 answer
How to enable IP forwarding in Android?
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 equivalent operation in Android?
ibrahim
- 21
- 1
- 2
1
vote
2 answers
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 phone is factory reset, I still want the entry to…
Magnus
- 113
- 3
1
vote
0 answers
Opening iptables for initial Android setup blocks connectivity
I installed an AOSP Android 12 based ROM with root. I set up a simple custom stateful iptables firewall to block all connectivity except for a browser. I connect to WiFi and there is no internet. This setup does work after some initial network…
user145453
- 131
- 5
1
vote
0 answers
Route mobile hotspot traffic through VPN on a rooted device
I'm running an unlocked and rooted Samsung Galaxy Note 20 Ultra 5G (SM-N986U1) with an Android 12 custom ROM on the most recent security patch. The goal is that any devices that connect to my mobile hotspot have access to machines on my home…
Alexander Turro
- 11
- 2