OpenConnect server

Add new user

sudo ocpasswd -c /etc/ocserv/ocpasswd ilya

Restart server after user has been added

sudo systemctl stop ocserv
sudo systemctl start ocserv

Config file /etc/ocserv/ocserv.conf

auth = "plain[passwd=/etc/ocserv/ocpasswd]"
tcp-port = 443
udp-port = 443
socket-file = /var/run/ocserv-socket
pid-file = /var/run/ocserv.pid

# A banner to be displayed on clients
#banner = "Welcome to mah VPN!"

compression = true
cookie-timeout = 300

# The name to use for the tun device
device = vpns

# The subnet that the VPN will use
ipv4-network = 172.12.8.0
ipv4-netmask = 255.255.255.0
dns = 8.8.8.8
# The route that will be forwarded to the clients
route = 0.0.0.0/128.0.0.0
route = 128.0.0.0/128.0.0.0
route = 172.12.8.0/255.255.255.0
tunnel-all-dns = true
no-route = 80.82.0.0/255.255.0.0
route = default

# The path to the SSL cert you created earlier
server-cert = /etc/ssl/ocserv.crt
# The path to the SSL key you created earlier
server-key = /etc/ocserv/ssl/ocserv.pem

Last updated

Was this helpful?