kiah2008 / android-openvpn-installer

Automatically exported from code.google.com/p/android-openvpn-installer
0 stars 0 forks source link

Make path to ifconfig and route configurable upon installation #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Original post from:
http://github.com/fries/android-external-openvpn/issues#issue/2

I have a problem with OpenVPN Settings and my HTC Hero / T-Mobile G2 - i
have installed the MoDaCo custom ROM 3.2.

So Busybox is integrated, but i have no /system/xbin/bb/ifconfig - if i ask
'which ifconfig' i get /system/xbin/ifconfig (which links to busybox)

if i want to start my openvpn config, after entering the password i get
this error:
FATAL: Linux ifconfig failed: could not execute external program

Can you fix this for the MoDaCo Hero users? :)

Let me know if i can help you in any way!

Original issue reported on code.google.com by friedrich.schaeuffelhut on 15 Mar 2010 at 9:57

GoogleCodeExporter commented 8 years ago
Somehow I don't feel any new versions of this will come out.

You're better off getting CyanogenMOD that has OpenVPN built-in.

Original comment by bina...@gmail.com on 5 Mar 2011 at 1:22

GoogleCodeExporter commented 8 years ago
I will probably have time to update the project by end of March.

Original comment by friedrich.schaeuffelhut on 6 Mar 2011 at 8:35

GoogleCodeExporter commented 8 years ago
On my Galaxy I9000 (Froyo) it works to 90%. After OpenVPN-Settings shows 
"Resolve"-"Wait"-"Auth"-"Get Config"-"?" it stopps with the message: "Linix 
ifconfig: Could not execute external programm". 

I´ve set the permission to full rights (rwxrwx...), I tried several tun.ko. 
Nothing helps. Has someone an idear?

Original comment by Johannes...@googlemail.com on 8 Mar 2011 at 1:29

GoogleCodeExporter commented 8 years ago
I was unable to connect until I create a "bb" link in /system/xbin
Previously I've created a /system/xbin/bb directory and placed the bb's 
"ifconfig" and "route" links there.
Once I've replaced "bb" dir with "bb" link - everything works fine!

So, the trouble is that openvpn is sticked to /system/xbin/bb, not to 
/system/xbin IMHO.

HTC Desire, ROM - MCR r26 (Android 2.3).

Original comment by andy1...@gmail.com on 18 Mar 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Hello

Phone i9000
ROM Gingerbread 2.3.4 XXJVP
Connecting ok but:
"
...
Options error: Unrecognized otption or missing parameters(s) in 
[PUSH-OPTIONS]:2 route (2.1.1)
Options error: Unrecognized otption or missing parameters(s) in 
[PUSH-OPTIONS]:6 ifconfig (2.1.1)
...
NOTE: unable to redirect default gateway -- VPN gateway parameter 
(--route-gateway or --ifconfig) is missing
...
"
Have root, busybox in /system/xbin/ (ifconfig and route works) and tun. 
I can't mkdir /system/xbin/bb in this rom (readonly in su:/) so I can't make it 
work like in comment #54.

Any news about pointing to /system/xbin ant not to /system/xbin/bb ??

Peter J.

Original comment by piotrek...@gmail.com on 8 Jul 2011 at 10:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Got this working with #43 trick on my Asus Transformer!

Original comment by agentgr...@gmail.com on 28 Jul 2011 at 8:48

GoogleCodeExporter commented 8 years ago
Got this working with #43 trick on my Glaxy Tab

Original comment by xiangf...@gmail.com on 26 Aug 2011 at 1:46

GoogleCodeExporter commented 8 years ago
My error is ifconfig:SIOCSIFADDR: permission denied 

This is probably the same problem as in comment #53 by Johannes...

My steps:
First, I did the steps in comment #43 and that helped 90%.

Then I executed openvpn using the terminal (BTEP in my case) as root:
#openvpn --config mycfg.conf
all early messages look good, including "TUN/TAP device tun0 opened"
Then the error comes:
ifconfig:SIOCSIFADDR: permission denied 
Linix ifconfig failed: external program exited with error ... (can't read the 
rest)

I'm running as root, so I don't understand the "ifconfig:SIOCSIFADDR: 
permission denied". 

Before doing steps in #43, I had the same errors as everyone else:

Options error: Unrecognized otption or missing parameters(s) in 
[PUSH-OPTIONS]:2 route (2.1.1)
Options error: Unrecognized otption or missing parameters(s) in 
[PUSH-OPTIONS]:6 ifconfig (2.1.1)

#43 fixed those for me. Now my issue is just "ifconfig:SIOCSIFADDR: permission 
denied". 

I'm on a rooted Thunderbolt with TH3ORY Gingerbread ROM. I don't want to change 
ROMS. This one is working good for all my other stuff.
Can anyone help?

