8307bf6507540c35ef40c18ba926ae7cc24b1edb
[feed/packages.git] / net / ocserv / files / ocserv.conf.template
1 # User authentication method. Could be set multiple times and in that case
2 # all should succeed.
3 # Options: certificate, pam.
4 #auth = "certificate"
5 #auth = "pam"
6
7 # The gid-min option is used by auto-select-group option, in order to
8 # select the minimum group ID.
9 #auth = "pam[gid-min=1000]"
10
11 # The plain option requires specifying a password file which contains
12 # entries of the following format.
13 # "username:groupname:encoded-password"
14 # One entry must be listed per line, and 'ocpasswd' can be used
15 # to generate password entries.
16 auth = "|AUTH|"
17
18 # A banner to be displayed on clients
19 banner = "Welcome to OpenWRT"
20
21 # When the server has a dynamic DNS address (that may change),
22 # should set that to true to ask the client to resolve again on
23 # reconnects.
24 listen-host-is-dyndns = |DYNDNS|
25
26 # Use listen-host to limit to specific IPs or to the IPs of a provided
27 # hostname.
28 #listen-host = [IP|HOSTNAME]
29
30 # Limit the number of clients. Unset or set to zero for unlimited.
31 #max-clients = 1024
32 max-clients = |MAX_CLIENTS|
33
34 # Limit the number of client connections to one every X milliseconds
35 # (X is the provided value). Set to zero for no limit.
36 #rate-limit-ms = 100
37
38 # Limit the number of identical clients (i.e., users connecting
39 # multiple times). Unset or set to zero for unlimited.
40 max-same-clients = |MAX_SAME|
41
42 # TCP and UDP port number
43 tcp-port = |PORT|
44 |UDP|udp-port = |PORT|
45
46 # Stats report time. The number of seconds after which each
47 # worker process will report its usage statistics (number of
48 # bytes transferred etc). This is useful when accounting like
49 # radius is in use.
50 #stats-report-time = 360
51
52 # Keepalive in seconds
53 keepalive = 32400
54
55 # Dead peer detection in seconds.
56 dpd = |DPD|
57
58 # Dead peer detection for mobile clients. The needs to
59 # be much higher to prevent such clients being awaken too
60 # often by the DPD messages, and save battery.
61 # (clients that send the X-AnyConnect-Identifier-DeviceType)
62 #mobile-dpd = 1800
63
64 # MTU discovery (DPD must be enabled)
65 try-mtu-discovery = false
66
67 # The key and the certificates of the server
68 # The key may be a file, or any URL supported by GnuTLS (e.g.,
69 # tpmkey:uuid=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx;storage=user
70 # or pkcs11:object=my-vpn-key;object-type=private)
71 #
72 # There may be multiple certificate and key pairs and each key
73 # should correspond to the preceding certificate.
74 server-cert = /etc/ocserv/server-cert.pem
75 server-key = /etc/ocserv/server-key.pem
76
77 # Diffie-Hellman parameters. Only needed if you require support
78 # for the DHE ciphersuites (by default this server supports ECDHE).
79 # Can be generated using:
80 # certtool --generate-dh-params --outfile /path/to/dh.pem
81 #dh-params = /path/to/dh.pem
82
83 # If you have a certificate from a CA that provides an OCSP
84 # service you may provide a fresh OCSP status response within
85 # the TLS handshake. That will prevent the client from connecting
86 # independently on the OCSP server.
87 # You can update this response periodically using:
88 # ocsptool --ask --load-cert=your_cert --load-issuer=your_ca --outfile response
89 # Make sure that you replace the following file in an atomic way.
90 #ocsp-response = /path/to/ocsp.der
91
92 # In case PKCS #11 or TPM keys are used the PINs should be available
93 # in files. The srk-pin-file is applicable to TPM keys only, and is the
94 # storage root key.
95 #pin-file = /path/to/pin.txt
96 #srk-pin-file = /path/to/srkpin.txt
97
98 # The Certificate Authority that will be used to verify
99 # client certificates (public keys) if certificate authentication
100 # is set.
101 #ca-cert = /etc/ocserv/ca.pem
102
103 # The object identifier that will be used to read the user ID in the client
104 # certificate. The object identifier should be part of the certificate's DN
105 # Useful OIDs are:
106 # CN = 2.5.4.3, UID = 0.9.2342.19200300.100.1.1
107 #cert-user-oid = 0.9.2342.19200300.100.1.1
108
109 # The object identifier that will be used to read the user group in the
110 # client certificate. The object identifier should be part of the certificate's
111 # DN. Useful OIDs are:
112 # OU (organizational unit) = 2.5.4.11
113 #cert-group-oid = 2.5.4.11
114
115 # The revocation list of the certificates issued by the 'ca-cert' above.
116 #crl = /etc/ocserv/crl.pem
117
118 # Uncomment this to enable compression negotiation (LZS, LZ4).
119 |COMPRESSION|compression = true
120
121 # GnuTLS priority string
122 tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0"
123
124 # To enforce perfect forward secrecy (PFS) on the main channel.
125 #tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0:-RSA"
126
127 # The time (in seconds) that a client is allowed to stay connected prior
128 # to authentication
129 auth-timeout = 40
130
131 # The time (in seconds) that a client is allowed to stay idle (no traffic)
132 # before being disconnected. Unset to disable.
133 #idle-timeout = 1200
134
135 # The time (in seconds) that a mobile client is allowed to stay idle (no
136 # traffic) before being disconnected. Unset to disable.
137 #mobile-idle-timeout = 2400
138
139 # The time (in seconds) that a client is not allowed to reconnect after
140 # a failed authentication attempt.
141 min-reauth-time = 360
142
143 # Cookie timeout (in seconds)
144 # which he can reconnect. That cookie will be invalided if not
145 # used within this timeout value. On a user disconnection, that
146 # cookie will also be active for this time amount prior to be
147 # invalid. That should allow a reasonable amount of time for roaming
148 # between different networks.
149 cookie-timeout = 300
150
151 # Whether roaming is allowed, i.e., if true a cookie is
152 # restricted to a single IP address and cannot be re-used
153 # from a different IP.
154 deny-roaming = false
155
156 # ReKey time (in seconds)
157 # ocserv will ask the client to refresh keys periodically once
158 # this amount of seconds is elapsed. Set to zero to disable.
159 rekey-time = 172800
160
161 # ReKey method
162 # Valid options: ssl, new-tunnel
163 # ssl: Will perform an efficient rehandshake on the channel allowing
164 # a seamless connection during rekey.
165 # new-tunnel: Will instruct the client to discard and re-establish the channel.
166 # Use this option only if the connecting clients have issues with the ssl
167 # option.
168 rekey-method = ssl
169
170 # Script to call when a client connects and obtains an IP
171 # Parameters are passed on the environment.
172 # REASON, USERNAME, GROUPNAME, HOSTNAME (the hostname selected by client),
173 # DEVICE, IP_REAL (the real IP of the client), IP_LOCAL (the local IP
174 # in the P-t-P connection), IP_REMOTE (the VPN IP of the client),
175 # ID (a unique numeric ID); REASON may be "connect" or "disconnect".
176
177 # These scripts are not needed if you have setup an interface for all vpns+
178 # devices.
179 #connect-script = /usr/bin/ocserv-script
180 #disconnect-script = /usr/bin/ocserv-script
181
182 # UTMP
183 use-utmp = false
184
185 # Whether to enable support for the occtl tool (i.e., either through D-BUS,
186 # or via a unix socket).
187 use-occtl = true
188
189 # socket file used for IPC with occtl. You only need to set that,
190 # if you use more than a single servers.
191 occtl-socket-file = /var/run/occtl.socket
192
193 # PID file. It can be overriden in the command line.
194 pid-file = /var/run/ocserv.pid
195
196 # The default server directory. Does not require any devices present.
197 chroot-dir = /var/lib/ocserv
198
199 # socket file used for IPC, will be appended with .PID
200 # It must be accessible within the chroot environment (if any)
201 #socket-file = /var/run/ocserv-socket
202 socket-file = ocserv-socket
203
204 # The user the worker processes will be run as. It should be
205 # unique (no other services run as this user).
206 run-as-user = ocserv
207 run-as-group = ocserv
208
209 # Set the protocol-defined priority (SO_PRIORITY) for packets to
210 # be sent. That is a number from 0 to 6 with 0 being the lowest
211 # priority. Alternatively this can be used to set the IP Type-
212 # Of-Service, by setting it to a hexadecimal number (e.g., 0x20).
213 # This can be set per user/group or globally.
214 #net-priority = 3
215
216 # Set the VPN worker process into a specific cgroup. This is Linux
217 # specific and can be set per user/group or globally.
218 #cgroup = "cpuset,cpu:test"
219
220 #
221 # Network settings
222 #
223
224 # The name of the tun device
225 device = vpns
226
227 # Whether the generated IPs will be predictable, i.e., IP stays the
228 # same for the same user when possible.
229 predictable-ips = |PREDICTABLE_IPS|
230
231 # The default domain to be advertised
232 |ENABLE_DEFAULT_DOMAIN|default-domain = |DEFAULT_DOMAIN|
233
234 # The pool of addresses that leases will be given from.
235 ipv4-network = |IPV4ADDR|
236 ipv4-netmask = |NETMASK|
237
238 # The advertized DNS server. Use multiple lines for
239 # multiple servers.
240 # dns = fc00::4be0
241 #dns = 192.168.1.2
242
243 # The NBNS server (if any)
244 #nbns = 192.168.1.3
245
246 # The IPv6 subnet that leases will be given from.
247 |ENABLE_IPV6|ipv6-network = |IPV6ADDR|
248 |ENABLE_IPV6|ipv6-prefix = |IPV6PREFIX|
249
250 # The domains over which the provided DNS should be used. Use
251 # multiple lines for multiple domains.
252 #split-dns = example.com
253
254 # Prior to leasing any IP from the pool ping it to verify that
255 # it is not in use by another (unrelated to this server) host.
256 ping-leases = false
257
258 # Unset to assign the default MTU of the device
259 # mtu =
260
261 # Unset to enable bandwidth restrictions (in bytes/sec). The
262 # setting here is global, but can also be set per user or per group.
263 #rx-data-per-sec = 40000
264 #tx-data-per-sec = 40000
265
266 # The number of packets (of MTU size) that are available in
267 # the output buffer. The default is low to improve latency.
268 # Setting it higher will improve throughput.
269 #output-buffer = 10
270
271 # Routes to be forwarded to the client. If you need the
272 # client to forward routes to the server, you may use the
273 # config-per-user/group or even connect and disconnect scripts.
274 #
275 # To set the server as the default gateway for the client just
276 # comment out all routes from the server.
277 #route = 192.168.1.0/255.255.255.0
278 #route = 192.168.5.0/255.255.255.0
279 #route = fef4:db8:1000:1001::/64
280
281 # Configuration files that will be applied per user connection or
282 # per group. Each file name on these directories must match the username
283 # or the groupname.
284 # The options allowed in the configuration files are dns, nbns,
285 # ipv?-network, ipv4-netmask, ipv6-prefix, rx/tx-per-sec, iroute, route,
286 # net-priority and cgroup.
287 #
288 # Note that the 'iroute' option allows to add routes on the server
289 # based on a user or group. The syntax depends on the input accepted
290 # by the commands route-add-cmd and route-del-cmd (see below).
291
292 config-per-user = /etc/ocserv/config-per-user/
293 config-per-group = /etc/ocserv/config-per-group/
294
295 # When config-per-xxx is specified and there is no group or user that
296 # matches, then utilize the following configuration.
297
298 #default-user-config = /etc/ocserv/defaults/user.conf
299 #default-group-config = /etc/ocserv/defaults/group.conf
300
301 # Groups that a client is allowed to select from.
302 # A client may belong in multiple groups, and in certain use-cases
303 # it is needed to switch between them. For these cases the client can
304 # select prior to authentication. Add multiple entries for multiple groups.
305 #select-group = group1
306 #select-group = group2[My group 2]
307 #select-group = tost[The tost group]
308
309 # The name of the group that if selected it would allow to use
310 # the assigned by default group.
311 #default-select-group = DEFAULT
312
313 # Instead of specifying manually all the allowed groups, you may instruct
314 # ocserv to scan all available groups and include the full list. That
315 # option is only functional on plain authentication.
316 #auto-select-group = true
317
318 # The system command to use to setup a route. %{R} will be replaced with the
319 # route/mask and %{D} with the (tun) device.
320 #
321 # The following example is from linux systems. %{R} should be something
322 # like 192.168.2.0/24
323
324 route-add-cmd = "/sbin/route add -net %{R} dev %{D}"
325 route-del-cmd = "/sbin/route del -net %{R} dev %{D}"
326
327 # This option allows to forward a proxy. The special strings '%{U}'
328 # and '%{G}', if present will be replaced by the username and group name.
329 #proxy-url = http://example.com/
330 #proxy-url = http://example.com/%{U}/%{G}/hello
331
332 #
333 # The following options are for (experimental) AnyConnect client
334 # compatibility.
335
336 # Client profile xml. A sample file exists in doc/profile.xml.
337 # This file must be accessible from inside the worker's chroot.
338 # It is not used by the openconnect client.
339 #user-profile = profile.xml
340
341 # Binary files that may be downloaded by the CISCO client. Must
342 # be within any chroot environment.
343 #binary-files = /path/to/binaries
344
345 # Unless set to false it is required for clients to present their
346 # certificate even if they are authenticating via a previously granted
347 # cookie and complete their authentication in the same TCP connection.
348 # Legacy CISCO clients do not do that, and thus this option should be
349 # set for them.
350 cisco-client-compat = |CISCO_COMPAT|
351
352 #Advanced options
353
354 # Option to allow sending arbitrary custom headers to the client after
355 # authentication and prior to VPN tunnel establishment.
356 #custom-header = "X-My-Header: hi there"