veer0001 / android-openvpn-settings

Automatically exported from code.google.com/p/android-openvpn-settings
GNU General Public License v3.0
0 stars 0 forks source link

HTC Flyer (Android 2.3.4) "ip ru del table gprs" will not exectuted per "Fix HTC Routes" #88

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Rooted HTC Flyer with FlyHigh v1.2
2. Install OpenVPN Settings
3. Run the VPN, connect, no ping through VPN

What is the expected output? What do you see instead?
Expected: Full traffic through VPN
Instead: No traffic through VPN, not even a little ping packet

What version of the product are you using?
OpenVPN 2.1_rc15
OpenVPN Settings 0.4.7
BusyBox 1.19 (in /system/xbin and linked to /system/xbin/bb)
modified iptables

Which Android phone are you using?
HTC Flyer

Which firmware version are you using?
Android 2.3.4 FW Custom ROM FlyHigh v1.2 (rooted)

Please provide any additional information below.
The tunnel establish and the routing table shows up like expected.
TAP0 device comes up with expected IP.
But no traffic and no ping passes the tunnel (only the keep alive packets, 
because the tunnel does not disconnect byself).

Server Config:
proto tcp-server
port 443
dev tap0
ping 15
ping-restart 45
comp-lzo

push "ping 15"
push "ping-restart 45"
push "route 192.168.1.0 255.255.255.0"
push "route-gateway 192.168.1.1"
push "redirect-gateway def1"
push "dhcp-option DNS 192.168.1.1"

tls-server
ca /tmp/ca.crt
dh /tmp/dh384.pem
cert /tmp/server.crt
key /tmp/server.key

Client Config:
remote little.britain.usa 443
client
proto tcp
tls-client
ca ca.crt
cert Chris.crt
key Chris.key
ifconfig 192.168.1.200 255.255.255.0
http-proxy star.trek.ds 9
http-proxy-retry
http-proxy-option AGENT HTC_Touch_HD_T8282 Mozilla/4.0 (compatible; MSIE 6.0; 
Windows CE; IEMobile 7.11)
dev tap
dev-node /dev/tun
resolv-retry infinite
persist-key
persist-tun
script-security 2
verb 3
log status.log
comp-lzo

#EOF

A part of logcat:

08:57:37.874 Debug OpenVPN-Settings-ip-route 2402  invoking external process: 
/system/xbin/su
08:57:37.874 Debug OpenVPN-Settings-ip-route 2402  invoking command line: ip ru 
del table wifi
08:57:37.874 Debug OpenVPN-Settings-ip-route 2402  invoking external process: 
/system/xbin/su
08:57:37.987 Info OpenVPN-Settings-ip-route-stdout 2402  terminated
08:57:37.987 Debug OpenVPN-Settings-ip-route 2402  invoking command line: ip ru 
del table gprs
08:57:37.988 Debug OpenVPNDaemonEnabler 2402  Received OpenVPN network state 
changed from Add Routes to Connected
08:57:37.988 Debug OpenVPN-DaemonMonitor[/sdcard/openvpn/Chris.ovpn]-mgmt 2402  
SUCCESS: bytecount interval changed
08:57:37.988 Debug OpenVPN-DaemonMonitor[/sdcard/openvpn/Chris.ovpn]-mgmt 2402  
SUCCESS: bytecount interval changed
08:57:37.988 Debug OpenVPN-DaemonMonitor[/sdcard/openvpn/Chris.ovpn]-mgmt 2402  
SUCCESS: bytecount interval changed
08:57:37.988 Debug OpenVPN-DaemonMonitor[/sdcard/openvpn/Chris.ovpn]-mgmt 2402  
up: 1.11 kBps - down: 1.03 kBps
08:57:37.988 Debug OpenVPN-Settings-ip-route-stderr 2402  Permission denied
08:57:37.988 Info OpenVPN-Settings-ip-route-stderr 2402  terminated
08:57:37.989 Debug OpenVPN-Settings-ip-route-stderr 2402  RTNETLINK answers: No 
such file or directory
08:57:37.989 Info OpenVPN-Settings-ip-route-stdout 2402  terminated
08:57:37.989 Info OpenVPN-Settings-ip-route-stderr 2402  terminated
08:57:40.712 Debug OpenVPN-DaemonMonitor[/sdcard/openvpn/Chris.ovpn]-mgmt 2402  
up: 0.04 kBps - down: 0.11 kBps