Original comment by davestec...@gmail.com on 3 Sep 2011 at 3:40

GoogleCodeExporter commented 8 years ago
Replying to my own earlier comment #59
I got it working with help of two earlier comments.

1. Comment #30 by nkasarea...@gmail.com, Jul 10, 2010:
Unlike the steps in comment #43, I actually had to download the statically 
linked openvpn binary too. Without that, I was getting this error:
ifconfig: siocsifaddr permission denied

2. Comment #44 by kevin....@gmail.com, Nov 20, 2010
Except, instead of this:
    ip ru del gprs
The command that worked for me was:
    ip rule del from all lookup gprs

Next, I guess I'll try running this with gscript (or similar) so I don't have 
to enter the above command every time. Anyone know a better way?

Original comment by davestec...@gmail.com on 3 Sep 2011 at 5:06

GoogleCodeExporter commented 8 years ago
Comment #44 fixed my issue with adaptation from comment #60.

But instead of removing gprs or wifi ip rule, wouldn't it be better to add the 
routing entry via dev tun0 into the wifi or gprs table ?

Is openvpn client able to modify another table than the main table ?

Original comment by vincent....@gmail.com on 7 Nov 2011 at 10:57

GoogleCodeExporter commented 8 years ago
Yo lo sulucione instalardo nuevamente el openvpn, los binarios en /system/xbin 
y el ifconfig/route en /system/xbin/bb, despues hice un link simbolico 'ln -s 
/system/xbin /system/xbin/bb', con eso funciono. cualquier duda comente y yo 
vere los comentarios

Original comment by jimmyvaz...@gmail.com on 15 Nov 2011 at 4:04

GoogleCodeExporter commented 8 years ago
#34 fixed the problem for me as well.  OG Droid with project elite 6.5.  Is 
this ever going to get fixed?  Took hours of tinkering to get this solved.

Original comment by peabodye...@gmail.com on 15 Nov 2011 at 11:43

GoogleCodeExporter commented 8 years ago
While sollofing the instruction related to comments #30 and #43 indeed work, it 
is a lot easier to just use a different app.

The following will create the symlinks in /system/xbin/bb for you.
https://market.android.com/details?id=de.akvsoft.droid.ovpninstall

Just override if needed thr path to the BusyBox installation and ignore the 
message about the TUN/TAP module missing if you are using a Samsung device: 
usually TUN support is compiled in the kernel.

If you need a BusyBox installer, I have used this one wit success:
https://market.android.com/details?id=com.jrummy.busybox.installer

Original comment by boozez...@gmail.com on 11 Dec 2011 at 7:46

GoogleCodeExporter commented 8 years ago
This is how I resolved my issue:
- installed openvpn-static.2.1.1 to /system/xbin
- created dir /system/xbin/bb
- created symlinks route & ifconfig to /system/xbin/bb

before adding the symlink for route to /system/xbin/bb the tunnel would be up 
but was missing the route back to my network.

Original comment by triki...@gmail.com on 23 Dec 2011 at 9:55

GoogleCodeExporter commented 8 years ago
I got OpenVPN working on my SGS2 due to this thread. Thanks a lot for all the 
help.  I have put together a blog post for OpenVPN on  Samsung Galaxy S2 
http://www.yogendra.me/2012/01/02/openvpn-on-rooted-sgs2/. 

Original comment by yogendra...@gmail.com on 1 Jan 2012 at 5:11

GoogleCodeExporter commented 8 years ago
I just published a new version of the installer on the market.
Today I built a new set of openvpn binaries dropping the /system/xbin/bb path.

Androids ifconfig implementation fails to configure the tunnel device 
correctly. So you need ifconfig provided by busybox. Try a BusyBox Installer 
from the market.

The path to ifconfig is a compile time option to openvpn and can not be changed 
at runtime. The new version of the installer includes multiple binaries with 
preconfigured ifconfig locations.

The preferred way to install openvpn: 
1. put busybox at /system/xbin/busybox
2. using the installer choose openvpn preconfigured for '/system/xbin/busybox 
ifconfig'

Finally /system/xbin/bb is not needed anymore! I hope this update makes live 
easier for some of you.

Please be so kind and report if you feel the issue has been fixed for you.

Original comment by friedrich.schaeuffelhut on 7 Jan 2012 at 1:58

GoogleCodeExporter commented 8 years ago
I have followed the steps exactly mentioned in comment # 67 but still unable to 
connect to CyberGhostVPN servers on my Toshiba Thrive. Can you please help me 
in trouble shooting ?

