INSTALL 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. Installation instructions for OpenVPN, a Secure Tunneling Daemon
  2. Copyright (C) 2002-2019 OpenVPN Inc. This program is free software;
  3. you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License version 2
  5. as published by the Free Software Foundation.
  6. *************************************************************************
  7. QUICK START:
  8. Unix:
  9. ./configure && make && make install
  10. *************************************************************************
  11. To download OpenVPN source code of releases, go to:
  12. https://openvpn.net/community-downloads/
  13. OpenVPN releases are also available as Debian/RPM packages:
  14. https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
  15. OpenVPN development versions can be found here:
  16. https://github.com/OpenVPN/openvpn
  17. https://gitlab.com/OpenVPN/openvpn
  18. https://sourceforge.net/p/openvpn/openvpn/ci/master/tree/
  19. They should all be in sync at any time.
  20. To download easy-rsa go to:
  21. https://github.com/OpenVPN/easy-rsa
  22. To download tap-windows (NDIS 6) driver source code go to:
  23. https://github.com/OpenVPN/tap-windows6
  24. To get the cross-compilation environment go to:
  25. https://github.com/OpenVPN/openvpn-build
  26. For step-by-step instructions with real-world examples see:
  27. https://community.openvpn.net/openvpn/wiki/GettingStartedwithOVPN
  28. https://community.openvpn.net/openvpn/wiki
  29. https://openvpn.net/community-resources/
  30. Also see the man page for more information.
  31. *************************************************************************
  32. SUPPORTED PLATFORMS:
  33. (1) Linux (kernel 2.6+)
  34. (2) Solaris
  35. (3) OpenBSD 5.1+
  36. (4) Mac OS X Darwin 10.5+
  37. (5) FreeBSD 7.4+
  38. (6) NetBSD 5.0+
  39. (7) Windows Vista or later for OpenVPN 2.4
  40. (8) Windows XP or later for OpenVPN 2.3
  41. SUPPORTED PROCESSOR ARCHITECTURES:
  42. In general, OpenVPN is word size and endian independent, so
  43. most processors should be supported. Architectures known to
  44. work include Intel x86, Alpha, Sparc, Amd64, and ARM.
  45. REQUIRES:
  46. (1) TUN and/or TAP driver to allow user-space programs to control
  47. a virtual point-to-point IP or Ethernet device. See
  48. TUN/TAP Driver Configuration section below for more info.
  49. OPTIONAL (but recommended):
  50. (1) OpenSSL library, necessary for encryption, version 0.9.8 or higher
  51. required, available from http://www.openssl.org/
  52. (2) mbed TLS library, an alternative for encryption, version 2.0 or higher
  53. required, available from https://tls.mbed.org/
  54. (3) LZO real-time compression library, required for link compression,
  55. available from http://www.oberhumer.com/opensource/lzo/
  56. OpenBSD users can use ports or packages to install lzo, but remember
  57. to add CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
  58. directives to "configure", since gcc will not find them otherwise.
  59. OPTIONAL (for developers only):
  60. (1) Autoconf 2.59 or higher + Automake 1.9 or higher
  61. -- available from http://www.gnu.org/software/software.html
  62. (2) Dmalloc library
  63. -- available from http://dmalloc.com/
  64. (3) If using t_client.sh test framework, fping/fping6 is needed
  65. -- Available from http://www.fping.org/
  66. Note: t_client.sh needs an external configured OpenVPN server.
  67. See t_client.rc-sample for more info.
  68. *************************************************************************
  69. CHECK OUT SOURCE FROM SOURCE REPOSITORY:
  70. Clone the repository:
  71. git clone https://github.com/OpenVPN/openvpn
  72. git clone https://gitlab.com/OpenVPN/openvpn
  73. git clone git://openvpn.git.sourceforge.net/gitroot/openvpn/openvpn
  74. Check out stable version:
  75. git checkout release/2.4
  76. Check out master (unstable) branch:
  77. git checkout master
  78. *************************************************************************
  79. BUILD COMMANDS FROM TARBALL:
  80. ./configure
  81. make
  82. make install
  83. *************************************************************************
  84. BUILD COMMANDS FROM SOURCE REPOSITORY CHECKOUT:
  85. autoreconf -i -v -f
  86. ./configure
  87. make
  88. make install
  89. *************************************************************************
  90. BUILD A TARBALL FROM SOURCE REPOSITORY CHECKOUT:
  91. autoreconf -i -v -f
  92. ./configure
  93. make distcheck
  94. *************************************************************************
  95. TESTS (after BUILD):
  96. make check (Run all tests below)
  97. Test Crypto:
  98. ./openvpn --genkey --secret key
  99. ./openvpn --test-crypto --secret key
  100. Test SSL/TLS negotiations (runs for 2 minutes):
  101. ./openvpn --config sample/sample-config-files/loopback-client (In one window)
  102. ./openvpn --config sample/sample-config-files/loopback-server (Simultaneously in another window)
  103. For more thorough client-server tests you can configure your own, private test
  104. environment. See tests/t_client.rc-sample for details.
  105. *************************************************************************
  106. OPTIONS for ./configure:
  107. --disable-lzo disable LZO compression support [default=yes]
  108. --disable-lz4 Disable LZ4 compression support
  109. --enable-comp-stub Don't compile compression support but still allow limited interoperability with compression-enabled peers
  110. --disable-crypto disable crypto support [default=yes]
  111. --disable-ofb-cfb disable support for OFB and CFB cipher modes
  112. [default=yes]
  113. --enable-x509-alt-username
  114. enable the --x509-username-field feature
  115. [default=no]
  116. --disable-server disable server support only (but retain client
  117. support) [default=yes]
  118. --disable-plugins disable plug-in support [default=yes]
  119. --disable-management disable management server support [default=yes]
  120. --enable-pkcs11 enable pkcs11 support [default=no]
  121. --disable-fragment disable internal fragmentation support (--fragment)
  122. [default=yes]
  123. --disable-multihome disable multi-homed UDP server support (--multihome)
  124. [default=yes]
  125. --disable-port-share disable TCP server port-share support (--port-share)
  126. [default=yes]
  127. --disable-debug disable debugging support (disable gremlin and verb
  128. 7+ messages) [default=yes]
  129. --enable-small enable smaller executable size (disable OCC, usage
  130. message, and verb 4 parm list) [default=no]
  131. --enable-iproute2 enable support for iproute2 [default=no]
  132. --disable-def-auth disable deferred authentication [default=yes]
  133. --disable-pf disable internal packet filter [default=yes]
  134. --disable-plugin-auth-pam
  135. disable auth-pam plugin [default=platform specific]
  136. --disable-plugin-down-root
  137. disable down-root plugin [default=platform specific]
  138. --enable-pam-dlopen dlopen libpam [default=no]
  139. --enable-strict enable strict compiler warnings (debugging option)
  140. [default=no]
  141. --enable-pedantic enable pedantic compiler warnings, will not generate
  142. a working executable (debugging option) [default=no]
  143. --enable-werror promote compiler warnings to errors, will cause
  144. builds to fail if the compiler issues warnings
  145. (debugging option) [default=no]
  146. --enable-strict-options enable strict options check between peers (debugging
  147. option) [default=no]
  148. --enable-selinux enable SELinux support [default=no]
  149. --enable-systemd enable systemd support [default=no]
  150. --enable-async-push enable async-push support for plugins providing
  151. deferred authentication [default=no]
  152. ENVIRONMENT for ./configure:
  153. PLUGINDIR Path of plug-in directory [default=LIBDIR/openvpn/plugins]
  154. IFCONFIG full path to ipconfig utility
  155. ROUTE full path to route utility
  156. IPROUTE full path to ip utility
  157. NETSTAT path to netstat utility
  158. MAN2HTML path to man2html utility
  159. GIT path to git utility
  160. SYSTEMD_ASK_PASSWORD
  161. path to systemd-ask-password utility
  162. SYSTEMD_UNIT_DIR
  163. Path of systemd unit directory [default=LIBDIR/systemd/system]
  164. TMPFILES_DIR
  165. Path of tmpfiles directory [default=LIBDIR/tmpfiles.d]
  166. ENVIRONMENT variables adjusting parameters related to dependencies
  167. TAP_CFLAGS C compiler flags for tap
  168. LIBPAM_CFLAGS
  169. C compiler flags for libpam
  170. LIBPAM_LIBS linker flags for libpam
  171. PKCS11_HELPER_CFLAGS
  172. C compiler flags for PKCS11_HELPER, overriding pkg-config
  173. PKCS11_HELPER_LIBS
  174. linker flags for PKCS11_HELPER, overriding pkg-config
  175. OPENSSL_CFLAGS
  176. C compiler flags for OpenSSL
  177. OPENSSL_LIBS
  178. linker flags for OpenSSL
  179. MBEDTLS_CFLAGS
  180. C compiler flags for mbedtls
  181. MBEDTLS_LIBS
  182. linker flags for mbedtls
  183. LZO_CFLAGS C compiler flags for lzo
  184. LZO_LIBS linker flags for lzo
  185. LZ4_CFLAGS C compiler flags for lz4
  186. LZ4_LIBS linker flags for lz4
  187. libsystemd_CFLAGS
  188. C compiler flags for libsystemd, overriding pkg-config
  189. libsystemd_LIBS
  190. linker flags for libsystemd, overriding pkg-config
  191. P11KIT_CFLAGS
  192. C compiler flags for P11KIT, overriding pkg-config
  193. P11KIT_LIBS linker flags for P11KIT, overriding pkg-config
  194. *************************************************************************
  195. Linux distribution packaging:
  196. Each Linux distribution has their own way of doing packaging and their
  197. own set of guidelines of how proper packaging should be done. It
  198. is therefore recommended to reach out to the Linux distributions you
  199. want to have OpenVPN packaged for directly. The OpenVPN project wants
  200. to focus more on the OpenVPN development and less on the packaging
  201. and how packaging is done in all various distributions.
  202. For more details:
  203. * Arch Linux
  204. https://www.archlinux.org/packages/?name=openvpn
  205. * Debian
  206. https://packages.debian.org/search?keywords=openvpn&searchon=names
  207. https://tracker.debian.org/pkg/openvpn
  208. * Fedora / Fedora EPEL (Red Hat Enterprise Linux/CentOS/Scientific Linux)
  209. https://apps.fedoraproject.org/packages/openvpn/overview/
  210. https://src.fedoraproject.org/rpms/openvpn
  211. * Gentoo
  212. https://packages.gentoo.org/packages/net-vpn/openvpn
  213. https://gitweb.gentoo.org/repo/gentoo.git/tree/net-vpn/openvpn
  214. * openSUSE
  215. https://build.opensuse.org/package/show/network:vpn/openvpn
  216. * Ubuntu
  217. https://packages.ubuntu.com/search?keywords=openvpn
  218. In addition, the OpenVPN community provides a best-effort APT repository
  219. for Debian and Ubuntu:
  220. https://community.openvpn.net/openvpn/wiki/OpenvpnSoftwareRepos
  221. *************************************************************************
  222. TUN/TAP Driver Configuration:
  223. * Linux 2.6 or higher (with integrated TUN/TAP driver):
  224. (1) load driver: modprobe tun
  225. (2) enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward
  226. Note that (1) needs to be done once per reboot. If you install from RPM (see
  227. above) and use the openvpn.init script, these steps are taken care of for you.
  228. * FreeBSD:
  229. FreeBSD ships with the TUN/TAP driver, and the device nodes for tap0,
  230. tap1, tap2, tap3, tun0, tun1, tun2 and tun3 are made by default.
  231. However, only the TUN driver is linked into the GENERIC kernel.
  232. To load the TAP driver, enter:
  233. kldload if_tap
  234. See man rc(8) to find out how you can do this at boot time.
  235. The easiest way is to install OpenVPN from the FreeBSD ports system,
  236. the port includes a sample script to automatically load the TAP driver
  237. at boot-up time.
  238. * OpenBSD:
  239. OpenBSD has dynamically created tun* devices so you only need
  240. to create an empty /etc/hostname.tun0 (tun1, tun2 and so on) for each tun
  241. you plan to use to create the device(s) at boot.
  242. * Solaris:
  243. You need a TUN/TAP kernel driver for OpenVPN to work:
  244. http://www.whiteboard.ne.jp/~admin2/tuntap/
  245. * Windows
  246. OpenVPN on Windows needs a TUN/TAP kernel driver to work. OpenVPN installers
  247. include this driver, so installing it separately is not usually required.
  248. Windows XP/2003 must use the NDIS 5 (tap-windows) driver, whereas on more
  249. recent Windows versions it is recommended to use the NDIS 6 driver
  250. (tap-windows6) instead.
  251. *************************************************************************
  252. CAVEATS & BUGS:
  253. * I have noticed cases where TCP sessions tunneled over the Linux
  254. TAP driver (kernel 2.4.21 and 2.4.22) stall when lower --mssfix
  255. values are used. The TCP sessions appear to unstall and resume
  256. normally when the remote VPN endpoint is pinged.
  257. * If run through a firewall using OpenBSDs packet filter PF and the
  258. filter rules include a "scrub" directive, you may get problems talking
  259. to Linux hosts over the tunnel, since the scrubbing will kill packets
  260. sent from Linux hosts if they are fragmented. This is usually seen as
  261. tunnels where small packets and pings get through but large packets
  262. and "regular traffic" don't. To circumvent this, add "no-df" to
  263. the scrub directive so that the packet filter will let fragments with
  264. the "dont fragment"-flag set through anyway.
  265. * Mixing OFB or CFB cipher modes with static key mode is not recommended,
  266. and is flagged as an error on OpenVPN versions 1.2.1 and greater.
  267. If you use the --cipher option to explicitly select an OFB or CFB
  268. cipher AND you are using static key mode, it is possible that there
  269. could be an IV collision if the OpenVPN daemons on both sides
  270. of the connection are started at exactly the same time, since
  271. OpenVPN uses a timestamp combined with a sequence number as the cipher
  272. IV for OFB and CFB modes. This is not an issue if you are
  273. using CBC cipher mode (the default), or if you are using OFB or CFB
  274. cipher mode with SSL/TLS authentication.