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