1 .TH STRONGSWAN.CONF 5 "2012-05-01" "@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.
132 Path to database with file measurement information
135 Plugins to load in ipsec attest tool
138 .BR charon.block_threshold " [5]"
139 Maximum number of half-open IKE_SAs for a single peer IP
141 .BR charon.close_ike_on_child_failure " [no]"
142 Close the IKE_SA if setup of the CHILD_SA along with IKE_AUTH failed
144 .BR charon.cookie_threshold " [10]"
145 Number of half-open IKE_SAs that activate the cookie mechanism
150 DNS servers assigned to peer via configuration payload (CP)
152 .BR charon.dos_protection " [yes]"
153 Enable Denial of Service protection using cookies and aggressiveness checks
156 Section to define file loggers, see LOGGER CONFIGURATION
158 .BR charon.flush_auth_cfg " [no]"
161 .BR charon.half_open_timeout " [30]"
162 Timeout in seconds for connecting IKE_SAs (also see IKE_SA_INIT DROPPING).
164 .BR charon.hash_and_url " [no]"
165 Enable hash and URL support
167 .BR charon.ignore_routing_tables
168 A list of routing tables to be excluded from route lookup
170 .BR charon.ikesa_table_segments " [1]"
171 Number of exclusively locked segments in the hash table
173 .BR charon.ikesa_table_size " [1]"
174 Size of the IKE_SA hash table
176 .BR charon.inactivity_close_ike " [no]"
177 Whether to close IKE_SA if the only CHILD_SA closed due to inactivity
179 .BR charon.init_limit_half_open " [0]"
180 Limit new connections based on the current number of half open IKE_SAs (see
181 IKE_SA_INIT DROPPING).
183 .BR charon.init_limit_job_load " [0]"
184 Limit new connections based on the number of jobs currently queued for
185 processing (see IKE_SA_INIT DROPPING).
187 .BR charon.install_routes " [yes]"
188 Install routes into a separate routing table for established IPsec tunnels
190 .BR charon.install_virtual_ip " [yes]"
191 Install virtual IP addresses
193 .BR charon.keep_alive " [20s]"
194 NAT keep alive interval
197 Plugins to load in the IKEv2 daemon charon
199 .BR charon.max_packet " [10000]"
200 Maximum packet size accepted by charon
202 .BR charon.multiple_authentication " [yes]"
203 Enable multiple authentication exchanges (RFC 4739)
208 WINS servers assigned to peer via configuration payload (CP)
210 .BR charon.process_route " [yes]"
211 Process RTM_NEWROUTE and RTM_DELROUTE events
213 .BR charon.receive_delay " [0]"
214 Delay for receiving packets, to simulate larger RTT
216 .BR charon.receive_delay_response " [yes]"
217 Delay response messages
219 .BR charon.receive_delay_request " [yes]"
220 Delay request messages
222 .BR charon.receive_delay_type " [0]"
223 Specific IKEv2 message type to delay, 0 for any
225 .BR charon.replay_window " [32]"
226 Size of the AH/ESP replay window, in packets.
228 .BR charon.retransmit_base " [1.8]"
229 Base to use for calculating exponential back off, see IKEv2 RETRANSMISSION
231 .BR charon.retransmit_timeout " [4.0]
232 Timeout in seconds before sending first retransmit
234 .BR charon.retransmit_tries " [5]"
235 Number of times to retransmit a packet before giving up
237 .BR charon.reuse_ikesa " [yes]
238 Initiate CHILD_SA within existing IKE_SAs
240 .BR charon.routing_table
241 Numerical routing table to install routes to
243 .BR charon.routing_table_prio
244 Priority of the routing table
246 .BR charon.send_delay " [0]"
247 Delay for sending packets, to simulate larger RTT
249 .BR charon.send_delay_response " [yes]"
250 Delay response messages
252 .BR charon.send_delay_request " [yes]"
253 Delay request messages
255 .BR charon.send_delay_type " [0]"
256 Specific IKEv2 message type to delay, 0 for any
258 .BR charon.send_vendor_id " [no]
259 Send strongSwan vendor ID payload
262 Section to define syslog loggers, see LOGGER CONFIGURATION
264 .BR charon.threads " [16]"
265 Number of worker threads in charon
266 .SS charon.plugins subsection
268 .BR charon.plugins.android.loglevel " [1]"
269 Loglevel for logging to Android specific logger
271 .BR charon.plugins.attr
272 Section to specify arbitrary attributes that are assigned to a peer via
273 configuration payload (CP)
275 .BR charon.plugins.dhcp.identity_lease " [no]"
276 Derive user-defined MAC address from hash of IKEv2 identity
278 .BR charon.plugins.dhcp.server " [255.255.255.255]"
279 DHCP server unicast or broadcast IP address
281 .BR charon.plugins.duplicheck.enable " [yes]"
282 enable loaded duplicheck plugin
284 .BR charon.plugins.eap-aka.request_identity " [yes]"
287 .BR charon.plugins.eap-aka-3ggp2.seq_check
290 .BR charon.plugins.eap-gtc.pam_service " [login]"
291 PAM service to be used for authentication
294 .BR charon.plugins.eap-peap.fragment_size " [1024]"
295 Maximum size of an EAP-PEAP packet
297 .BR charon.plugins.eap-peap.max_message_count " [32]"
298 Maximum number of processed EAP-PEAP packets
300 .BR charon.plugins.eap-peap.include_length " [no]"
301 Include length in non-fragmented EAP-PEAP packets
303 .BR charon.plugins.eap-peap.phase2_method " [mschapv2]"
304 Phase2 EAP client authentication method
306 .BR charon.plugins.eap-peap.phase2_piggyback " [no]"
307 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
309 .BR charon.plugins.eap-peap.phase2_tnc " [no]"
310 Start phase2 EAP TNC protocol after successful client authentication
312 .BR charon.plugins.eap-peap.request_peer_auth " [no]"
313 Request peer authentication based on a client certificate
316 .BR charon.plugins.eap-radius.accounting " [no]"
317 Send RADIUS accounting information to RADIUS servers.
319 .BR charon.plugins.eap-radius.class_group " [no]"
322 attribute sent in the RADIUS-Accept message as group membership information that
323 is compared to the groups specified in the
328 .BR charon.plugins.eap-radius.eap_start " [no]"
329 Send EAP-Start instead of EAP-Identity to start RADIUS conversation
331 .BR charon.plugins.eap-radius.filter_id " [no]"
338 attribute sent in the RADIUS-Accept message as group membership information that
339 is compared to the groups specified in the
344 .BR charon.plugins.eap-radius.id_prefix
345 Prefix to EAP-Identity, some AAA servers use a IMSI prefix to select the
348 .BR charon.plugins.eap-radius.nas_identifier " [strongSwan]"
349 NAS-Identifier to include in RADIUS messages
351 .BR charon.plugins.eap-radius.port " [1812]"
352 Port of RADIUS server (authentication)
354 .BR charon.plugins.eap-radius.secret
355 Shared secret between RADIUS and NAS
357 .BR charon.plugins.eap-radius.server
358 IP/Hostname of RADIUS server
360 .BR charon.plugins.eap-radius.servers
361 Section to specify multiple RADIUS servers. The
367 options can be specified for each server. A server's IP/Hostname can be
370 option. For each RADIUS server a priority can be specified using the
371 .BR preference " [0]"
374 .BR charon.plugins.eap-radius.sockets " [1]"
375 Number of sockets (ports) to use, increase for high load
377 .BR charon.plugins.eap-sim.request_identity " [yes]"
380 .BR charon.plugins.eap-simaka-sql.database
383 .BR charon.plugins.eap-simaka-sql.remove_used
386 .BR charon.plugins.eap-tls.fragment_size " [1024]"
387 Maximum size of an EAP-TLS packet
389 .BR charon.plugins.eap-tls.max_message_count " [32]"
390 Maximum number of processed EAP-TLS packets
392 .BR charon.plugins.eap-tls.include_length " [yes]"
393 Include length in non-fragmented EAP-TLS packets
395 .BR charon.plugins.eap-tnc.fragment_size " [50000]"
396 Maximum size of an EAP-TNC packet
398 .BR charon.plugins.eap-tnc.max_message_count " [10]"
399 Maximum number of processed EAP-TNC packets
401 .BR charon.plugins.eap-tnc.include_length " [yes]"
402 Include length in non-fragmented EAP-TNC packets
404 .BR charon.plugins.eap-ttls.fragment_size " [1024]"
405 Maximum size of an EAP-TTLS packet
407 .BR charon.plugins.eap-ttls.max_message_count " [32]"
408 Maximum number of processed EAP-TTLS packets
410 .BR charon.plugins.eap-ttls.include_length " [yes]"
411 Include length in non-fragmented EAP-TTLS packets
413 .BR charon.plugins.eap-ttls.phase2_method " [md5]"
414 Phase2 EAP client authentication method
416 .BR charon.plugins.eap-ttls.phase2_piggyback " [no]"
417 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
419 .BR charon.plugins.eap-ttls.phase2_tnc " [no]"
420 Start phase2 EAP TNC protocol after successful client authentication
422 .BR charon.plugins.eap-ttls.request_peer_auth " [no]"
423 Request peer authentication based on a client certificate
425 .BR charon.plugins.ha.fifo_interface " [yes]"
428 .BR charon.plugins.ha.heartbeat_delay " [1000]"
431 .BR charon.plugins.ha.heartbeat_timeout " [2100]"
434 .BR charon.plugins.ha.local
437 .BR charon.plugins.ha.monitor " [yes]"
440 .BR charon.plugins.ha.pools
443 .BR charon.plugins.ha.remote
446 .BR charon.plugins.ha.resync " [yes]"
449 .BR charon.plugins.ha.secret
452 .BR charon.plugins.ha.segment_count " [1]"
455 .BR charon.plugins.led.activity_led
458 .BR charon.plugins.led.blink_time " [50]"
461 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
462 Number of ipsecN devices
464 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
465 Set MTU of ipsecN device
467 .BR charon.plugins.load-tester
468 Section to configure the load-tester plugin, see LOAD TESTS
470 .BR charon.plugins.radattr.dir
471 Directory where RADIUS attributes are stored in client-ID specific files.
473 .BR charon.plugins.radattr.message_id " [-1]"
474 Attributes are added to all IKE_AUTH messages by default (-1), or only to the
475 IKE_AUTH message with the given IKEv2 message ID.
477 .BR charon.plugins.resolve.file " [/etc/resolv.conf]"
478 File where to add DNS server entries
480 .BR charon.plugins.resolve.resolvconf.iface_prefix " [lo.inet.ipsec.]"
481 Prefix used for interface names sent to resolvconf(8). The nameserver address
482 is appended to this prefix to make it unique. The result has to be a valid
483 interface name according to the rules defined by resolvconf. Also, it should
484 have a high priority according to the order defined in interface-order(5).
486 .BR charon.plugins.sql.database
487 Database URI for charons SQL plugin
489 .BR charon.plugins.sql.loglevel " [-1]"
490 Loglevel for logging to SQL database
492 .BR charon.plugins.stroke.ignore_missing_ca_basic_constraint " [no]"
493 Treat certificates in ipsec.d/cacerts and ipsec.conf ca sections as CA
494 certificates even if they don't contain a CA basic constraint.
496 .BR charon.plugins.stroke.max_concurrent " [4]"
497 Maximum number of stroke messages handled concurrently
499 .BR charon.plugins.tnc-ifmap.device_name
500 Unique name of strongSwan as a PEP and/or PDP device
502 .BR charon.plugins.tnc-ifmap.key_file
503 Concatenated client certificate and private key
505 .BR charon.plugins.tnc-ifmap.password
506 Authentication password of strongSwan MAP client
508 .BR charon.plugins.tnc-ifmap.server_cert
509 Certificate of MAP server
511 .BR charon.plugins.tnc-ifmap.ssl_passphrase
512 Passphrase protecting the private key
514 .BR charon.plugins.tnc-ifmap.username
515 Authentication username of strongSwan MAP client
517 .BR charon.plugins.tnc-imc.preferred_language " [en]"
518 Preferred language for TNC recommendations
520 .BR charon.plugins.tnc-pdp.method " [ttls]"
521 EAP tunnel method to be used
523 .BR charon.plugins.tnc-pdp.port " [1812]"
524 RADIUS server port the strongSwan PDP is listening on
526 .BR charon.plugins.tnc-pdp.secret
527 Shared RADIUS secret between strongSwan PDP and NAS
529 .BR charon.plugins.tnc-pdp.server
530 name of the strongSwan PDP as contained in the AAA certificate
532 .BR charon.plugins.whitelist.enable " [yes]"
533 enable loaded whitelist plugin
534 .SS libstrongswan section
536 .BR libstrongswan.crypto_test.bench " [no]"
539 .BR libstrongswan.crypto_test.bench_size " [1024]"
542 .BR libstrongswan.crypto_test.bench_time " [50]"
545 .BR libstrongswan.crypto_test.on_add " [no]"
546 Test crypto algorithms during registration
548 .BR libstrongswan.crypto_test.on_create " [no]"
549 Test crypto algorithms on each crypto primitive instantiation
551 .BR libstrongswan.crypto_test.required " [no]"
552 Strictly require at least one test vector to enable an algorithm
554 .BR libstrongswan.crypto_test.rng_true " [no]"
555 Whether to test RNG with TRUE quality; requires a lot of entropy
557 .BR libstrongswan.dh_exponent_ansi_x9_42 " [yes]"
558 Use ANSI X9.42 DH exponent size or optimum size matched to cryptographical
561 .BR libstrongswan.ecp_x_coordinate_only " [yes]"
562 Compliance with the errata for RFC 4753
564 .BR libstrongswan.integrity_test " [no]"
565 Check daemon, libstrongswan and plugin integrity at startup
567 .BR libstrongswan.leak_detective.detailed " [yes]"
568 Includes source file names and line numbers in leak detective output
570 .BR libstrongswan.processor.priority_threads
571 Subsection to configure the number of reserved threads per priority class
572 see JOB PRIORITY MANAGEMENT
574 .BR libstrongswan.x509.enforce_critical " [yes]"
575 Discard certificates with unsupported or unknown critical extensions
576 .SS libstrongswan.plugins subsection
578 .BR libstrongswan.plugins.attr-sql.database
579 Database URI for attr-sql plugin used by charon and pluto
581 .BR libstrongswan.plugins.attr-sql.lease_history " [yes]"
582 Enable logging of SQL IP pool leases
584 .BR libstrongswan.plugins.gcrypt.quick_random " [no]"
585 Use faster random numbers in gcrypt; for testing only, produces weak keys!
587 .BR libstrongswan.plugins.openssl.engine_id " [pkcs11]"
588 ENGINE ID to use in the OpenSSL plugin
590 .BR libstrongswan.plugins.pkcs11.modules
591 List of available PKCS#11 modules
593 .BR libstrongswan.plugins.pkcs11.use_dh " [no]"
594 Whether the PKCS#11 modules should be used for DH and ECDH (see use_ecc option)
596 .BR libstrongswan.plugins.pkcs11.use_ecc " [no]"
597 Whether the PKCS#11 modules should be used for ECDH and ECDSA public key
598 operations. ECDSA private keys can be used regardless of this option
600 .BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
601 Whether the PKCS#11 modules should be used to hash data
603 .BR libstrongswan.plugins.pkcs11.use_pubkey " [no]"
604 Whether the PKCS#11 modules should be used for public key operations, even for
605 keys not stored on tokens
607 .BR libstrongswan.plugins.pkcs11.use_rng " [no]"
608 Whether the PKCS#11 modules should be used as RNG
611 .BR libtnccs.tnc_config " [/etc/tnc_config]"
612 TNC IMC/IMV configuration directory
615 .BR libimcv.debug_level " [1]"
616 Debug level for a stand-alone libimcv library
618 .BR libimcv.stderr_quiet " [no]"
619 Disable output to stderr with a stand-alone libimcv library
620 .SS libimcv plugins section
622 .BR libimcv.plugins.imc-attestation.platform_info
623 Information on operating system and hardware platform
625 .BR libimcv.plugins.imc-attestation.aik_blob
626 AIK encrypted private key blob file
628 .BR libimcv.plugins.imc-attestation.aik_cert
631 .BR libimcv.plugins.imc-attestation.aik_key
634 .BR libimcv.plugins.imv-attestation.nonce_len " [20]"
637 .BR libimcv.plugins.imv-attestation.use_quote2 " [yes]"
638 Use Quote2 AIK signature instead of Quote signature
640 .BR libimcv.plugins.imv-attestation.cadir
641 Path to directory with AIK cacerts
643 .BR libimcv.plugins.imv-attestation.database
644 Path to database with file measurement information
646 .BR libimcv.plugins.imv-attestation.dh_group " [ecp256]"
647 Preferred Diffie-Hellman group
649 .BR libimcv.plugins.imv-attestation.hash_algorithm " [sha256]"
650 Preferred measurement hash algorithm
652 .BR libimcv.plugins.imv-attestation.min_nonce_len " [0]"
653 DH minimum nonce length
655 .BR libimcv.plugins.imv-attestation.platform_info
656 Information on operating system and hardware platform
658 .BR libimcv.plugins.imv-scanner.closed_port_policy " [yes]"
659 By default all ports must be closed (yes) or can be open (no)
661 .BR libimcv.plugins.imv-scanner.tcp_ports
662 List of TCP ports that can be open or must be closed
664 .BR libimcv.plugins.imv-scanner.udp_ports
665 List of UDP ports that can be open or must be closed
667 .BR libimcv.plugins.imc-test.additional_ids " [0]"
668 Number of additional IMC IDs
670 .BR libimcv.plugins.imc-test.command " [none]"
671 Command to be sent to the Test IMV
673 .BR libimcv.plugins.imc-test.retry " [no]"
676 .BR libimcv.plugins.imc-test.retry_command
677 Command to be sent to the Test IMV in the handshake retry
679 .BR libimcv.plugins.imv-test.rounds " [0]"
680 Number of IMC-IMV retry rounds
684 List of TLS encryption ciphers
686 .BR libtls.key_exchange
687 List of TLS key exchange methods
690 List of TLS MAC algorithms
693 List of TLS cipher suites
697 Credential database URI for manager
699 .BR manager.debug " [no]"
700 Enable debugging in manager
703 Plugins to load in manager
706 FastCGI socket of manager, to run it statically
708 .BR manager.threads " [10]"
709 Threads to use for request handling
711 .BR manager.timeout " [15m]"
712 Session timeout for manager
713 .SS mediation client section
716 Mediation client database URI
718 .BR medcli.dpd " [5m]"
719 DPD timeout to use in mediation client plugin
721 .BR medcli.rekey " [20m]"
722 Rekeying time on mediation connections in mediation client plugin
723 .SS mediation server section
726 Mediation server database URI
728 .BR medsrv.debug " [no]"
729 Debugging in mediation server web application
731 .BR medsrv.dpd " [5m]"
732 DPD timeout to use in mediation server plugin
735 Plugins to load in mediation server plugin
737 .BR medsrv.password_length " [6]"
738 Minimum password length required for mediation server user accounts
740 .BR medsrv.rekey " [20m]"
741 Rekeying time on mediation connections in mediation server plugin
744 Run Mediation server web application statically on socket
746 .BR medsrv.threads " [5]"
747 Number of thread for mediation service web application
749 .BR medsrv.timeout " [15m]"
750 Session timeout for mediation service
754 Plugins to load in ipsec openac tool
758 Plugins to load in ipsec pki tool
764 DNS servers assigned to peer via Mode Config
767 Plugins to load in IKEv1 pluto daemon
772 WINS servers assigned to peer via Mode Config
774 .BR pluto.threads " [4]"
775 Number of worker threads in pluto
776 .SS pluto.plugins section
778 .BR pluto.plugins.attr
779 Section to specify arbitrary attributes that are assigned to a peer via
782 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
783 Number of ipsecN devices
785 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
786 Set MTU of ipsecN device
790 Plugins to load in ipsec pool tool
791 .SS scepclient section
794 Plugins to load in ipsec scepclient tool
798 Plugins to load in starter
800 .BR starter.load_warning " [yes]"
801 Disable charon/pluto plugin load option warning
803 .SH LOGGER CONFIGURATION
804 The options described below provide a much more flexible way to configure
805 loggers for the IKEv2 daemon charon than using the
811 that if any loggers are specified in strongswan.conf,
813 does not have any effect.
815 There are currently two types of loggers defined:
818 Log directly to a file and are defined by specifying the full path to the
819 file as subsection in the
821 section. To log to the console the two special filenames
822 .BR stdout " and " stderr
826 Log into a syslog facility and are defined by specifying the facility to log to
827 as the name of a subsection in the
829 section. The following facilities are currently supported:
830 .BR daemon " and " auth .
832 Multiple loggers can be defined for each type with different log verbosity for
833 the different subsystems of the daemon.
836 .BR charon.filelog.<filename>.default " [1]"
838 .BR charon.syslog.<facility>.default
839 Specifies the default loglevel to be used for subsystems for which no specific
842 .BR charon.filelog.<filename>.<subsystem> " [<default>]"
844 .BR charon.syslog.<facility>.<subsystem>
845 Specifies the loglevel for the given subsystem.
847 .BR charon.filelog.<filename>.append " [yes]"
848 If this option is enabled log entries are appended to the existing file.
850 .BR charon.filelog.<filename>.flush_line " [no]"
851 Enabling this option disables block buffering and enables line buffering.
853 .BR charon.filelog.<filename>.ike_name " [no]"
855 .BR charon.syslog.<facility>.ike_name
856 Prefix each log entry with the connection name and a unique numerical
857 identifier for each IKE_SA.
859 .BR charon.filelog.<filename>.time_format
860 Prefix each log entry with a timestamp. The option accepts a format string as
864 .BR charon.syslog.identifier
865 Global identifier used for an
867 call, prepended to each log message by syslog. If not configured,
869 is not called, so the value will depend on system defaults (often the program
875 Main daemon setup/cleanup/signal handling
878 IKE_SA manager, handling synchronization for IKE_SA access
887 Jobs queueing/processing and thread pool management
890 Configuration management and plugins
893 IPsec/Networking kernel interface
896 IKE network communication
899 Low-level encoding/decoding (ASN.1, X.509 etc.)
902 Packet encoding/decoding encryption/decryption operations
905 libtls library messages
908 libstrongwan library messages
911 Trusted Network Connect
914 Integrity Measurement Collector
917 Integrity Measurement Verifier
920 Platform Trust Service
927 Very basic auditing logs, (e.g. SA up/SA down)
930 Generic control flow with errors, a good default to see whats going on
933 More detailed debugging control flow
936 Including RAW data dumps in Hex
939 Also include sensitive material in dumps, e.g. keys
945 /var/log/charon.log {
946 time_format = %b %e %T
957 # enable logging to LOG_DAEMON, use defaults
960 # minimalistic IKE auditing logging to LOG_AUTHPRIV
969 .SH JOB PRIORITY MANAGEMENT
970 Some operations in the IKEv2 daemon charon are currently implemented
971 synchronously and blocking. Two examples for such operations are communication
972 with a RADIUS server via EAP-RADIUS, or fetching CRL/OCSP information during
973 certificate chain verification. Under high load conditions, the thread pool may
974 run out of available threads, and some more important jobs, such as liveness
975 checking, may not get executed in time.
977 To prevent thread starvation in such situations job priorities were introduced.
978 The job processor will reserve some threads for higher priority jobs, these
979 threads are not available for lower priority, locking jobs.
981 Currently 4 priorities have been defined, and they are used in charon as
985 Priority for long-running dispatcher jobs.
988 INFORMATIONAL exchanges, as used by liveness checking (DPD).
991 Everything not HIGH/LOW, including IKE_SA_INIT processing.
994 IKE_AUTH message processing. RADIUS and CRL fetching block here
996 Although IKE_SA_INIT processing is computationally expensive, it is explicitly
997 assigned to the MEDIUM class. This allows charon to do the DH exchange while
998 other threads are blocked in IKE_AUTH. To prevent the daemon from accepting more
999 IKE_SA_INIT requests than it can handle, use IKE_SA_INIT DROPPING.
1001 The thread pool processes jobs strictly by priority, meaning it will consume all
1002 higher priority jobs before looking for ones with lower priority. Further, it
1003 reserves threads for certain priorities. A priority class having reserved
1005 threads will always have
1007 threads available for this class (either currently processing a job, or waiting
1010 To ensure that there are always enough threads available for higher priority
1011 tasks, threads must be reserved for each priority class.
1013 .BR libstrongswan.processor.priority_threads.critical " [0]"
1014 Threads reserved for CRITICAL priority class jobs
1016 .BR libstrongswan.processor.priority_threads.high " [0]"
1017 Threads reserved for HIGH priority class jobs
1019 .BR libstrongswan.processor.priority_threads.medium " [0]"
1020 Threads reserved for MEDIUM priority class jobs
1022 .BR libstrongswan.processor.priority_threads.low " [0]"
1023 Threads reserved for LOW priority class jobs
1025 Let's consider the following configuration:
1038 With this configuration, one thread is reserved for HIGH priority tasks. As
1039 currently only liveness checking and stroke message processing is done with
1040 high priority, one or two threads should be sufficient.
1042 The MEDIUM class mostly processes non-blocking jobs. Unless your setup is
1043 experiencing many blocks in locks while accessing shared resources, threads for
1044 one or two times the number of CPU cores is fine.
1046 It is usually not required to reserve threads for CRITICAL jobs. Jobs in this
1047 class rarely return and do not release their thread to the pool.
1049 The remaining threads are available for LOW priority jobs. Reserving threads
1050 does not make sense (until we have an even lower priority).
1052 To see what the threads are actually doing, invoke
1053 .IR "ipsec statusall" .
1054 Under high load, something like this will show up:
1057 worker threads: 2 or 32 idle, 5/1/2/22 working,
1058 job queue: 0/0/1/149, scheduled: 198
1061 From 32 worker threads,
1065 are running CRITICAL priority jobs (dispatching from sockets, etc.).
1067 is currently handling a HIGH priority job. This is actually the thread currently
1068 providing this information via stroke.
1070 are handling MEDIUM priority jobs, likely IKE_SA_INIT or CREATE_CHILD_SA
1073 are handling LOW priority jobs, probably waiting for an EAP-RADIUS response
1074 while processing IKE_AUTH messages.
1076 The job queue load shows how many jobs are queued for each priority, ready for
1077 execution. The single MEDIUM priority job will get executed immediately, as
1078 we have two spare threads reserved for MEDIUM class jobs.
1080 .SH IKE_SA_INIT DROPPING
1081 If a responder receives more connection requests per seconds than it can handle,
1082 it does not make sense to accept more IKE_SA_INIT messages. And if they are
1083 queued but can't get processed in time, an answer might be sent after the
1084 client has already given up and restarted its connection setup. This
1085 additionally increases the load on the responder.
1087 To limit the responder load resulting from new connection attempts, the daemon
1088 can drop IKE_SA_INIT messages just after reception. There are two mechanisms to
1089 decide if this should happen, configured with the following options:
1091 .BR charon.init_limit_half_open " [0]"
1092 Limit based on the number of half open IKE_SAs. Half open IKE_SAs are SAs in
1093 connecting state, but not yet established.
1095 .BR charon.init_limit_job_load " [0]"
1096 Limit based on the number of jobs currently queued for processing (sum over all
1099 The second limit includes load from other jobs, such as rekeying. Choosing a
1100 good value is difficult and depends on the hardware and expected load.
1102 The first limit is simpler to calculate, but includes the load from new
1103 connections only. If your responder is capable of negotiating 100 tunnels/s, you
1104 might set this limit to 1000. The daemon will then drop new connection attempts
1105 if generating a response would require more than 10 seconds. If you are
1106 allowing for a maximum response time of more than 30 seconds, consider adjusting
1107 the timeout for connecting IKE_SAs
1108 .RB ( charon.half_open_timeout ).
1109 A responder, by default, deletes an IKE_SA if the initiator does not establish
1110 it within 30 seconds. Under high load, a higher value might be required.
1113 To do stability testing and performance optimizations, the IKEv2 daemon charon
1114 provides the load-tester plugin. This plugin allows to setup thousands of
1115 tunnels concurrently against the daemon itself or a remote host.
1118 Never enable the load-testing plugin on productive systems. It provides
1119 preconfigured credentials and allows an attacker to authenticate as any user.
1122 .BR charon.plugins.load-tester.child_rekey " [600]"
1123 Seconds to start CHILD_SA rekeying after setup
1125 .BR charon.plugins.load-tester.delay " [0]"
1126 Delay between initiatons for each thread
1128 .BR charon.plugins.load-tester.delete_after_established " [no]"
1129 Delete an IKE_SA as soon as it has been established
1131 .BR charon.plugins.load-tester.dpd_delay " [0]"
1132 DPD delay to use in load test
1134 .BR charon.plugins.load-tester.dynamic_port " [0]"
1135 Base port to be used for requests (each client uses a different port)
1137 .BR charon.plugins.load-tester.eap_password " [default-pwd]"
1138 EAP secret to use in load test
1140 .BR charon.plugins.load-tester.enable " [no]"
1141 Enable the load testing plugin
1143 .BR charon.plugins.load-tester.fake_kernel " [no]"
1144 Fake the kernel interface to allow load-testing against self
1146 .BR charon.plugins.load-tester.ike_rekey " [0]"
1147 Seconds to start IKE_SA rekeying after setup
1149 .BR charon.plugins.load-tester.init_limit " [0]"
1150 Global limit of concurrently established SAs during load test
1152 .BR charon.plugins.load-tester.initiators " [0]"
1153 Number of concurrent initiator threads to use in load test
1155 .BR charon.plugins.load-tester.initiator_auth " [pubkey]"
1156 Authentication method(s) the intiator uses
1158 .BR charon.plugins.load-tester.initiator_id
1159 Initiator ID used in load test
1161 .BR charon.plugins.load-tester.iterations " [1]"
1162 Number of IKE_SAs to initate by each initiator in load test
1164 .BR charon.plugins.load-tester.pool
1165 Provide INTERNAL_IPV4_ADDRs from a named pool
1167 .BR charon.plugins.load-tester.preshared_key " [default-psk]"
1168 Preshared key to use in load test
1170 .BR charon.plugins.load-tester.proposal " [aes128-sha1-modp768]"
1171 IKE proposal to use in load test
1173 .BR charon.plugins.load-tester.remote " [127.0.0.1]"
1174 Address to initiation connections to
1176 .BR charon.plugins.load-tester.responder_auth " [pubkey]"
1177 Authentication method(s) the responder uses
1179 .BR charon.plugins.load-tester.responder_id
1180 Responder ID used in load test
1182 .BR charon.plugins.load-tester.request_virtual_ip " [no]"
1183 Request an INTERNAL_IPV4_ADDR from the server
1185 .BR charon.plugins.load-tester.shutdown_when_complete " [no]"
1186 Shutdown the daemon after all IKE_SAs have been established
1187 .SS Configuration details
1188 For public key authentication, the responder uses the
1189 .B \(dqCN=srv, OU=load-test, O=strongSwan\(dq
1190 identity. For the initiator, each connection attempt uses a different identity
1192 .BR "\(dqCN=c1-r1, OU=load-test, O=strongSwan\(dq" ,
1193 where the first number inidicates the client number, the second the
1194 authentication round (if multiple authentication is used).
1196 For PSK authentication, FQDN identities are used. The server uses
1197 .BR srv.strongswan.org ,
1198 the client uses an identity in the form
1199 .BR c1-r1.strongswan.org .
1201 For EAP authentication, the client uses a NAI in the form
1202 .BR 100000000010001@strongswan.org .
1204 To configure multiple authentication, concatenate multiple methods using, e.g.
1206 initiator_auth = pubkey|psk|eap-md5|eap-aka
1209 The responder uses a hardcoded certificate based on a 1024-bit RSA key.
1210 This certificate additionally serves as CA certificate. A peer uses the same
1211 private key, but generates client certificates on demand signed by the CA
1212 certificate. Install the Responder/CA certificate on the remote host to
1213 authenticate all clients.
1215 To speed up testing, the load tester plugin implements a special Diffie-Hellman
1216 implementation called modpnull. By setting
1218 proposal = aes128-sha1-modpnull
1220 this wicked fast DH implementation is used. It does not provide any security
1221 at all, but allows to run tests without DH calculation overhead.
1224 In the simplest case, the daemon initiates IKE_SAs against itself using the
1225 loopback interface. This will actually establish double the number of IKE_SAs,
1226 as the daemon is initiator and responder for each IKE_SA at the same time.
1227 Installation of IPsec SAs would fails, as each SA gets installed twice. To
1228 simulate the correct behavior, a fake kernel interface can be enabled which does
1229 not install the IPsec SAs at the kernel level.
1231 A simple loopback configuration might look like this:
1235 # create new IKE_SAs for each CHILD_SA to simulate
1238 # turn off denial of service protection
1245 # use 4 threads to initiate connections
1248 # each thread initiates 1000 connections
1250 # delay each initiation in each thread by 20ms
1252 # enable the fake kernel interface to
1253 # avoid SA conflicts
1260 This will initiate 4000 IKE_SAs within 20 seconds. You may increase the delay
1261 value if your box can not handle that much load, or decrease it to put more
1262 load on it. If the daemon starts retransmitting messages your box probably can
1263 not handle all connection attempts.
1265 The plugin also allows to test against a remote host. This might help to test
1266 against a real world configuration. A connection setup to do stress testing of
1267 a gateway might look like this:
1277 # 10000 connections, ten in parallel
1280 # use a delay of 100ms, overall time is:
1281 # iterations * delay = 100s
1283 # address of the gateway
1285 # IKE-proposal to use
1286 proposal = aes128-sha1-modp1024
1287 # use faster PSK authentication instead
1289 initiator_auth = psk
1290 responder_auth = psk
1291 # request a virtual IP using configuration
1293 request_virtual_ip = yes
1294 # enable CHILD_SA every 60s
1301 .SH IKEv2 RETRANSMISSION
1302 Retransmission timeouts in the IKEv2 daemon charon can be configured globally
1303 using the three keys listed below:
1307 .BR charon.retransmit_base " [1.8]"
1308 .BR charon.retransmit_timeout " [4.0]"
1309 .BR charon.retransmit_tries " [5]"
1313 The following algorithm is used to calculate the timeout:
1316 relative timeout = retransmit_timeout * retransmit_base ^ (n-1)
1321 is the current retransmission count.
1323 Using the default values, packets are retransmitted in:
1329 Retransmission Relative Timeout Absolute Timeout
1339 /etc/strongswan.conf
1342 ipsec.conf(5), ipsec.secrets(5), ipsec(8)
1345 .UR http://www.strongswan.org
1348 by Tobias Brunner, Andreas Steffen and Martin Willi.