#EOF

In my opinion the "Debug OpenVPN-Settings-ip-route-stderr 2402  Permission 
denied" message is for the "ip ru del table gprs"
command. And that is correct. If I execute "ip ru del table gprs" in a terminal 
the VPN works correct...

I want to use this command in my config with "up 'ip ru del table gprs'", but 
when the gprs route does not exist (for e.g. I execute this command before) 
then I get the return value "1" (error code) and OpenVPN will close the VPN.
So I have to execute the command everytime manual in a terminal.

I have a Desire HD with the same config and the logcat don't show this error. 
The OpenVPN-, BusyBox- and iptables Version is exact the same (same MD5 hash).

Maybe someone could help me with that.
Evertime I want to execute a script in the OpenVPN config (e.g. "up 
/etc/script.sh"), I get an error that the external program could not be 
executed. The permissions are correct, it is read- and executable.
Or the VPN Settings App get updated for the Flyer :P

Many regards :)

Original issue reported on code.google.com by crusoe2...@googlemail.com on 25 Aug 2011 at 7:01

GoogleCodeExporter commented 9 years ago
Hello folks,

I've found a Solution for the Flyer Users, who use OpenVPN.

I hope the developer won't rip down my head, for scamping in his app...
I've disassebled his app and search for the part which controls the "Fix HTC 
Route" option.
I've found in 
"de.schaeuffelhut.android.openvpn-1.apk\smali\de\schaeuffelhut\android\openvpn\s
ervice" a file called "ManagementThread.smali".
Between line 2823 and 2863 you can find a "function" called ".method protected 
updateHTCRoutes()V".

There are the commands "ip ru del table wifi" and "ip ru del table gprs".
I've changed "ip ru del table wifi" to "ip route flush table 2" and reassemble 
it, uninstall the old OpenVPN-Setting and replace it with the new assebled one.
And now all is working, but after the "ip ru del table gprs" sometimes I get an 
error in the log (only if the gprs entry not exist when you execute "ip ru") , 
but that don't affect the function of the script.
But now the fix route option does not work for the WiFi users. But I don't have 
tested it yet...

I am only a little script kiddie who knows a little bit about "AutoIt", but as 
soon as I found out how this function really works, I try to find a more clean 
way to solve this issue.

Many regards :)
Chris

Original comment by crusoe2...@googlemail.com on 27 Aug 2011 at 8:56

GoogleCodeExporter commented 9 years ago
Confirmed, 3G is not working on HTC flyer.

Original comment by hrvoje.m...@gmail.com on 27 Aug 2011 at 4:19

GoogleCodeExporter commented 9 years ago
But now it does :P
As I say, maybe I will try to fix it for the Flyer and then I will post it here.
And of the developer don't agree with this, he can send me a mail (if he is 
still alive :P)

Many regards
Chris :)

Original comment by crusoe2...@googlemail.com on 27 Aug 2011 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by friedrich.schaeuffelhut on 29 Dec 2011 at 12:38

GoogleCodeExporter commented 9 years ago
Issue 35 has been merged into this issue.

Original comment by friedrich.schaeuffelhut on 31 Dec 2011 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by friedrich.schaeuffelhut on 31 Dec 2011 at 12:11

GoogleCodeExporter commented 9 years ago

Original comment by friedrich.schaeuffelhut on 3 Jan 2012 at 8:31

GoogleCodeExporter commented 9 years ago

Original comment by friedrich.schaeuffelhut on 17 Jan 2012 at 10:27

GoogleCodeExporter commented 9 years ago
Issue 65 has been merged into this issue.

Original comment by friedrich.schaeuffelhut on 27 Jan 2012 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by friedrich.schaeuffelhut on 28 Jan 2012 at 2:59

GoogleCodeExporter commented 9 years ago
gsoheb@gmail.com

Original comment by gso...@gmail.com on 14 Jun 2014 at 9:53