VPN route exclusion for KITKAT for Android

It is known that excluding IP traffic is nearly impossible with the Android VPN API on a NON ROOTED device.

But I have a rooted device. So I connect VPN (openvpn) first. After from ADB ROOT SHELL - run the following command

./route add -net <> netmask 255.255.255.255 gw 192.168.1.1

For example, if I run the following command

./route add -net 141.101.120.15 netmask 255.255.255.255 gw 192.168.1.1

All traffic to whoismyip [DOT] com goes directly (does not go through the VPN) Hence whatismyip.com reports my local ISP IP address on its home page.

This way I could exclude the IPs from the VPN path. This works great in ICS and Jelly without any problem.

But the same procedure does not work in KITKAT. I tested in both 4.4.2 and 4.4.4

If I change the route, the traffic still goes through the VPN path. Whatismyip.com, which displays the IP address of the VPN server on its home page.

My KITKAT routing table shows the following results: ICS and jelly. The command succeeds in the routing table. But it just doesn't work.

Can anyone please point out what changes I need to make to the KITKAT.

**Fresh Routing Table**



ip route
default via 192.168.1.1 dev wlan0
default via 192.168.1.1 dev wlan0  metric 324
192.168.1.0/24 dev wlan0  scope link
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.2  metric 324

192.168.1.1 dev wlan0  scope link


 **After VPN Connected**


ip route
default via 192.168.1.1 dev wlan0
default via 192.168.1.1 dev wlan0  metric 324
172.22.1.4/30 dev tun0  proto kernel  scope link  src 172.22.1.6
192.168.1.0/24 dev wlan0  scope link
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.2  metric 324

192.168.1.1 dev wlan0  scope link



**After whatismyip.com [141.101.120.15]  exclusion**



ip route
default via 192.168.1.1 dev wlan0
default via 192.168.1.1 dev wlan0  metric 324

**141.101.120.15 via 192.168.1.1 dev wlan0**

172.22.1.4/30 dev tun1  proto kernel  scope link  src 172.22.1.6
192.168.1.0/24 dev wlan0  scope link
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.2  metric 324
192.168.1.1 dev wlan0  scope link

      

thank

+3


source to share





All Articles