1 .TH STRONGSWAN.CONF 5 "2010-09-09" "@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.
64 Values are accessed using a dot-separated section list and a key.
65 With reference to the example above, accessing
66 .B section-one.subsection.othervalue
71 The following keys are currently defined (using dot notation). The default
72 value (if any) is listed in brackets after the key.
76 .BR charon.block_threshold " [5]"
77 Maximum number of half-open IKE_SAs for a single peer IP
79 .BR charon.close_ike_on_child_failure " [no]"
80 Close the IKE_SA if setup of the CHILD_SA along with IKE_AUTH failed
82 .BR charon.cookie_threshold " [10]"
83 Number of half-open IKE_SAs that activate the cookie mechanism
88 DNS servers assigned to peer via configuration payload (CP)
90 .BR charon.dos_protection " [yes]"
91 Enable Denial of Service protection using cookies and aggressiveness checks
94 Section to define file loggers, see LOGGER CONFIGURATION
96 .BR charon.flush_auth_cfg " [no]"
99 .BR charon.hash_and_url " [no]"
100 Enable hash and URL support
102 .BR charon.ignore_routing_tables
103 A list of routing tables to be excluded from route lookup
105 .BR charon.ikesa_table_segments " [1]"
106 Number of exclusively locked segments in the hash table
108 .BR charon.ikesa_table_size " [1]"
109 Size of the IKE_SA hash table
111 .BR charon.inactivity_close_ike " [no]"
112 Whether to close IKE_SA if the only CHILD_SA closed due to inactivity
114 .BR charon.install_routes " [yes]"
115 Install routes into a separate routing table for established IPsec tunnels
117 .BR charon.install_virtual_ip " [yes]"
118 Install virtual IP addresses
120 .BR charon.keep_alive " [20s]"
121 NAT keep alive interval
124 Plugins to load in the IKEv2 daemon charon
126 .BR charon.max_packet " [10000]"
127 Maximum packet size accepted by charon
129 .BR charon.multiple_authentication " [yes]"
130 Enable multiple authentication exchanges (RFC 4739)
135 WINS servers assigned to peer via configuration payload (CP)
137 .BR charon.process_route " [yes]"
138 Process RTM_NEWROUTE and RTM_DELROUTE events
140 .BR charon.receive_delay " [0]"
141 Delay for receiving packets, to simulate larger RTT
143 .BR charon.receive_delay_response " [yes]"
144 Delay response messages
146 .BR charon.receive_delay_request " [yes]"
147 Delay request messages
149 .BR charon.receive_delay_type " [0]"
150 Specific IKEv2 message type to delay, 0 for any
152 .BR charon.retransmit_base " [1.8]"
153 Base to use for calculating exponential back off, see IKEv2 RETRANSMISSION
155 .BR charon.retransmit_timeout " [4.0]
156 Timeout in seconds before sending first retransmit
158 .BR charon.retransmit_tries " [5]"
159 Number of times to retransmit a packet before giving up
161 .BR charon.reuse_ikesa " [yes]
162 Initiate CHILD_SA within existing IKE_SAs
164 .BR charon.routing_table
165 Numerical routing table to install routes to
167 .BR charon.routing_table_prio
168 Priority of the routing table
170 .BR charon.send_delay " [0]"
171 Delay for sending packets, to simulate larger RTT
173 .BR charon.send_delay_response " [yes]"
174 Delay response messages
176 .BR charon.send_delay_request " [yes]"
177 Delay request messages
179 .BR charon.send_delay_type " [0]"
180 Specific IKEv2 message type to delay, 0 for any
182 .BR charon.send_vendor_id " [no]
183 Send strongSwan vendor ID payload
186 Section to define syslog loggers, see LOGGER CONFIGURATION
188 .BR charon.threads " [16]"
189 Number of worker threads in charon
190 .SS charon.plugins subsection
192 .BR charon.plugins.android.loglevel " [1]"
193 Loglevel for logging to Android specific logger
195 .BR charon.plugins.attr
196 Section to specify arbitrary attributes that are assigned to a peer via
197 configuration payload (CP)
199 .BR charon.plugins.dhcp.identity_lease " [no]"
200 Derive user-defined MAC address from hash of IKEv2 identity
202 .BR charon.plugins.dhcp.server " [255.255.255.255]"
203 DHCP server unicast or broadcast IP address
205 .BR charon.plugins.eap-aka.request_identity " [yes]"
208 .BR charon.plugins.eap-aka-3ggp2.seq_check
211 .BR charon.plugins.eap-gtc.pam_service " [login]"
212 PAM service to be used for authentication
214 .BR charon.plugins.eap-radius.class_group " [no]"
217 attribute sent in the RADIUS-Accept message as group membership information that
218 is compared to the groups specified in the
223 .BR charon.plugins.eap-radius.eap_start " [no]"
224 Send EAP-Start instead of EAP-Identity to start RADIUS conversation
226 .BR charon.plugins.eap-radius.filter_id " [no]"
233 attribute sent in the RADIUS-Accept message as group membership information that
234 is compared to the groups specified in the
239 .BR charon.plugins.eap-radius.id_prefix
240 Prefix to EAP-Identity, some AAA servers use a IMSI prefix to select the
243 .BR charon.plugins.eap-radius.nas_identifier " [strongSwan]"
244 NAS-Identifier to include in RADIUS messages
246 .BR charon.plugins.eap-radius.port " [1812]"
247 Port of RADIUS server (authentication)
249 .BR charon.plugins.eap-radius.secret
250 Shared secret between RADIUS and NAS
252 .BR charon.plugins.eap-radius.server
253 IP/Hostname of RADIUS server
255 .BR charon.plugins.eap-radius.servers
256 Section to specify multiple RADIUS servers. The
262 options can be specified for each server. A server's IP/Hostname can be
265 option. For each RADIUS server a priority can be specified using the
266 .BR preference " [0]"
269 .BR charon.plugins.eap-radius.sockets " [1]"
270 Number of sockets (ports) to use, increase for high load
272 .BR charon.plugins.eap-sim.request_identity " [yes]"
275 .BR charon.plugins.eap-simaka-sql.database
278 .BR charon.plugins.eap-simaka-sql.remove_used
281 .BR charon.plugins.eap-tls.fragment_size " [1024]"
282 Maximum size of an EAP-TLS packet
284 .BR charon.plugins.eap-tls.max_message_count " [32]"
285 Maximum number of processed EAP-TLS packets
287 .BR charon.plugins.eap-tnc.fragment_size " [50000]"
288 Maximum size of an EAP-TNC packet
290 .BR charon.plugins.eap-tnc.max_message_count " [10]"
291 Maximum number of processed EAP-TNC packets
293 .BR charon.plugins.eap-ttls.fragment_size " [1024]"
294 Maximum size of an EAP-TTLS packet
296 .BR charon.plugins.eap-ttls.max_message_count " [32]"
297 Maximum number of processed EAP-TTLS packets
299 .BR charon.plugins.eap-ttls.phase2_method " [md5]"
300 Phase2 EAP client authentication method
302 .BR charon.plugins.eap-ttls.phase2_piggyback " [no]"
303 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
305 .BR charon.plugins.eap-ttls.phase2_tnc " [no]"
306 Start phase2 EAP TNC protocol after successful client authentication
308 .BR charon.plugins.eap-ttls.request_peer_auth " [no]"
309 Request peer authentication based on a client certificate
311 .BR charon.plugins.ha.fifo_interface " [yes]"
314 .BR charon.plugins.ha.heartbeat_delay " [1000]"
317 .BR charon.plugins.ha.heartbeat_timeout " [2100]"
320 .BR charon.plugins.ha.local
323 .BR charon.plugins.ha.monitor " [yes]"
326 .BR charon.plugins.ha.pools
329 .BR charon.plugins.ha.remote
332 .BR charon.plugins.ha.resync " [yes]"
335 .BR charon.plugins.ha.secret
338 .BR charon.plugins.ha.segment_count " [1]"
341 .BR charon.plugins.led.activity_led
344 .BR charon.plugins.led.blink_time " [50]"
347 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
348 Number of ipsecN devices
350 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
351 Set MTU of ipsecN device
353 .BR charon.plugins.load-tester
354 Section to configure the load-tester plugin, see LOAD TESTS
356 .BR charon.plugins.resolve.file " [/etc/resolv.conf]"
357 File where to add DNS server entries
359 .BR charon.plugins.sql.database
360 Database URI for charons SQL plugin
362 .BR charon.plugins.sql.loglevel " [-1]"
363 Loglevel for logging to SQL database
365 .BR charon.plugins.tnc-imc.preferred_language " [en]"
366 Preferred language for TNC recommendations
368 .BR charon.plugins.tnc-imc.tnc_config " [/etc/tnc_config]"
369 TNC IMC configuration directory
371 .BR charon.plugins.tnc-imv.tnc_config " [/etc/tnc_config]"
372 TNC IMV configuration directory
373 .SS libstrongswan section
375 .BR libstrongswan.crypto_test.bench " [no]"
378 .BR libstrongswan.crypto_test.bench_size " [1024]"
381 .BR libstrongswan.crypto_test.bench_time " [50]"
384 .BR libstrongswan.crypto_test.on_add " [no]"
385 Test crypto algorithms during registration
387 .BR libstrongswan.crypto_test.on_create " [no]"
388 Test crypto algorithms on each crypto primitive instantiation
390 .BR libstrongswan.crypto_test.required " [no]"
391 Strictly require at least one test vector to enable an algorithm
393 .BR libstrongswan.crypto_test.rng_true " [no]"
394 Whether to test RNG with TRUE quality; requires a lot of entropy
396 .BR libstrongswan.dh_exponent_ansi_x9_42 " [yes]"
397 Use ANSI X9.42 DH exponent size or optimum size matched to cryptographical
400 .BR libstrongswan.ecp_x_coordinate_only " [yes]"
401 Compliance with the errata for RFC 4753
403 .BR libstrongswan.integrity_test " [no]"
404 Check daemon, libstrongswan and plugin integrity at startup
406 .BR libstrongswan.leak_detective.detailed " [yes]"
407 Includes source file names and line numbers in leak detective output
408 .SS libstrongswan.plugins subsection
410 .BR libstrongswan.plugins.attr-sql.database
411 Database URI for attr-sql plugin used by charon and pluto
413 .BR libstrongswan.plugins.attr-sql.lease_history " [yes]"
414 Enable logging of SQL IP pool leases
416 .BR libstrongswan.plugins.gcrypt.quick_random " [no]"
417 Use faster random numbers in gcrypt; for testing only, produces weak keys!
419 .BR libstrongswan.plugins.openssl.engine_id " [pkcs11]"
420 ENGINE ID to use in the OpenSSL plugin
422 .BR libstrongswan.plugins.pkcs11.modules
425 .BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
428 .BR libstrongswan.plugins.x509.enforce_critical " [no]"
429 Discard certificates with unsupported or unknown critical extensions
433 List of TLS encryption ciphers
435 .BR libtls.key_exchange
436 List of TLS key exchange methods
439 List of TLS MAC algorithms
442 List of TLS cipher suites
446 Credential database URI for manager
448 .BR manager.debug " [no]"
449 Enable debugging in manager
452 Plugins to load in manager
455 FastCGI socket of manager, to run it statically
457 .BR manager.threads " [10]"
458 Threads to use for request handling
460 .BR manager.timeout " [15m]"
461 Session timeout for manager
462 .SS mediation client section
465 Mediation client database URI
467 .BR medcli.dpd " [5m]"
468 DPD timeout to use in mediation client plugin
470 .BR medcli.rekey " [20m]"
471 Rekeying time on mediation connections in mediation client plugin
472 .SS mediation server section
475 Mediation server database URI
477 .BR medsrv.debug " [no]"
478 Debugging in mediation server web application
480 .BR medsrv.dpd " [5m]"
481 DPD timeout to use in mediation server plugin
484 Plugins to load in mediation server plugin
486 .BR medsrv.password_length " [6]"
487 Minimum password length required for mediation server user accounts
489 .BR medsrv.rekey " [20m]"
490 Rekeying time on mediation connections in mediation server plugin
493 Run Mediation server web application statically on socket
495 .BR medsrv.threads " [5]"
496 Number of thread for mediation service web application
498 .BR medsrv.timeout " [15m]"
499 Session timeout for mediation service
503 Plugins to load in ipsec openac tool
507 Plugins to load in ipsec pki tool
513 DNS servers assigned to peer via Mode Config
516 Plugins to load in IKEv1 pluto daemon
521 WINS servers assigned to peer via Mode Config
523 .BR pluto.threads " [4]"
524 Number of worker threads in pluto
525 .SS pluto.plugins section
527 .BR pluto.plugins.attr
528 Section to specify arbitrary attributes that are assigned to a peer via
531 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
532 Number of ipsecN devices
534 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
535 Set MTU of ipsecN device
539 Plugins to load in ipsec pool tool
540 .SS scepclient section
543 Plugins to load in ipsec scepclient tool
546 .BR starter.load_warning " [yes]"
547 Disable charon/pluto plugin load option warning
549 .SH LOGGER CONFIGURATION
550 The options described below provide a much more flexible way to configure
551 loggers for the IKEv2 daemon charon than using the
557 that if any loggers are specified in strongswan.conf,
559 does not have any effect.
561 There are currently two types of loggers defined:
564 Log directly to a file and are defined by specifying the full path to the
565 file as subsection in the
567 section. To log to the console the two special filenames
568 .BR stdout " and " stderr
572 Log into a syslog facility and are defined by specifying the facility to log to
573 as the name of a subsection in the
575 section. The following facilities are currently supported:
576 .BR daemon " and " auth .
578 Multiple loggers can be defined for each type with different log verbosity for
579 the different subsystems of the daemon.
582 .BR charon.filelog.<filename>.default " [1]"
584 .BR charon.syslog.<facility>.default
585 Specifies the default loglevel to be used for subsystems for which no specific
588 .BR charon.filelog.<filename>.<subsystem> " [<default>]"
590 .BR charon.syslog.<facility>.<subsystem>
591 Specifies the loglevel for the given subsystem.
593 .BR charon.filelog.<filename>.append " [yes]"
594 If this option is enabled log entries are appended to the existing file.
596 .BR charon.filelog.<filename>.flush_line " [no]"
597 Enabling this option disables block buffering and enables line buffering.
599 .BR charon.filelog.<filename>.ike_name " [no]"
601 .BR charon.syslog.<facility>.ike_name
602 Prefix each log entry with the connection name and a unique numerical
603 identifier for each IKE_SA.
605 .BR charon.filelog.<filename>.time_format
606 Prefix each log entry with a timestamp. The option accepts a format string as
613 Main daemon setup/cleanup/signal handling
616 IKE_SA manager, handling synchronization for IKE_SA access
625 Jobs queueing/processing and thread pool management
628 Configuration management and plugins
631 IPsec/Networking kernel interface
634 IKE network communication
637 Packet encoding/decoding encryption/decryption operations
640 libtls library messages
643 libstrongwan library messages
650 Very basic auditing logs, (e.g. SA up/SA down)
653 Generic control flow with errors, a good default to see whats going on
656 More detailed debugging control flow
659 Including RAW data dumps in Hex
662 Also include sensitive material in dumps, e.g. keys
668 /var/log/charon.log {
669 time_format = %b %e %T
680 # enable logging to LOG_DAEMON, use defaults
683 # minimalistic IKE auditing logging to LOG_AUTHPRIV
693 To do stability testing and performance optimizations, the IKEv2 daemon charon
694 provides the load-tester plugin. This plugin allows to setup thousands of
695 tunnels concurrently against the daemon itself or a remote host.
698 Never enable the load-testing plugin on productive systems. It provides
699 preconfigured credentials and allows an attacker to authenticate as any user.
702 .BR charon.plugins.load-tester.child_rekey " [600]"
703 Seconds to start CHILD_SA rekeying after setup
705 .BR charon.plugins.load-tester.delay " [0]"
706 Delay between initiatons for each thread
708 .BR charon.plugins.load-tester.delete_after_established " [no]"
709 Delete an IKE_SA as soon as it has been established
711 .BR charon.plugins.load-tester.dynamic_port " [0]"
712 Base port to be used for requests (each client uses a different port)
714 .BR charon.plugins.load-tester.enable " [no]"
715 Enable the load testing plugin
717 .BR charon.plugins.load-tester.fake_kernel " [no]"
718 Fake the kernel interface to allow load-testing against self
720 .BR charon.plugins.load-tester.ike_rekey " [0]"
721 Seconds to start IKE_SA rekeying after setup
723 .BR charon.plugins.load-tester.initiators " [0]"
724 Number of concurrent initiator threads to use in load test
726 .BR charon.plugins.load-tester.initiator_auth " [pubkey]"
727 Authentication method(s) the intiator uses
729 .BR charon.plugins.load-tester.iterations " [1]"
730 Number of IKE_SAs to initate by each initiator in load test
732 .BR charon.plugins.load-tester.pool
733 Provide INTERNAL_IPV4_ADDRs from a named pool
735 .BR charon.plugins.load-tester.proposal " [aes128-sha1-modp768]"
736 IKE proposal to use in load test
738 .BR charon.plugins.load-tester.remote " [127.0.0.1]"
739 Address to initiation connections to
741 .BR charon.plugins.load-tester.responder_auth " [pubkey]"
742 Authentication method(s) the responder uses
744 .BR charon.plugins.load-tester.request_virtual_ip " [no]"
745 Request an INTERNAL_IPV4_ADDR from the server
747 .BR charon.plugins.load-tester.shutdown_when_complete " [no]"
748 Shutdown the daemon after all IKE_SAs have been established
749 .SS Configuration details
750 For public key authentication, the responder uses the
751 .B \(dqCN=srv, OU=load-test, O=strongSwan\(dq
752 identity. For the initiator, each connection attempt uses a different identity
754 .BR "\(dqCN=c1-r1, OU=load-test, O=strongSwan\(dq" ,
755 where the first number inidicates the client number, the second the
756 authentication round (if multiple authentication is used).
758 For PSK authentication, FQDN identities are used. The server uses
759 .BR srv.strongswan.org ,
760 the client uses an identity in the form
761 .BR c1-r1.strongswan.org .
763 For EAP authentication, the client uses a NAI in the form
764 .BR 100000000010001@strongswan.org .
766 To configure multiple authentication, concatenate multiple methods using, e.g.
768 initiator_auth = pubkey|psk|eap-md5|eap-aka
771 The responder uses a hardcoded certificate based on a 1024-bit RSA key.
772 This certificate additionally serves as CA certificate. A peer uses the same
773 private key, but generates client certificates on demand signed by the CA
774 certificate. Install the Responder/CA certificate on the remote host to
775 authenticate all clients.
777 To speed up testing, the load tester plugin implements a special Diffie-Hellman
778 implementation called modpnull. By setting
780 proposal = aes128-sha1-modpnull
782 this wicked fast DH implementation is used. It does not provide any security
783 at all, but allows to run tests without DH calculation overhead.
786 In the simplest case, the daemon initiates IKE_SAs against itself using the
787 loopback interface. This will actually establish double the number of IKE_SAs,
788 as the daemon is initiator and responder for each IKE_SA at the same time.
789 Installation of IPsec SAs would fails, as each SA gets installed twice. To
790 simulate the correct behavior, a fake kernel interface can be enabled which does
791 not install the IPsec SAs at the kernel level.
793 A simple loopback configuration might look like this:
797 # create new IKE_SAs for each CHILD_SA to simulate
800 # turn off denial of service protection
807 # use 4 threads to initiate connections
810 # each thread initiates 1000 connections
812 # delay each initiation in each thread by 20ms
814 # enable the fake kernel interface to
822 This will initiate 4000 IKE_SAs within 20 seconds. You may increase the delay
823 value if your box can not handle that much load, or decrease it to put more
824 load on it. If the daemon starts retransmitting messages your box probably can
825 not handle all connection attempts.
827 The plugin also allows to test against a remote host. This might help to test
828 against a real world configuration. A connection setup to do stress testing of
829 a gateway might look like this:
839 # 10000 connections, ten in parallel
842 # use a delay of 100ms, overall time is:
843 # iterations * delay = 100s
845 # address of the gateway
847 # IKE-proposal to use
848 proposal = aes128-sha1-modp1024
849 # use faster PSK authentication instead
853 # request a virtual IP using configuration
855 request_virtual_ip = yes
856 # enable CHILD_SA every 60s
863 .SH IKEv2 RETRANSMISSION
864 Retransmission timeouts in the IKEv2 daemon charon can be configured globally
865 using the three keys listed below:
869 .BR charon.retransmit_base " [1.8]"
870 .BR charon.retransmit_timeout " [4.0]"
871 .BR charon.retransmit_tries " [5]"
875 The following algorithm is used to calculate the timeout:
878 relative timeout = retransmit_timeout * retransmit_base ^ (n-1)
883 is the current retransmission count.
885 Using the default values, packets are retransmitted in:
891 Retransmission Relative Timeout Absolute Timeout
904 ipsec.conf(5), ipsec.secrets(5), ipsec(8)
907 .UR http://www.strongswan.org
910 by Tobias Brunner, Andreas Steffen and Martin Willi.