Thank you dazo for some explanation, 'cause I didn't knew where to use export LD_LIBRARY_PATH.
As for iproute2 - there is an option to give in config file indicating what command to use for routing.
That's a compile-time option. So if compiled with iproute2, it depends on /sbin/ip. If not compiled with this, it depends on /sbin/ifconfig and /sbin/route.
How about option --iproute?
For now I made something to work and its connecting to the OpenVPN server. For this I got my fingers on coLinux - a simple low-level emulator for linux machines on windows. And attached preinstalled minimal Debian linux, dowloaded from same site as coLinux.
After powering up, I didn't get any flavors and utilities. Just command line. So, for Debian, I've vizited the packages pages of Debian, and downloaded openvpn_2.2-RC2-debian0_i386, and needed libs. In windows I extraxted data.tar and copyied on my local http server, from where I wget on linux. Untarred and moved all files from usr/include, usr/lib, usr/sbin to /openvpn/bin. Then trying to start openvpn, there were needed two libs: libpkcs11-helper.so.1, libpkcs11-helper.so.1.0.0, liblzo2.so.2, liblzo2.so.2.0.0 (these four files I coppied to /openvpn/bin).
Then I coppied config files from working client on windows to /openvpn/config.
I created a startup script with this:
#!/bin/bash
export LD_LIBRARY_PATH=$PWD/bin
bin/openvpn --config config/client.ovpn
Which I saved in /openvpn.
And client.ovpn has:
client
dev tun
proto udp
remote x
nobind
;user nobody
;group nobody
persist-key
persist-tun
ca config/ca.crt
cert config/mimiko.crt
key config/mimiko.key
ns-cert-type server
comp-lzo
;log openvpn.log
log-append log/openvpn.log
verb 2
keepalive 10 120
route-delay 20 20
First time I started the openvpn normally - tap driver was installed and configured. After that, It's starting and stays until I break it. In log except some warning related to linux, shows everything normal. I couldn ping anything, because command line was not available when starting openvpn.
Now, to make some tweaking. On windows in registry are placed the directory of config files. When openvpn service is started, it cds to that directory and starts all *.ovpn files creating different listeners. Well, when finding how to indicate lib files directiry, how to indicate where to find additional files of openvpn from bin directory, like openvpn-down-root.so, openvpn-plugin.h, openvpn-auth-pam.so. Or this file is automaticcaly used from directory where main openvpn binary resides? As for config files, I saw in init.d that script itself starts a deamon for every config, insteed letting openvpn manage this.
Also would like to use in config file direcotory variables. For example:
conf_dir=config, log_dir=log
ca conf_dir/ca.crt
cert conf_dir/mimiko.crt
key conf_dir/mimiko.key
ns-cert-type server
comp-lzo
;log openvpn.log
log-append log_dir/openvpn.log
So this variables could be set in start up script before and used by openvpn when reading config file. Or indicating as a command line.
Also, OpenVPN didn't asked for ssl library, why?
First time when openvpn is started I saw a tap install and configure. How to unconfigure and uninstall everything that openvpn did. So I would see that thig again.