4 September 2007

Compile OpenVPN and TUN under Solaris

I've recently worked on Solaris and need to compile the source code of openVPN and TUN.
At first, it seemed easy but because of some compatibility issues, it was not.
You can follow those steps to get openvpn executable under Solaris:
- download the openVPN source code and uncompress it under [OPENVPN_DIRECTORY],
- download the TUN source code and uncompress it under [TUNE_DIRECTORY],
- copy the [TUNE_DIRECTORY]/solaris/if_tun.h file to [OPENVPN_DIRECTORY],
- edit the [OPENVPN_DIRECTORY]/tun.c file and add the #include "if_tun.h" line after the #include "tun.h" one,
- under [OPENVPN_DIRECTORY], execute ./configure --disable-lzo,
- ensure there is a make executable into your path, for instance create a symbolic link executing ln -s /usr/sfw/bin/gmake /usr/bin/make,
- then execute make under [OPENVPN_DIRECTORY],
- finally the openvpn executable is ready for Solaris.

Then, you can follow those steps to get the tun functionality under Solaris:
- create the subdirectory [TUNE_DIRECTORY] /solaris/sys,
- download the dditypes.h file and put it under [TUNE_DIRECTORY] /solaris/sys (it fixes an incompatibility issue),
- ensure there is a ld executable into your path, for instance create a symbolic link executing ln -s /usr/sfw/bin/gld /usr/bin/ld,
- execute make install under [TUNE_DIRECTORY],
- finally the tun functionality is ready for Solaris.

It is now possible to use openVPN and TUN under Solaris.

3 comments:

  1. A different recipe that doesn't involve disabling LZO.

    ReplyDelete
  2. Public hotspots are free and not secure. By connecting to the vpnservice, you assure that the data you transmit will be secure between your wifi computer and the Internet.

    ReplyDelete
  3. Thanks for the LZO link.
    Anyway, there is a problem with path (for install, and ar tools).

    To fix it, it is enough to add corresponding path to environment variable PATH (before executing configure, make and make install):
    export PATH=/usr/ucb/:/usr/ccs/bin:$PATH

    ReplyDelete

Thank you for your visit, let's share your point of view: