Timeline for How to exclude a specific destination IP from VPN?
Current License: CC BY-SA 4.0
19 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 3, 2021 at 5:28 | vote | accept | poqdavid | ||
Oct 2, 2021 at 15:07 | history | edited | Irfan Latif | CC BY-SA 4.0 |
deleted 8660 characters in body; edited title
|
Oct 2, 2021 at 14:59 | answer | added | Irfan Latif | timeline score: 1 | |
Oct 2, 2021 at 7:56 | history | edited | poqdavid | CC BY-SA 4.0 |
Added iptable rules
|
Sep 27, 2021 at 16:02 | comment | added | poqdavid | @IrfanLatif XD ok here got it gist.github.com/poqdavid/… | |
Sep 27, 2021 at 15:29 | comment | added | Irfan Latif |
Poor toybox. cat /proc/net/ip_tables_names | while read t; do echo $t; iptables -t $t -S; done
|
|
Sep 27, 2021 at 15:02 | comment | added | poqdavid |
@IrfanLatif when i run that it gives me an error saying xargs: unknown option 'i' gist.github.com/poqdavid/…
|
|
Sep 27, 2021 at 14:27 | comment | added | Irfan Latif |
Please share your iptables rules: cat /proc/net/ip_tables_names | xargs -I {} iptables -t '{}' -S
|
|
Sep 27, 2021 at 8:19 | comment | added | poqdavid | @IrfanLatif Ok that command works actually without killing my entire connection I tested this with TeamSpeak and it's actually reporting my IP I personally never used ip or iptables command can you like add this whole thing as an answer with the rule for incoming packets and the iptables MASQUERADE (NAT) I would really appreciate it | |
Sep 27, 2021 at 7:10 | comment | added | Irfan Latif |
Note that this routes only outgoing packets. You need to add another rule in the same way for returned traffic. And also make sure that MASQUERADE (NAT) rules are properly added (using iptables ).
|
|
Sep 27, 2021 at 5:16 | comment | added | Irfan Latif |
ip ru add iif wlan0 lookup 9999 pri 9999; ip r add 1.2.3.4 dev rmnet_data1 table 9999 . Replace 1.2.3.4 with your required destination IP. Not tested. You might need to change RPDB priority (so that your rule is the first) and table number. Check /data/misc/net/rt_tables for reserved table numbers which you should not use.
|
|
Sep 25, 2021 at 21:43 | comment | added | poqdavid | @IrfanLatif here is the output of that command gist.github.com/poqdavid/a1325693f46e2c4fa399dcb2c2cba972 | |
Sep 25, 2021 at 20:16 | comment | added | Irfan Latif |
ip -4 ru | grep -vE 'unreachable[ ]*$|local[ ]*$'; ip -4 r s t all | grep -vE '^unreachable |^local |^broadcast '
|
|
Sep 25, 2021 at 17:08 | comment | added | poqdavid | @IrfanLatif Just edited the question and added the table but is that the right one? | |
Sep 25, 2021 at 17:06 | history | edited | poqdavid | CC BY-SA 4.0 |
added route table
|
Sep 25, 2021 at 15:48 | comment | added | Irfan Latif | Got it. Note that whenever you enable or disable a VPN on Android device, routing table is recreated. There can be a score of rules added to the routing table when VPN is enabled, since it does filtering based on UIDs and Socket Marks. So you need to share the whole routing table (rules and routes) here in order to get a practical suggestion. | |
Sep 25, 2021 at 15:14 | comment | added | poqdavid | @IrfanLatif I use my phone as a hotspot and also with the help of an app called VPN Hotspot I share the VPN with my PC but I want to exclude a specific IP address from VPN but routing from the OpenVPN client didn't work so I was thinking how I can just route it with ip route add command | |
Sep 25, 2021 at 14:47 | comment | added | Irfan Latif |
Not clear what you are asking. Is your device a WiFi AP? In that case every packet that appears on WiFi interface (wlan0 ) is already routed to Mobile Data interface (rmnet_data ). Here's how you can do it manually: android.stackexchange.com/a/217896/218526. Or if it's the opposite case i.e. route everything coming on Mobile Data to WiFi interface, here's the detailed explanation: android.stackexchange.com/a/218562/218526
|
|
Sep 25, 2021 at 13:35 | history | asked | poqdavid | CC BY-SA 4.0 |