Closed GoogleCodeExporter closed 9 years ago
Please don't jump to conclusion from ip route output. Android 4.4 does policy
based routing. See also the last FAQ.
Original comment by arne@rfc2549.org
on 24 Nov 2014 at 9:28
Thanks arne, you are right! At least in part. The remote LAN route is there,
using policy:
ip rule show
0: from all lookup local
100: from all fwmark 0x3c lookup 60
32766: from all lookup main
32767: from all lookup default
infact there is a routing table #60 which goes through the VPN:
ip route show table 60
default dev tun0 scope link
and remote private traffic is marked with iptables mangle:
iptables -L -t mangle
...
MARK all -- anywhere 192.168.3.0/24 MARK set 0x3c
...
The problem remains with the first entry in the "main" routing table:
ip route show table main
0.0.0.0/1 dev tun0 scope link
default via 10.0.1.252 dev wlan0
10.0.1.0/24 dev wlan0 scope link
10.0.1.0/24 dev wlan0 proto kernel scope link src 10.0.1.205 metric 315
10.0.1.252 dev wlan0 scope link
128.0.0.0/1 dev tun0 scope link
where 0.0.0.0/1 (as far as I can understand) matches any traffic, so that
everything is routed into the VPN, which I don't want...
Original comment by niccolo....@gmail.com
on 24 Nov 2014 at 10:14
Well. The output you quoted from the the app (VpnService routes installed:
192.168.3.0/24) are the only routes that the app is telling Android to install.
Anything beyond that is Android. In your case this seem to be buggy :(
Original comment by arne@rfc2549.org
on 24 Nov 2014 at 2:02
Big headache!
In order to let internet traffic go through standard WiFi, I had to fiddle with
ip route and iptables mangle table:
ip route del 0.0.0.0/1 dev tun0
ip route del 128.0.0.0/1 dev tun0
iptables -t mangle -A st_mangle_EXEMPT ! -d 192.168.3.0/24 -j ACCEPT
It works, but it remains a problem with name resolution traffic: using nslookup
it is routed via WiFi as expected, e.g. "nslookup www.google.com" works well.
Using ping instead (or the browser, or any other app) it hangs forever because
DNS query goes through the VPN (seen with tcpdump), and that traffic is blocked
by remote firewall rules.
Why nslookup and ping uses different source address for name resolution? I
don't see any ip route or iptables policy!
Original comment by niccolo....@gmail.com
on 24 Nov 2014 at 3:56
Finally I found a workaround for my problem, it needs a rooted device.
I just added a script /data/local/bin/openvpn-route-fix
#!/system/bin/sh
/system/xbin/su -c '/system/bin/ip route del 0.0.0.0/1 dev tun0'
/system/xbin/su -c '/system/bin/ip route del 128.0.0.0/1 dev tun0'
Set the script permissions to 755, then add two advanced custom options to the
OpenVPN configuration:
script-security 2
up /data/local/bin/openvpn-route-fix
You need a super user permission management app, like SuperSU, and you have to
grant root permission to the OpenVPN for Android application.
Original comment by niccolo....@gmail.com
on 28 Dec 2014 at 2:07
I am closing this bug as an ROM specific bug
Original comment by arne@rfc2549.org
on 9 Jan 2015 at 1:38
Original issue reported on code.google.com by
niccolo....@gmail.com
on 24 Nov 2014 at 9:24