Нет описания

ocserv.conf.template 12KB

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