Openvpn

Search This thread

rweb

Senior Member
Mar 21, 2008
99
9
One of the top reasons I wished root was openvpn. Anybody knows about working binary and TUN/TAP driver for D3? If yes, it could save me time, if not I'll build it over the weekend. TIA.
 

leobg

Senior Member
Mar 7, 2006
1,366
138
Since the sources are available, we just need somebody bright enough to compile the module against those sources. I am sure it is coming shortly. That's the sole reason I would use root too.
 

Darksurf

Senior Member
Mar 15, 2010
213
11
Even if you built the driver using the moto source code, I don't know if you could inject the driver into the kernel area anyway. I'm pretty new to Moto Android, but doesn't the locked bootloader prevent tampering with the kernel?
 

rweb

Senior Member
Mar 21, 2008
99
9
You only need to be root to load kernel modules. It's not a new kernel.
 

Darksurf

Senior Member
Mar 15, 2010
213
11
I see, so you plan on loading the module manually every time? what a pain. I guess its a small cost compared to the alternative.
 

neonerz

Member
Mar 8, 2010
27
2
If you use OpenVPN Settings, it will load the kernel module for you.

I must say though, Motorola did a good job expanding on Android's VPN support. I was able to connect to my IPSEC VPN, stock, unlike every other Android phone I've had.
 

limaxray

Senior Member
Aug 8, 2008
64
11
It looks like the tun driver is built into the stock kernel. I built the kernel from Moto's source and in its .config, tun is set to be compiled in the kernel.

So to verify this, I installed the openvpn binaries using OpenVPN Installer from the market and tried giving it a whirl. It connected and created a tun device, but failed on running ifconfig and route. Not sure where its pulling these bins from, but links in both bin and xbin point to busybox.

I can configure tun0 and the routing table manually and successfully pass traffic through the tunnel. This isn't ideal, so I'd like to find out why openvpn is unable to use these tools. Any ideas?
 
  • Like
Reactions: rweb

rweb

Senior Member
Mar 21, 2008
99
9
First thanks, you are right, tun/tap is built-in. I wouldn't have expected this.
Second, could you please point me to .config? I must be blind, I cannot find it.

I see the strange behaviour as you. However it doesnt't bother me much, because I write a start script anyway.
I can only imagine there is something wrong with the binary of OpenVPN Installer. I found a hint to this:
http://code.google.com/p/android-openvpn-installer/issues/detail?id=2
However I tried the workaround with the symlink to /system/xbin/bb, it didn't work neither.
 

limaxray

Senior Member
Aug 8, 2008
64
11
It is surprising to see tun built in - I wonder if they were considering adding OpenVPN support out of the box.

You're probably right that there's something wrong with the OpenVPN Installer binaries. I made a script in GScript for the time being, but prefer using OpenVPN Settings.

.config is nowhere to be found, but it is generated when the Moto kernel source is built. Now I'm assuming this is the same config used on the prod device, but that's a pretty big assumption.

Anyway, see attached. It sure is odd I can't attach a gzipped tarball on a forum focused on Linux development.
 

Attachments

  • config.zip
    16.8 KB · Views: 35
  • Like
Reactions: rweb

calash

Senior Member
Jan 30, 2008
508
84
Anybody try the root version of Cisco AnyConnect? It is the only client I know that works with my work VPN. From what I can tell all it needs is root and tun built into the kernel.
 

limaxray

Senior Member
Aug 8, 2008
64
11
Anybody try the root version of Cisco AnyConnect? It is the only client I know that works with my work VPN. From what I can tell all it needs is root and tun built into the kernel.

I don't know if anyone has tried this yet, but you can always be the first! We have both root and tun, so if that's all you need it should work.
 

leobg

Senior Member
Mar 7, 2006
1,366
138
I am too surprised to see tun/tap built-in (I didn't even bother checking in source!)

I wonder if they have done this because of the IPsec VPN device supports. But on D2 global where similar client was present, they were using different module (not the standard tun/tap device). Maybe D3's VPN client was altered to use the tun/tap module instead?
 

zone117x

Member
Jun 7, 2010
8
0
Is anyone else able to have OpenVPN connect just fine, yet no traffic going through the VPN?


Here is the output when OpenVPN is connected:

Code:
C:\Users\Matt\Desktop>"C:\Program Files (x86)\Android\android-sdk-windows\platform-tools\adb.exe" shell
shell@cdma_solana:/$ ip route
ip route
10.10.0.5 dev tun0  proto kernel  scope link  src 10.10.0.6
98.145.116.191 via 66.174.201.132 dev ppp0
66.174.201.132 dev ppp0  scope link
66.174.201.132 dev ppp0  proto kernel  scope link  src 10.228.114.160
default via 66.174.201.132 dev ppp0
shell@cdma_solana:/$ ip addr
ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 8e:cd:9b:8e:73:75 brd ff:ff:ff:ff:ff:ff
3: gether0: <BROADCAST,MULTICAST> mtu 1428 qdisc noop state DOWN qlen 1000
    link/ether 5e:bf:ba:15:68:12 brd ff:ff:ff:ff:ff:ff
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
    link/sit 0.0.0.0 brd 0.0.0.0
5: ip6tnl0: <NOARP> mtu 1460 qdisc noop state DOWN
    link/tunnel6 :: brd ::
6: tun: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
    link/ether 56:65:b5:b7:5c:98 brd ff:ff:ff:ff:ff:ff
10: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp
    inet 10.228.114.160 peer 66.174.201.132/32 scope global ppp0
12: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
    link/[65534]
    inet 10.10.0.6 peer 10.10.0.5/32 scope global tun0
shell@cdma_solana:/$

My OpenVPN server IP is 98.145.116.191, yet when I go to whatismyip.com on my phone it is still 174.255.162.200.

Here is my OpenVPN server config
Code:
port 5555
dev tun
proto tcp
comp-lzo
float
keepalive 10 60
ping-timer-rem
resolv-retry 60
status openvpn-status.txt
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.10.0.0 255.255.255.0
verb 4
mode server
push "redirect-gateway def1"


My client config
Code:
client
remote zone117x.dyndns.info 5555
proto tcp
comp-lzo
dev tun
float
ping-timer-rem
resolv-retry infinite
route-gateway 10.10.0.1
dhcp-option DNS 10.10.0.1
keepalive 10 120
ca ca.crt
cert client1.crt
key client1.key
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    It looks like the tun driver is built into the stock kernel. I built the kernel from Moto's source and in its .config, tun is set to be compiled in the kernel.

    So to verify this, I installed the openvpn binaries using OpenVPN Installer from the market and tried giving it a whirl. It connected and created a tun device, but failed on running ifconfig and route. Not sure where its pulling these bins from, but links in both bin and xbin point to busybox.

    I can configure tun0 and the routing table manually and successfully pass traffic through the tunnel. This isn't ideal, so I'd like to find out why openvpn is unable to use these tools. Any ideas?
    1
    It is surprising to see tun built in - I wonder if they were considering adding OpenVPN support out of the box.

    You're probably right that there's something wrong with the OpenVPN Installer binaries. I made a script in GScript for the time being, but prefer using OpenVPN Settings.

    .config is nowhere to be found, but it is generated when the Moto kernel source is built. Now I'm assuming this is the same config used on the prod device, but that's a pretty big assumption.

    Anyway, see attached. It sure is odd I can't attach a gzipped tarball on a forum focused on Linux development.