Original comment by kingsukm...@gmail.com on 26 Jan 2012 at 3:10

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have today followed comments 30, 34 and finally 11 of this thread to 
reconfigure & troubleshoot my openvpn installation. When I finally issued the 
comment from command line the output log file is enclosed alongwith the config 
file. Please help me understand what is the error and why my installation is 
not working. The same instructions of #30 seems to have worked for all.

Command : openvpn --dev tun0 --verb 5 user.conf > openvpn.log

Original comment by kingsukm...@gmail.com on 27 Jan 2012 at 1:33

Attachments:

GoogleCodeExporter commented 8 years ago
I have yesterday used successfully the same config file given attached on my 
fedora Linux machine and connected successfully with cyberghostvpn servers. 
However, when I'm running it on android (thrive) , I'm getting the error 
message : "Unrecognized option or missing parameter(s) in test.ovpn: 1: 
client(2.1.1)". 
I have checked that my tun.ko is being loaded properly and upon lsmod I can see 
: 
tun 12536 2 -Live 0xbf043000. 
Also on subsequent ls -l /dev/tun*, it is displayed that, 
"crw-r----- vpn vpn 10,200 2012-02-04 09:21 tun" 
It seems to me that somehow the openvpn binary is failing to recognize/read my 
config file and hence I'm unable to connect with the server. Can you please 
help and let me know how I can proceed to troubleshoot further? 
My openvpn binary and busybox is located in /system/xbin and symlinks are 
created for ifconfig and route from /system/bin to /system/bin/bb. 

My config file is enclosed. Please help.

Original comment by kingsukm...@gmail.com on 6 Feb 2012 at 12:45

GoogleCodeExporter commented 8 years ago
config file used is given in my earlier post #70. Name test.ovpn

Original comment by kingsukm...@gmail.com on 6 Feb 2012 at 12:59

GoogleCodeExporter commented 8 years ago
I have today continued my trouble shooting further on Thrive with the same 
config file options as shown in my config file in the last post ( --client etc) 
but running them as command line arguments because the openvpn binary was not 
reading them from config files. Upon executing from command line the following 
options are given as not valid ones.

1.--dhcp-renew
2.--dhcp-release
3.--win-sys env

It needs to be mentioned here that as per openvpn man pages they are all valid 
command line options and in my fedora machine all of them are running without 
throwing incompatibility errors. They were also read from the config file in 
fedora as I had mentioned in my last post. This gives cause to raise my 
suspicion whether the openvpn binary we are getting via openvpn-installer app 
is perfect !

I continued with my trouble shooting by removing these three options and the 
system starts initiating the connection and comes to the message , " Enter Auth 
Username: ", which should be followed by a , "Enter Auth Password : ". But this 
password prompt is NOT coming in thrive (android) at all though it's coming in 
Fedora(Linux). After entering username in thrive, the sytem goes on assuming it 
as the username and password as 'blank' (which I have verified by intentionally 
proving my password as blank in Fedora) which results into a AUTH_FAILURE 
message slightly later. I have tried to input the user name and password 
through text file (in 2 lines) also e,g. --auth-user-pass mypass.txt still 
receiving AUTH_FAILURE message. Then I had decided to log the output in a file 
for review by other experts which is enclosed.

Now, my conclusion as of this point is that the openvpn binary may be 
DEFECTIVE....see the excerpt from the man page..

--auth-user-pass [up] Authenticate with server using username/password. up is a 
file containing username/password on 2 lines (Note: OpenVPN will only read 
passwords from a file if it has been built with the --enable-password-save 
configure option, or on Windows by defining ENABLE_PASSWORD_SAVE in 
config-win32.h). If up is omitted, username/password will be prompted from the 
console.

Can you suggest how to compile a new one for Thrive (Android 3.2.1, my system 
details are available in my auto signature below) from the source files 
maintained at openvpn download site, 
http://openvpn.net/index.php/open-source/downloads.html.

My Thrive System :
Rooted, Dalenet-Thrive-HTK55D.31.5.0002-OOM_Rooted_ROM
Kernel version: 2.6.36.3-00020-g3d351b6

Original comment by kingsukm...@gmail.com on 8 Feb 2012 at 3:25

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

my OpenVPN client can connect to my server, but I can't redirect all traffic to 
VPN because ROUTE command ends with errors.

My goal is to use Skype via VPN between my phone and my router, with no extra 
bill (my carrier allows me 1Gb/month but no VoIP).

My configuration is:

