adrianer / 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

No remote IP address assigned for static key OpenVPN config #53

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
* What steps will reproduce the problem?

1. My OpenVPN server & client use static secret key configuration.

.ovpn file used by client
========================
remote 124.66.142.xxx (hidden for privacy)
port 1194
dev tap
secret static.key
proto udp
comp-lzo

scripts run by my server
=========================
openvpn --mktun --dev tap0
brctl addif br0 tap0
ifconfig tap0 0.0.0.0 promisc up
/usr/sbin/openvpn --dev tap0 --secret /tmp/static.key --comp-lzo --port 1194 
--proto udp --daemon

With the configuration, OpenVPN Windows client is able to connect to the server 
can access the resource in the remote subnet. 

2. The Leedroid 2.2f (tun.ko is built into the kernel) w/ OpenVPN Settings 
0.4.7 can connect to the server. But unlike Windows, the Leedroid tap device 
does not automatically get an IP address even though I enable the "Fix HTC 
Routes" option.

=================================================
# openvpn --config /sdcard/openvpn/eclipse.ovpn
Mon Nov  8 19:24:28 2010 OpenVPN 2.1.1 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] 
built on Jul 26 2010
Mon Nov  8 19:24:28 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or 
higher to call user-defined scripts or executables
Mon Nov  8 19:24:28 2010 WARNING: file '/sdcard/openvpn/static.key' is group or 
others accessible
Mon Nov  8 19:24:28 2010 TUN/TAP device tap0 opened
Mon Nov  8 19:24:28 2010 UDPv4 link local (bound): [undef]:1194
Mon Nov  8 19:24:28 2010 UDPv4 link remote: 124.66.142.210:1194
Mon Nov  8 19:25:33 2010 Peer Connection Initiated with 124.66.142.210:1194
Mon Nov  8 19:25:33 2010 Initialization Sequence Completed

# route
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
119.234.58.88   *               255.255.255.252 U     0      0        0 rmnet0
default         119.234.58.89   0.0.0.0         UG    0      0        0 rmnet0

I found there is a "server-bridge" directive for IP configuration. But it can't 
be used together with static key but SSL/TLS key. However, I don't have a CA 
key and certificate server mode seems tricky. Is there a way to push the remote 
IP config to the Android client? Do I miss something in the .ovpn file?

* What version of the product are you using?
Leedroid 2.2f 

* Which Android phone are you using?
HTC Desire

Original issue reported on code.google.com by zachary....@gmail.com on 9 Nov 2010 at 5:49

GoogleCodeExporter commented 8 years ago
try 'netcfg tap0 dhcp' on your android phone, it will get an IP then.

Original comment by foshan...@gmail.com on 26 Feb 2011 at 2:51

GoogleCodeExporter commented 8 years ago
Is there easy way to do this? Could client.conf add 'netcfg tap0 dhcp'?

Original comment by gemma.yc...@gmail.com on 6 Jul 2011 at 9:19

GoogleCodeExporter commented 8 years ago

Original comment by friedrich.schaeuffelhut on 27 Jan 2012 at 9:18