Michael Brown a227d6d66d tun: Bring up interface before setting IPv6 route on Linux
Linux kernel commit 955ec4c ("net/ipv6: Do not allow route add with a
device that is down") rejects attempts to install an IPv6 route on an
interface that is not yet up.  This commit is first included in kernel
4.16.

The current code in os_set_ipv6_addr brings up the interface only
after attempting to install the IPv6 route.  On kernel 4.16 or later,
this fails with the error "Error setting route to remote IPv6: Network
is down".

Fix by switching the order of code blocks to bring the interface up
before attempting to configure the route.

Resolves: #301
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
2020-05-13 06:16:30 +02:00
2018-04-15 17:27:51 +02:00
2019-12-28 20:18:42 +01:00
2013-02-25 21:18:22 +01:00
2014-09-24 11:34:15 +02:00
2019-12-27 22:53:22 +01:00
2019-12-17 16:07:18 +01:00
2017-04-14 17:24:23 +03:00

Build status coverage report

About

This program is openconnect VPN server (ocserv), a server for the openconnect VPN client. It follows the openconnect protocol and is believed to be compatible with CISCO's AnyConnect SSL VPN.

The program consists of:

  1. ocserv, the main server application
  2. occtl, the server's control tool. A tool which allows one to query the server for information.
  3. ocpasswd, a tool to administer simple password files.

Build dependencies

Required dependencies (Debian pkg/Fedora pkg):

libgnutls28-dev      / gnutls-devel
libev-dev            / libev-devel

Optional dependencies that enable specific functionality:

TCP wrappers: libwrap0-dev       / tcp_wrappers-devel
PAM:          libpam0g-dev       / pam-devel
LZ4:          liblz4-dev         / lz4-devel
seccomp:      libseccomp-dev     / libseccomp-devel
occtl:        libreadline-dev    / readline-devel
              libnl-route-3-dev  / libnl3-devel
GSSAPI:       libkrb5-dev        / krb5-devel
Radius:       libradcli-dev      / radcli-devel

Dependencies for development, testing, or dependencies that can be skipped in an embedded system (e.g., because a replacement library is included):

libprotobuf-c-dev  / protobuf-c-devel
libtalloc-dev      / libtalloc-devel
libhttp-parser-dev / http-parser-devel
libpcl1-dev        / pcllib-devel
protobuf-c-compiler/ protobuf-c
gperf              / gperf
liblockfile-bin    / lockfile-progs
nuttcp             / nuttcp
lcov               / lcov
libuid-wrapper     / uid_wrapper
libpam-wrapper     / pam_wrapper
libnss-wrapper     / nss_wrapper
libsocket-wrapper  / socket_wrapper
gss-ntlmssp        / gssntlmssp
haproxy            / haproxy
iputils-ping       / iputils
freeradius	   / freeradius
gawk		   / gawk
yajl-tools	   / yajl

See README-radius for more information on Radius dependencies and its configuration.

Build instructions

To build from a distributed release use:

$ ./configure && make && make check

To test the code coverage of the test suite use the following:

$ ./configure --enable-code-coverage
$ make && make check && make code-coverage-capture

Note that the code coverage reported does not currently include tests which are run within docker.

In addition to the prerequisites listed above, building from git requires the following packages: autoconf, automake, and xz.

To build from the git repository use:

$ autoreconf -fvi
$ ./configure && make

Basic installation instructions

Now you need to generate a certificate. E.g.

$ certtool --generate-privkey > ./test-key.pem
$ certtool --generate-self-signed --load-privkey test-key.pem --outfile test-cert.pem

(make sure you enable encryption or signing)

To run the server on the foreground edit the sample.config and then run:

# cd doc && ../src/ocserv -f -c sample.config

Configuration

Several configuration instruction are available in the recipes repository.

Profiling

If you use ocserv on a server with significant load and you'd like to help improve it, you may help by sending profiling information. That includes the bottlenecks in software, so future optimizations could be spent on the real needs.

In a Linux system you can profile ocserv using the following command.

# perf record -g ocserv

After the server is terminated, the output is placed in perf.data. You may examine the output using:

# perf report

Continuous Integration (CI)

We utilize the gitlab-ci continuous integration system. It is used to test most of the Linux systems (see .gitlab-ci.yml),and is split in two phases, build image creation and compilation/test. The build image creation is done at the openconnect/build-images subproject and uploads the image at the gitlab.com container registry. The compilation/test phase is on every commit to project.

How the VPN works

Please see the technical description page.

Description
No description provided
Readme 7.8 MiB
Languages
C 76.8%
Shell 16.5%
M4 4.5%
Roff 1.1%
Makefile 0.8%
Other 0.3%