2016-06-28 20:35:26 +00:00
|
|
|
ocserv
|
|
|
|
======
|
|
|
|
|
2016-06-29 09:01:38 +00:00
|
|
|
![](https://badge.imagelayers.io/vimagick/ocserv:latest.svg)
|
|
|
|
|
2016-06-28 20:35:26 +00:00
|
|
|
[OpenConnect server][1] (ocserv) is an SSL VPN server. Its purpose is to be a
|
|
|
|
secure, small, fast and configurable VPN server.
|
|
|
|
|
|
|
|
## docker-compose.yml
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
ocserv:
|
|
|
|
image: vimagick/ocserv
|
|
|
|
ports:
|
|
|
|
- "4443:443/tcp"
|
|
|
|
- "4443:443/udp"
|
|
|
|
environment:
|
|
|
|
- VPN_DOMAIN=vpn.easypi.info
|
|
|
|
- VPN_NETWORK=10.20.30.0
|
|
|
|
- VPN_NETMASK=255.255.255.0
|
|
|
|
- VPN_USERNAME=username
|
|
|
|
- VPN_PASSWORD=password
|
|
|
|
cap_add:
|
|
|
|
- NET_ADMIN
|
|
|
|
restart: always
|
|
|
|
```
|
|
|
|
|
2016-06-29 09:01:38 +00:00
|
|
|
> - :warning: Please choose a strong password to protect VPN service.
|
|
|
|
> - These environment variables are used to generate config files/keys.
|
|
|
|
> - VPN accounts can be managed via [ocpasswd][2] command.
|
|
|
|
> - You can edit the config file [/etc/ocserv/ocserv.conf][3], then restart service.
|
2016-06-29 08:30:45 +00:00
|
|
|
|
|
|
|
## up and running
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker-compose up -d
|
2016-06-29 09:01:38 +00:00
|
|
|
$ docker-compose exec ocserv bash
|
|
|
|
>>> cd /etc/ocserv/
|
|
|
|
>>> ocpasswd -c /etc/ocserv/ocpasswd username
|
|
|
|
Enter password: ******
|
|
|
|
Re-enter password: ******
|
|
|
|
>>> exit
|
2016-06-29 08:30:45 +00:00
|
|
|
$ docker cp ocserv_ocserv_1:/etc/ocserv/certs/client.p12 .
|
2016-06-29 09:01:38 +00:00
|
|
|
$ docker-compose logs -f
|
|
|
|
```
|
|
|
|
|
|
|
|
## android client
|
|
|
|
|
|
|
|
There are two auth types:
|
|
|
|
|
|
|
|
- :-1: passwd: type everytime
|
|
|
|
- :+1: certificate: import once
|
|
|
|
|
|
|
|
```
|
|
|
|
AnyConnect ->
|
|
|
|
Connection ->
|
|
|
|
Add New VPN Connection... ->
|
|
|
|
Advanced Preferences... ->
|
|
|
|
Certificate ->
|
|
|
|
Import ->
|
|
|
|
File System
|
2016-06-29 08:30:45 +00:00
|
|
|
```
|
|
|
|
|
2016-06-28 20:35:26 +00:00
|
|
|
[1]: http://www.infradead.org/ocserv/
|
2016-06-29 09:01:38 +00:00
|
|
|
[2]: http://www.gnutls.org/manual/html_node/certtool-Invocation.html
|
|
|
|
[3]: http://www.infradead.org/ocserv/manual.html
|