OpenVPN client on Desire HD with MIUI 2.3.9 (Android 2.3.7 Gingerbread derived 
from CyanoGenMod). This ROM includes busybox 1.19.4-cm7 (2012-02-04) and 
OpenVPN 2.1.4 and  /system is read-only. (OpenVPN Installer and BusyBox 
installer don't work, I'd use adb, but it's not necessary). I use OpenVPN 
Settings.

OpenVPN server 2.1.1 on my router NetGear DG834Gv4 (and his brother DGN2000) 
with fantastic DGTeam firmware V5.01.16 - DGTeam Rev. 1018 - 
http://dgteam.ilbello.com
It allows autenthication only by static (preshared) key.

This is an extract from OpenVPN log:

Mon Mar 12 00:24:29 2012 Peer Connection Initiated with MY_ROUTER_IP:1194
Mon Mar 12 00:24:39 2012 /system/xbin/route add -net MY_ROUTER_IP netmask 
255.255.255.255 gw MY_CARRIER_GW
Mon Mar 12 00:24:39 2012 /system/xbin/route add -net 0.0.0.0 netmask 128.0.0.0 
gw MY_ROUTER_IP
Mon Mar 12 00:24:39 2012 ERROR: Linux route add command failed: external 
program exited with error status: 1
Mon Mar 12 00:24:39 2012 /system/xbin/route add -net 128.0.0.0 netmask 
128.0.0.0 gw MY_ROUTER_IP
Mon Mar 12 00:24:39 2012 ERROR: Linux route add command failed: external 
program exited with error status: 1
Mon Mar 12 00:24:39 2012 MANAGEMENT: >STATE:1331508279,ADD_ROUTES,,,
Mon Mar 12 00:24:39 2012 /system/xbin/route add -net 192.168.0.0 netmask 
255.255.255.0 gw MY_ROUTER_IP
Mon Mar 12 00:24:39 2012 ERROR: Linux route add command failed: external 
program exited with error status: 1
Mon Mar 12 00:24:39 2012 Initialization Sequence Completed

Finally, I think busybox ROUTE command has some bugs.
All works if I use "ip route add" from terminal console, after VPN connection.

This page supports my opinion 
http://zecke.blogspot.com/2010/06/adding-route-with-androids-route.html 

Lastly (and important for me) OpenVPN 2.2.2 changelog reports bugfixes in route 
and default gateway management.

I hope in OpenVPN and busybox bugfix update or a new OpenVPN version using "ip 
route" instead of "ROUTE".

Thank you
McSty

Original comment by matteo.c...@gmail.com on 12 Mar 2012 at 9:26

GoogleCodeExporter commented 8 years ago
Motorola razr. ifconfig ok, openvpn installed ok, conf file ok,

1-When gui execute  /system/bin/ifconfig tun0...
Linux ifconfig failed: External Program ...

2-Then i try to create a tun0, because tun exists, and ifconfig no problem.with 
it.
(also module is up)
Well, i do:
./openvpn -mkdev --dev tun0 
Succefull, persisten mode on, and i can manage the interface without problem.
3- Execute again openvpn-gui buttttt
now execute  /system/bin/ifconfig tun1 <----!!!!
4-Then go to step 2, (create tun1) 
5-Execute again openvpn-gui buttttt
now execute  /system/bin/ifconfig tun2 <----!!!!
(for ever loop)

I cant manage the tun device in gui???, because, if i do -rmdev for all tun 
devs they askme for tun0!..if i create that, they ask me for tun1!!!.

Please help.

I Get some problem with 

Original comment by javieruro@gmail.com on 1 Jun 2012 at 6:41

GoogleCodeExporter commented 8 years ago
問NUC950BSP    linux-2.6.35.4 網路部分的問題
#ifconfig eth0 up
顯示  linux ifconfig:SIOCSIFFLAGS:Cannot assign requested address
#ping 192.168.240.128
顯示 ping:sendto:Network is unreachable
#ifconfig eth0 hw ether 08:90:90:90:90:90
顯示 ifconfig: bad address ‘hw’

Original comment by 49828...@stust.edu.tw on 23 May 2013 at 2:26

GoogleCodeExporter commented 8 years ago
would it be possible to compile somewhat more recent version than 2.1.1 that is 
~2 years old, please?

thanks in advance

Original comment by martin.k...@cnl.sk on 26 Jan 2014 at 10:21

GoogleCodeExporter commented 8 years ago
Dears,
this is an urgent ..
I am trying to change my smart phone mac address 
Samsung Galaxy Win  GT-I8552

failed attempted :

1) 
Command line on the terminal apk
Result :
Ip either dev is duplicate or type is garbage..

2)
Using mac address goust
Result:
Initialized....
But when iconnect to wifi .. and check my mac address from 
Wirliess network watcher
I see my orginal mac
Also in setting...

3)
using mac spoof
Result:
Initialized....
But when iconnect to wifi .. and check my mac address from 
Wirliess network watcher
I see my orginal mac
Also in setting...

Kindly advice ..

mdoudah@istnetworks.com

Original comment by mdou...@istnetworks.com on 24 Dec 2014 at 3:53