1 .TH STRONGSWAN.CONF 5 "2011-07-26" "@IPSEC_VERSION@" "strongSwan"
3 strongswan.conf \- strongSwan configuration file
7 configuration file is well suited to define IPsec related configuration
8 parameters, it is not useful for other strongSwan applications to read options
10 The file is hard to parse and only
12 is capable of doing so. As the number of components of the strongSwan project
13 is continually growing, a more flexible configuration file was needed, one that
14 is easy to extend and can be used by all components. With strongSwan 4.2.1
15 .IR strongswan.conf (5)
16 was introduced which meets these requirements.
19 The format of the strongswan.conf file consists of hierarchical
23 in each section. Each section has a name, followed by C-Style curly brackets
24 defining the section body. Each section body contains a set of subsections
28 settings := (section|keyvalue)*
29 section := name { settings }
30 keyvalue := key = value\\n
33 Values must be terminated by a newline.
35 Comments are possible using the \fB#\fP-character, but be careful: The parser
36 implementation is currently limited and does not like brackets in comments.
38 Section names and keys may contain any printable character except:
44 An example file in this format might look like this:
61 Indentation is optional, you may use tabs or spaces.
66 statement it is possible to include other files into strongswan.conf, e.g.
69 include /some/path/*.conf
72 If the file name is not an absolute path, it is considered to be relative
73 to the directory of the file containing the include statement. The file name
74 may include shell wildcards (see
76 Also, such inclusions can be nested.
78 Sections loaded from included files
80 previously loaded sections; already existing values are
82 It is important to note that settings are added relative to the section the
83 include statement is in.
85 As an example, the following three files result in the same final
86 config as the one given above:
91 somevalue = before include
97 # settings loaded from this file are added to section-one
98 # the following replaces the previous value
106 # this extends section-one and subsection
109 # this replaces the previous value
119 Values are accessed using a dot-separated section list and a key.
120 With reference to the example above, accessing
121 .B section-one.subsection.othervalue
126 The following keys are currently defined (using dot notation). The default
127 value (if any) is listed in brackets after the key.
131 .BR charon.block_threshold " [5]"
132 Maximum number of half-open IKE_SAs for a single peer IP
134 .BR charon.close_ike_on_child_failure " [no]"
135 Close the IKE_SA if setup of the CHILD_SA along with IKE_AUTH failed
137 .BR charon.cookie_threshold " [10]"
138 Number of half-open IKE_SAs that activate the cookie mechanism
143 DNS servers assigned to peer via configuration payload (CP)
145 .BR charon.dos_protection " [yes]"
146 Enable Denial of Service protection using cookies and aggressiveness checks
149 Section to define file loggers, see LOGGER CONFIGURATION
151 .BR charon.flush_auth_cfg " [no]"
154 .BR charon.half_open_timeout " [30]"
155 Timeout in seconds for connecting IKE_SAs (also see IKE_SA_INIT DROPPING).
157 .BR charon.hash_and_url " [no]"
158 Enable hash and URL support
160 .BR charon.ignore_routing_tables
161 A list of routing tables to be excluded from route lookup
163 .BR charon.ikesa_table_segments " [1]"
164 Number of exclusively locked segments in the hash table
166 .BR charon.ikesa_table_size " [1]"
167 Size of the IKE_SA hash table
169 .BR charon.inactivity_close_ike " [no]"
170 Whether to close IKE_SA if the only CHILD_SA closed due to inactivity
172 .BR charon.init_limit_half_open " [0]"
173 Limit new connections based on the current number of half open IKE_SAs (see
174 IKE_SA_INIT DROPPING).
176 .BR charon.init_limit_job_load " [0]"
177 Limit new connections based on the number of jobs currently queued for
178 processing (see IKE_SA_INIT DROPPING).
180 .BR charon.install_routes " [yes]"
181 Install routes into a separate routing table for established IPsec tunnels
183 .BR charon.install_virtual_ip " [yes]"
184 Install virtual IP addresses
186 .BR charon.keep_alive " [20s]"
187 NAT keep alive interval
190 Plugins to load in the IKEv2 daemon charon
192 .BR charon.max_packet " [10000]"
193 Maximum packet size accepted by charon
195 .BR charon.multiple_authentication " [yes]"
196 Enable multiple authentication exchanges (RFC 4739)
201 WINS servers assigned to peer via configuration payload (CP)
203 .BR charon.process_route " [yes]"
204 Process RTM_NEWROUTE and RTM_DELROUTE events
206 .BR charon.receive_delay " [0]"
207 Delay for receiving packets, to simulate larger RTT
209 .BR charon.receive_delay_response " [yes]"
210 Delay response messages
212 .BR charon.receive_delay_request " [yes]"
213 Delay request messages
215 .BR charon.receive_delay_type " [0]"
216 Specific IKEv2 message type to delay, 0 for any
218 .BR charon.replay_window " [32]"
219 Size of the AH/ESP replay window, in packets.
221 .BR charon.retransmit_base " [1.8]"
222 Base to use for calculating exponential back off, see IKEv2 RETRANSMISSION
224 .BR charon.retransmit_timeout " [4.0]
225 Timeout in seconds before sending first retransmit
227 .BR charon.retransmit_tries " [5]"
228 Number of times to retransmit a packet before giving up
230 .BR charon.reuse_ikesa " [yes]
231 Initiate CHILD_SA within existing IKE_SAs
233 .BR charon.routing_table
234 Numerical routing table to install routes to
236 .BR charon.routing_table_prio
237 Priority of the routing table
239 .BR charon.send_delay " [0]"
240 Delay for sending packets, to simulate larger RTT
242 .BR charon.send_delay_response " [yes]"
243 Delay response messages
245 .BR charon.send_delay_request " [yes]"
246 Delay request messages
248 .BR charon.send_delay_type " [0]"
249 Specific IKEv2 message type to delay, 0 for any
251 .BR charon.send_vendor_id " [no]
252 Send strongSwan vendor ID payload
255 Section to define syslog loggers, see LOGGER CONFIGURATION
257 .BR charon.threads " [16]"
258 Number of worker threads in charon
259 .SS charon.plugins subsection
261 .BR charon.plugins.android.loglevel " [1]"
262 Loglevel for logging to Android specific logger
264 .BR charon.plugins.attr
265 Section to specify arbitrary attributes that are assigned to a peer via
266 configuration payload (CP)
268 .BR charon.plugins.dhcp.identity_lease " [no]"
269 Derive user-defined MAC address from hash of IKEv2 identity
271 .BR charon.plugins.dhcp.server " [255.255.255.255]"
272 DHCP server unicast or broadcast IP address
274 .BR charon.plugins.duplicheck.enable " [yes]"
275 enable loaded duplicheck plugin
277 .BR charon.plugins.eap-aka.request_identity " [yes]"
280 .BR charon.plugins.eap-aka-3ggp2.seq_check
283 .BR charon.plugins.eap-gtc.pam_service " [login]"
284 PAM service to be used for authentication
287 .BR charon.plugins.eap-peap.fragment_size " [1024]"
288 Maximum size of an EAP-PEAP packet
290 .BR charon.plugins.eap-peap.max_message_count " [32]"
291 Maximum number of processed EAP-PEAP packets
293 .BR charon.plugins.eap-peap.include_length " [no]"
294 Include length in non-fragmented EAP-PEAP packets
296 .BR charon.plugins.eap-peap.phase2_method " [mschapv2]"
297 Phase2 EAP client authentication method
299 .BR charon.plugins.eap-peap.phase2_piggyback " [no]"
300 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
302 .BR charon.plugins.eap-peap.phase2_tnc " [no]"
303 Start phase2 EAP TNC protocol after successful client authentication
305 .BR charon.plugins.eap-peap.request_peer_auth " [no]"
306 Request peer authentication based on a client certificate
309 .BR charon.plugins.eap-radius.class_group " [no]"
312 attribute sent in the RADIUS-Accept message as group membership information that
313 is compared to the groups specified in the
318 .BR charon.plugins.eap-radius.eap_start " [no]"
319 Send EAP-Start instead of EAP-Identity to start RADIUS conversation
321 .BR charon.plugins.eap-radius.filter_id " [no]"
328 attribute sent in the RADIUS-Accept message as group membership information that
329 is compared to the groups specified in the
334 .BR charon.plugins.eap-radius.id_prefix
335 Prefix to EAP-Identity, some AAA servers use a IMSI prefix to select the
338 .BR charon.plugins.eap-radius.nas_identifier " [strongSwan]"
339 NAS-Identifier to include in RADIUS messages
341 .BR charon.plugins.eap-radius.port " [1812]"
342 Port of RADIUS server (authentication)
344 .BR charon.plugins.eap-radius.secret
345 Shared secret between RADIUS and NAS
347 .BR charon.plugins.eap-radius.server
348 IP/Hostname of RADIUS server
350 .BR charon.plugins.eap-radius.servers
351 Section to specify multiple RADIUS servers. The
357 options can be specified for each server. A server's IP/Hostname can be
360 option. For each RADIUS server a priority can be specified using the
361 .BR preference " [0]"
364 .BR charon.plugins.eap-radius.sockets " [1]"
365 Number of sockets (ports) to use, increase for high load
367 .BR charon.plugins.eap-sim.request_identity " [yes]"
370 .BR charon.plugins.eap-simaka-sql.database
373 .BR charon.plugins.eap-simaka-sql.remove_used
376 .BR charon.plugins.eap-tls.fragment_size " [1024]"
377 Maximum size of an EAP-TLS packet
379 .BR charon.plugins.eap-tls.max_message_count " [32]"
380 Maximum number of processed EAP-TLS packets
382 .BR charon.plugins.eap-tls.include_length " [yes]"
383 Include length in non-fragmented EAP-TLS packets
385 .BR charon.plugins.eap-tnc.fragment_size " [50000]"
386 Maximum size of an EAP-TNC packet
388 .BR charon.plugins.eap-tnc.max_message_count " [10]"
389 Maximum number of processed EAP-TNC packets
391 .BR charon.plugins.eap-tnc.include_length " [yes]"
392 Include length in non-fragmented EAP-TNC packets
394 .BR charon.plugins.eap-ttls.fragment_size " [1024]"
395 Maximum size of an EAP-TTLS packet
397 .BR charon.plugins.eap-ttls.max_message_count " [32]"
398 Maximum number of processed EAP-TTLS packets
400 .BR charon.plugins.eap-ttls.include_length " [yes]"
401 Include length in non-fragmented EAP-TTLS packets
403 .BR charon.plugins.eap-ttls.phase2_method " [md5]"
404 Phase2 EAP client authentication method
406 .BR charon.plugins.eap-ttls.phase2_piggyback " [no]"
407 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
409 .BR charon.plugins.eap-ttls.phase2_tnc " [no]"
410 Start phase2 EAP TNC protocol after successful client authentication
412 .BR charon.plugins.eap-ttls.request_peer_auth " [no]"
413 Request peer authentication based on a client certificate
415 .BR charon.plugins.ha.fifo_interface " [yes]"
418 .BR charon.plugins.ha.heartbeat_delay " [1000]"
421 .BR charon.plugins.ha.heartbeat_timeout " [2100]"
424 .BR charon.plugins.ha.local
427 .BR charon.plugins.ha.monitor " [yes]"
430 .BR charon.plugins.ha.pools
433 .BR charon.plugins.ha.remote
436 .BR charon.plugins.ha.resync " [yes]"
439 .BR charon.plugins.ha.secret
442 .BR charon.plugins.ha.segment_count " [1]"
445 .BR charon.plugins.led.activity_led
448 .BR charon.plugins.led.blink_time " [50]"
451 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
452 Number of ipsecN devices
454 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
455 Set MTU of ipsecN device
457 .BR charon.plugins.load-tester
458 Section to configure the load-tester plugin, see LOAD TESTS
460 .BR charon.plugins.resolve.file " [/etc/resolv.conf]"
461 File where to add DNS server entries
463 .BR charon.plugins.sql.database
464 Database URI for charons SQL plugin
466 .BR charon.plugins.sql.loglevel " [-1]"
467 Loglevel for logging to SQL database
469 .BR charon.plugins.tnc-ifmap.device_name
470 Unique name of strongSwan as a PEP and/or PDP device
472 .BR charon.plugins.tnc-ifmap.key_file
473 Concatenated client certificate and private key
475 .BR charon.plugins.tnc-ifmap.password
476 Authentication password of strongSwan MAP client
478 .BR charon.plugins.tnc-ifmap.server_cert
479 Certificate of MAP server
481 .BR charon.plugins.tnc-ifmap.ssl_passphrase
482 Passphrase protecting the private key
484 .BR charon.plugins.tnc-ifmap.username
485 Authentication username of strongSwan MAP client
487 .BR charon.plugins.tnc-imc.preferred_language " [en]"
488 Preferred language for TNC recommendations
490 .BR charon.plugins.whitelist.enable " [yes]"
491 enable loaded whitelist plugin
492 .SS libstrongswan section
494 .BR libstrongswan.crypto_test.bench " [no]"
497 .BR libstrongswan.crypto_test.bench_size " [1024]"
500 .BR libstrongswan.crypto_test.bench_time " [50]"
503 .BR libstrongswan.crypto_test.on_add " [no]"
504 Test crypto algorithms during registration
506 .BR libstrongswan.crypto_test.on_create " [no]"
507 Test crypto algorithms on each crypto primitive instantiation
509 .BR libstrongswan.crypto_test.required " [no]"
510 Strictly require at least one test vector to enable an algorithm
512 .BR libstrongswan.crypto_test.rng_true " [no]"
513 Whether to test RNG with TRUE quality; requires a lot of entropy
515 .BR libstrongswan.dh_exponent_ansi_x9_42 " [yes]"
516 Use ANSI X9.42 DH exponent size or optimum size matched to cryptographical
519 .BR libstrongswan.ecp_x_coordinate_only " [yes]"
520 Compliance with the errata for RFC 4753
522 .BR libstrongswan.integrity_test " [no]"
523 Check daemon, libstrongswan and plugin integrity at startup
525 .BR libstrongswan.leak_detective.detailed " [yes]"
526 Includes source file names and line numbers in leak detective output
528 .BR libstrongswan.processor.priority_threads
529 Subsection to configure the number of reserved threads per priority class
530 see JOB PRIORITY MANAGEMENT
532 .BR libstrongswan.x509.enforce_critical " [yes]"
533 Discard certificates with unsupported or unknown critical extensions
534 .SS libstrongswan.plugins subsection
536 .BR libstrongswan.plugins.attr-sql.database
537 Database URI for attr-sql plugin used by charon and pluto
539 .BR libstrongswan.plugins.attr-sql.lease_history " [yes]"
540 Enable logging of SQL IP pool leases
542 .BR libstrongswan.plugins.gcrypt.quick_random " [no]"
543 Use faster random numbers in gcrypt; for testing only, produces weak keys!
545 .BR libstrongswan.plugins.openssl.engine_id " [pkcs11]"
546 ENGINE ID to use in the OpenSSL plugin
548 .BR libstrongswan.plugins.pkcs11.modules
549 List of available PKCS#11 modules
551 .BR libstrongswan.plugins.pkcs11.use_dh " [no]"
552 Whether the PKCS#11 modules should be used for DH and ECDH (see use_ecc option)
554 .BR libstrongswan.plugins.pkcs11.use_ecc " [no]"
555 Whether the PKCS#11 modules should be used for ECDH and ECDSA public key
556 operations. ECDSA private keys can be used regardless of this option
558 .BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
559 Whether the PKCS#11 modules should be used to hash data
561 .BR libstrongswan.plugins.pkcs11.use_pubkey " [no]"
562 Whether the PKCS#11 modules should be used for public key operations, even for
563 keys not stored on tokens
565 .BR libstrongswan.plugins.pkcs11.use_rng " [no]"
566 Whether the PKCS#11 modules should be used as RNG
569 .BR libtnccs.tnc_config " [/etc/tnc_config]"
570 TNC IMC/IMV configuration directory
573 .BR libimcv.debug_level " [1]"
574 Debug level for a stand-alone libimcv library
576 .BR libimcv.stderr_quiet " [no]"
577 Disable output to stderr with a stand-alone libimcv library
578 .SS libimcv plugins section
580 .BR libimcv.plugins.imc-attestation.platform_info
581 Information on operating system and hardware platform
583 .BR libimcv.plugins.imc-attestation.aik_cert
586 .BR libimcv.plugins.imc-attestation.aik_key
589 .BR libimcv.plugins.imv-attestation.cadir
590 Path to directory with AIK cacerts
592 .BR libimcv.plugins.imv-attestation.database
593 Path to database with file measurement information
595 .BR libimcv.plugins.imv-attestation.hash_algorithm " [sha1]"
596 Preferred measurement hash algorithm
598 .BR libimcv.plugins.imv-attestation.platform_info
599 Information on operating system and hardware platform
601 .BR libimcv.plugins.imv-scanner.closed_port_policy " [yes]"
602 By default all ports must be closed (yes) or can be open (no)
604 .BR libimcv.plugins.imv-scanner.tcp_ports
605 List of TCP ports that can be open or must be closed
607 .BR libimcv.plugins.imv-scanner.udp_ports
608 List of UDP ports that can be open or must be closed
610 .BR libimcv.plugins.imc-test.command " [none]"
611 Command to be sent to the Test IMV
613 .BR libimcv.plugins.imc-test.retry " [no]"
616 .BR libimcv.plugins.imc-test.retry_command
617 Command to be sent to the Test IMV in the handshake retry
619 .BR libimcv.plugins.imv-test.rounds " [0]"
620 Number of IMC-IMV retry rounds
624 List of TLS encryption ciphers
626 .BR libtls.key_exchange
627 List of TLS key exchange methods
630 List of TLS MAC algorithms
633 List of TLS cipher suites
637 Credential database URI for manager
639 .BR manager.debug " [no]"
640 Enable debugging in manager
643 Plugins to load in manager
646 FastCGI socket of manager, to run it statically
648 .BR manager.threads " [10]"
649 Threads to use for request handling
651 .BR manager.timeout " [15m]"
652 Session timeout for manager
653 .SS mediation client section
656 Mediation client database URI
658 .BR medcli.dpd " [5m]"
659 DPD timeout to use in mediation client plugin
661 .BR medcli.rekey " [20m]"
662 Rekeying time on mediation connections in mediation client plugin
663 .SS mediation server section
666 Mediation server database URI
668 .BR medsrv.debug " [no]"
669 Debugging in mediation server web application
671 .BR medsrv.dpd " [5m]"
672 DPD timeout to use in mediation server plugin
675 Plugins to load in mediation server plugin
677 .BR medsrv.password_length " [6]"
678 Minimum password length required for mediation server user accounts
680 .BR medsrv.rekey " [20m]"
681 Rekeying time on mediation connections in mediation server plugin
684 Run Mediation server web application statically on socket
686 .BR medsrv.threads " [5]"
687 Number of thread for mediation service web application
689 .BR medsrv.timeout " [15m]"
690 Session timeout for mediation service
694 Plugins to load in ipsec openac tool
698 Plugins to load in ipsec pki tool
704 DNS servers assigned to peer via Mode Config
707 Plugins to load in IKEv1 pluto daemon
712 WINS servers assigned to peer via Mode Config
714 .BR pluto.threads " [4]"
715 Number of worker threads in pluto
716 .SS pluto.plugins section
718 .BR pluto.plugins.attr
719 Section to specify arbitrary attributes that are assigned to a peer via
722 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
723 Number of ipsecN devices
725 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
726 Set MTU of ipsecN device
730 Plugins to load in ipsec pool tool
731 .SS scepclient section
734 Plugins to load in ipsec scepclient tool
738 Plugins to load in starter
740 .BR starter.load_warning " [yes]"
741 Disable charon/pluto plugin load option warning
743 .SH LOGGER CONFIGURATION
744 The options described below provide a much more flexible way to configure
745 loggers for the IKEv2 daemon charon than using the
751 that if any loggers are specified in strongswan.conf,
753 does not have any effect.
755 There are currently two types of loggers defined:
758 Log directly to a file and are defined by specifying the full path to the
759 file as subsection in the
761 section. To log to the console the two special filenames
762 .BR stdout " and " stderr
766 Log into a syslog facility and are defined by specifying the facility to log to
767 as the name of a subsection in the
769 section. The following facilities are currently supported:
770 .BR daemon " and " auth .
772 Multiple loggers can be defined for each type with different log verbosity for
773 the different subsystems of the daemon.
776 .BR charon.filelog.<filename>.default " [1]"
778 .BR charon.syslog.<facility>.default
779 Specifies the default loglevel to be used for subsystems for which no specific
782 .BR charon.filelog.<filename>.<subsystem> " [<default>]"
784 .BR charon.syslog.<facility>.<subsystem>
785 Specifies the loglevel for the given subsystem.
787 .BR charon.filelog.<filename>.append " [yes]"
788 If this option is enabled log entries are appended to the existing file.
790 .BR charon.filelog.<filename>.flush_line " [no]"
791 Enabling this option disables block buffering and enables line buffering.
793 .BR charon.filelog.<filename>.ike_name " [no]"
795 .BR charon.syslog.<facility>.ike_name
796 Prefix each log entry with the connection name and a unique numerical
797 identifier for each IKE_SA.
799 .BR charon.filelog.<filename>.time_format
800 Prefix each log entry with a timestamp. The option accepts a format string as
807 Main daemon setup/cleanup/signal handling
810 IKE_SA manager, handling synchronization for IKE_SA access
819 Jobs queueing/processing and thread pool management
822 Configuration management and plugins
825 IPsec/Networking kernel interface
828 IKE network communication
831 Packet encoding/decoding encryption/decryption operations
834 libtls library messages
837 libstrongwan library messages
840 Trusted Network Connect
843 Integrity Measurement Collector
846 Integrity Measurement Verifier
849 Platform Trust Service
856 Very basic auditing logs, (e.g. SA up/SA down)
859 Generic control flow with errors, a good default to see whats going on
862 More detailed debugging control flow
865 Including RAW data dumps in Hex
868 Also include sensitive material in dumps, e.g. keys
874 /var/log/charon.log {
875 time_format = %b %e %T
886 # enable logging to LOG_DAEMON, use defaults
889 # minimalistic IKE auditing logging to LOG_AUTHPRIV
898 .SH JOB PRIORITY MANAGEMENT
899 Some operations in the IKEv2 daemon charon are currently implemented
900 synchronously and blocking. Two examples for such operations are communication
901 with a RADIUS server via EAP-RADIUS, or fetching CRL/OCSP information during
902 certificate chain verification. Under high load conditions, the thread pool may
903 run out of available threads, and some more important jobs, such as liveness
904 checking, may not get executed in time.
906 To prevent thread starvation in such situations job priorities were introduced.
907 The job processor will reserve some threads for higher priority jobs, these
908 threads are not available for lower priority, locking jobs.
910 Currently 4 priorities have been defined, and they are used in charon as
914 Priority for long-running dispatcher jobs.
917 INFORMATIONAL exchanges, as used by liveness checking (DPD).
920 Everything not HIGH/LOW, including IKE_SA_INIT processing.
923 IKE_AUTH message processing. RADIUS and CRL fetching block here
925 Although IKE_SA_INIT processing is computationally expensive, it is explicitly
926 assigned to the MEDIUM class. This allows charon to do the DH exchange while
927 other threads are blocked in IKE_AUTH. To prevent the daemon from accepting more
928 IKE_SA_INIT requests than it can handle, use IKE_SA_INIT DROPPING.
930 The thread pool processes jobs strictly by priority, meaning it will consume all
931 higher priority jobs before looking for ones with lower priority. Further, it
932 reserves threads for certain priorities. A priority class having reserved
934 threads will always have
936 threads available for this class (either currently processing a job, or waiting
939 To ensure that there are always enough threads available for higher priority
940 tasks, threads must be reserved for each priority class.
942 .BR libstrongswan.processor.priority_threads.critical " [0]"
943 Threads reserved for CRITICAL priority class jobs
945 .BR libstrongswan.processor.priority_threads.high " [0]"
946 Threads reserved for HIGH priority class jobs
948 .BR libstrongswan.processor.priority_threads.medium " [0]"
949 Threads reserved for MEDIUM priority class jobs
951 .BR libstrongswan.processor.priority_threads.low " [0]"
952 Threads reserved for LOW priority class jobs
954 Let's consider the following configuration:
967 With this configuration, one thread is reserved for HIGH priority tasks. As
968 currently only liveness checking and stroke message processing is done with
969 high priority, one or two threads should be sufficient.
971 The MEDIUM class mostly processes non-blocking jobs. Unless your setup is
972 experiencing many blocks in locks while accessing shared resources, threads for
973 one or two times the number of CPU cores is fine.
975 It is usually not required to reserve threads for CRITICAL jobs. Jobs in this
976 class rarely return and do not release their thread to the pool.
978 The remaining threads are available for LOW priority jobs. Reserving threads
979 does not make sense (until we have an even lower priority).
981 To see what the threads are actually doing, invoke
982 .IR "ipsec statusall" .
983 Under high load, something like this will show up:
986 worker threads: 2 or 32 idle, 5/1/2/22 working,
987 job queue: 0/0/1/149, scheduled: 198
990 From 32 worker threads,
994 are running CRITICAL priority jobs (dispatching from sockets, etc.).
996 is currently handling a HIGH priority job. This is actually the thread currently
997 providing this information via stroke.
999 are handling MEDIUM priority jobs, likely IKE_SA_INIT or CREATE_CHILD_SA
1002 are handling LOW priority jobs, probably waiting for an EAP-RADIUS response
1003 while processing IKE_AUTH messages.
1005 The job queue load shows how many jobs are queued for each priority, ready for
1006 execution. The single MEDIUM priority job will get executed immediately, as
1007 we have two spare threads reserved for MEDIUM class jobs.
1009 .SH IKE_SA_INIT DROPPING
1010 If a responder receives more connection requests per seconds than it can handle,
1011 it does not make sense to accept more IKE_SA_INIT messages. And if they are
1012 queued but can't get processed in time, an answer might be sent after the
1013 client has already given up and restarted its connection setup. This
1014 additionally increases the load on the responder.
1016 To limit the responder load resulting from new connection attempts, the daemon
1017 can drop IKE_SA_INIT messages just after reception. There are two mechanisms to
1018 decide if this should happen, configured with the following options:
1020 .BR charon.init_limit_half_open " [0]"
1021 Limit based on the number of half open IKE_SAs. Half open IKE_SAs are SAs in
1022 connecting state, but not yet established.
1024 .BR charon.init_limit_job_load " [0]"
1025 Limit based on the number of jobs currently queued for processing (sum over all
1028 The second limit includes load from other jobs, such as rekeying. Choosing a
1029 good value is difficult and depends on the hardware and expected load.
1031 The first limit is simpler to calculate, but includes the load from new
1032 connections only. If your responder is capable of negotiating 100 tunnels/s, you
1033 might set this limit to 1000. The daemon will then drop new connection attempts
1034 if generating a response would require more than 10 seconds. If you are
1035 allowing for a maximum response time of more than 30 seconds, consider adjusting
1036 the timeout for connecting IKE_SAs
1037 .RB ( charon.half_open_timeout ).
1038 A responder, by default, deletes an IKE_SA if the initiator does not establish
1039 it within 30 seconds. Under high load, a higher value might be required.
1042 To do stability testing and performance optimizations, the IKEv2 daemon charon
1043 provides the load-tester plugin. This plugin allows to setup thousands of
1044 tunnels concurrently against the daemon itself or a remote host.
1047 Never enable the load-testing plugin on productive systems. It provides
1048 preconfigured credentials and allows an attacker to authenticate as any user.
1051 .BR charon.plugins.load-tester.child_rekey " [600]"
1052 Seconds to start CHILD_SA rekeying after setup
1054 .BR charon.plugins.load-tester.delay " [0]"
1055 Delay between initiatons for each thread
1057 .BR charon.plugins.load-tester.delete_after_established " [no]"
1058 Delete an IKE_SA as soon as it has been established
1060 .BR charon.plugins.load-tester.dpd_delay " [0]"
1061 DPD delay to use in load test
1063 .BR charon.plugins.load-tester.dynamic_port " [0]"
1064 Base port to be used for requests (each client uses a different port)
1066 .BR charon.plugins.load-tester.eap_password " [default-pwd]"
1067 EAP secret to use in load test
1069 .BR charon.plugins.load-tester.enable " [no]"
1070 Enable the load testing plugin
1072 .BR charon.plugins.load-tester.fake_kernel " [no]"
1073 Fake the kernel interface to allow load-testing against self
1075 .BR charon.plugins.load-tester.ike_rekey " [0]"
1076 Seconds to start IKE_SA rekeying after setup
1078 .BR charon.plugins.load-tester.init_limit " [0]"
1079 Global limit of concurrently established SAs during load test
1081 .BR charon.plugins.load-tester.initiators " [0]"
1082 Number of concurrent initiator threads to use in load test
1084 .BR charon.plugins.load-tester.initiator_auth " [pubkey]"
1085 Authentication method(s) the intiator uses
1087 .BR charon.plugins.load-tester.initiator_id
1088 Initiator ID used in load test
1090 .BR charon.plugins.load-tester.iterations " [1]"
1091 Number of IKE_SAs to initate by each initiator in load test
1093 .BR charon.plugins.load-tester.pool
1094 Provide INTERNAL_IPV4_ADDRs from a named pool
1096 .BR charon.plugins.load-tester.preshared_key " [default-psk]"
1097 Preshared key to use in load test
1099 .BR charon.plugins.load-tester.proposal " [aes128-sha1-modp768]"
1100 IKE proposal to use in load test
1102 .BR charon.plugins.load-tester.remote " [127.0.0.1]"
1103 Address to initiation connections to
1105 .BR charon.plugins.load-tester.responder_auth " [pubkey]"
1106 Authentication method(s) the responder uses
1108 .BR charon.plugins.load-tester.responder_id
1109 Responder ID used in load test
1111 .BR charon.plugins.load-tester.request_virtual_ip " [no]"
1112 Request an INTERNAL_IPV4_ADDR from the server
1114 .BR charon.plugins.load-tester.shutdown_when_complete " [no]"
1115 Shutdown the daemon after all IKE_SAs have been established
1116 .SS Configuration details
1117 For public key authentication, the responder uses the
1118 .B \(dqCN=srv, OU=load-test, O=strongSwan\(dq
1119 identity. For the initiator, each connection attempt uses a different identity
1121 .BR "\(dqCN=c1-r1, OU=load-test, O=strongSwan\(dq" ,
1122 where the first number inidicates the client number, the second the
1123 authentication round (if multiple authentication is used).
1125 For PSK authentication, FQDN identities are used. The server uses
1126 .BR srv.strongswan.org ,
1127 the client uses an identity in the form
1128 .BR c1-r1.strongswan.org .
1130 For EAP authentication, the client uses a NAI in the form
1131 .BR 100000000010001@strongswan.org .
1133 To configure multiple authentication, concatenate multiple methods using, e.g.
1135 initiator_auth = pubkey|psk|eap-md5|eap-aka
1138 The responder uses a hardcoded certificate based on a 1024-bit RSA key.
1139 This certificate additionally serves as CA certificate. A peer uses the same
1140 private key, but generates client certificates on demand signed by the CA
1141 certificate. Install the Responder/CA certificate on the remote host to
1142 authenticate all clients.
1144 To speed up testing, the load tester plugin implements a special Diffie-Hellman
1145 implementation called modpnull. By setting
1147 proposal = aes128-sha1-modpnull
1149 this wicked fast DH implementation is used. It does not provide any security
1150 at all, but allows to run tests without DH calculation overhead.
1153 In the simplest case, the daemon initiates IKE_SAs against itself using the
1154 loopback interface. This will actually establish double the number of IKE_SAs,
1155 as the daemon is initiator and responder for each IKE_SA at the same time.
1156 Installation of IPsec SAs would fails, as each SA gets installed twice. To
1157 simulate the correct behavior, a fake kernel interface can be enabled which does
1158 not install the IPsec SAs at the kernel level.
1160 A simple loopback configuration might look like this:
1164 # create new IKE_SAs for each CHILD_SA to simulate
1167 # turn off denial of service protection
1174 # use 4 threads to initiate connections
1177 # each thread initiates 1000 connections
1179 # delay each initiation in each thread by 20ms
1181 # enable the fake kernel interface to
1182 # avoid SA conflicts
1189 This will initiate 4000 IKE_SAs within 20 seconds. You may increase the delay
1190 value if your box can not handle that much load, or decrease it to put more
1191 load on it. If the daemon starts retransmitting messages your box probably can
1192 not handle all connection attempts.
1194 The plugin also allows to test against a remote host. This might help to test
1195 against a real world configuration. A connection setup to do stress testing of
1196 a gateway might look like this:
1206 # 10000 connections, ten in parallel
1209 # use a delay of 100ms, overall time is:
1210 # iterations * delay = 100s
1212 # address of the gateway
1214 # IKE-proposal to use
1215 proposal = aes128-sha1-modp1024
1216 # use faster PSK authentication instead
1218 initiator_auth = psk
1219 responder_auth = psk
1220 # request a virtual IP using configuration
1222 request_virtual_ip = yes
1223 # enable CHILD_SA every 60s
1230 .SH IKEv2 RETRANSMISSION
1231 Retransmission timeouts in the IKEv2 daemon charon can be configured globally
1232 using the three keys listed below:
1236 .BR charon.retransmit_base " [1.8]"
1237 .BR charon.retransmit_timeout " [4.0]"
1238 .BR charon.retransmit_tries " [5]"
1242 The following algorithm is used to calculate the timeout:
1245 relative timeout = retransmit_timeout * retransmit_base ^ (n-1)
1250 is the current retransmission count.
1252 Using the default values, packets are retransmitted in:
1258 Retransmission Relative Timeout Absolute Timeout
1268 /etc/strongswan.conf
1271 ipsec.conf(5), ipsec.secrets(5), ipsec(8)
1274 .UR http://www.strongswan.org
1277 by Tobias Brunner, Andreas Steffen and Martin Willi.