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.id_prefix
227 Prefix to EAP-Identity, some AAA servers use a IMSI prefix to select the
230 .BR charon.plugins.eap-radius.nas_identifier " [strongSwan]"
231 NAS-Identifier to include in RADIUS messages
233 .BR charon.plugins.eap-radius.port " [1812]"
234 Port of RADIUS server (authentication)
236 .BR charon.plugins.eap-radius.secret
237 Shared secret between RADIUS and NAS
239 .BR charon.plugins.eap-radius.server
240 IP/Hostname of RADIUS server
242 .BR charon.plugins.eap-radius.servers
243 Section to specify multiple RADIUS servers. The
249 options can be specified for each server. A server's IP/Hostname can be
252 option. For each RADIUS server a priority can be specified using the
253 .BR preference " [0]"
256 .BR charon.plugins.eap-radius.sockets " [1]"
257 Number of sockets (ports) to use, increase for high load
259 .BR charon.plugins.eap-sim.request_identity " [yes]"
262 .BR charon.plugins.eap-simaka-sql.database
265 .BR charon.plugins.eap-simaka-sql.remove_used
268 .BR charon.plugins.eap-tls.fragment_size " [1024]"
269 Maximum size of an EAP-TLS packet
271 .BR charon.plugins.eap-tls.max_message_count " [32]"
272 Maximum number of processed EAP-TLS packets
274 .BR charon.plugins.eap-tnc.fragment_size " [50000]"
275 Maximum size of an EAP-TNC packet
277 .BR charon.plugins.eap-tnc.max_message_count " [2]"
278 Maximum number of processed EAP-TNC packets
280 .BR charon.plugins.eap-ttls.fragment_size " [1024]"
281 Maximum size of an EAP-TTLS packet
283 .BR charon.plugins.eap-ttls.max_message_count " [32]"
284 Maximum number of processed EAP-TTLS packets
286 .BR charon.plugins.eap-ttls.phase2_method " [md5]"
287 Phase2 EAP client authentication method
289 .BR charon.plugins.eap-ttls.phase2_piggyback " [no]"
290 Phase2 EAP Identity request piggybacked by server onto TLS Finished message
292 .BR charon.plugins.eap-ttls.request_peer_auth " [no]"
293 Request peer authentication based on a client certificate
295 .BR charon.plugins.ha.fifo_interface " [yes]"
298 .BR charon.plugins.ha.heartbeat_delay " [1000]"
301 .BR charon.plugins.ha.heartbeat_timeout " [2100]"
304 .BR charon.plugins.ha.local
307 .BR charon.plugins.ha.monitor " [yes]"
310 .BR charon.plugins.ha.pools
313 .BR charon.plugins.ha.remote
316 .BR charon.plugins.ha.resync " [yes]"
319 .BR charon.plugins.ha.secret
322 .BR charon.plugins.ha.segment_count " [1]"
325 .BR charon.plugins.led.activity_led
328 .BR charon.plugins.led.blink_time " [50]"
331 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
332 Number of ipsecN devices
334 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
335 Set MTU of ipsecN device
337 .BR charon.plugins.load-tester
338 Section to configure the load-tester plugin, see LOAD TESTS
340 .BR charon.plugins.resolve.file " [/etc/resolv.conf]"
341 File where to add DNS server entries
343 .BR charon.plugins.sql.database
344 Database URI for charons SQL plugin
346 .BR charon.plugins.sql.loglevel " [-1]"
347 Loglevel for logging to SQL database
349 .BR charon.plugins.tnccs-11.preferred_language " [en]"
350 Preferred language for TNC recommendations
352 .BR charon.plugins.tnccs-11.tnc_config " [/etc/tnc_config]"
353 TNC IMC/IMV configuration directory
354 .SS libstrongswan section
356 .BR libstrongswan.crypto_test.bench " [no]"
359 .BR libstrongswan.crypto_test.bench_size " [1024]"
362 .BR libstrongswan.crypto_test.bench_time " [50]"
365 .BR libstrongswan.crypto_test.on_add " [no]"
366 Test crypto algorithms during registration
368 .BR libstrongswan.crypto_test.on_create " [no]"
369 Test crypto algorithms on each crypto primitive instantiation
371 .BR libstrongswan.crypto_test.required " [no]"
372 Strictly require at least one test vector to enable an algorithm
374 .BR libstrongswan.crypto_test.rng_true " [no]"
375 Whether to test RNG with TRUE quality; requires a lot of entropy
377 .BR libstrongswan.dh_exponent_ansi_x9_42 " [yes]"
378 Use ANSI X9.42 DH exponent size or optimum size matched to cryptographical
381 .BR libstrongswan.ecp_x_coordinate_only " [yes]"
382 Compliance with the errata for RFC 4753
384 .BR libstrongswan.integrity_test " [no]"
385 Check daemon, libstrongswan and plugin integrity at startup
387 .BR libstrongswan.leak_detective.detailed " [yes]"
388 Includes source file names and line numbers in leak detective output
389 .SS libstrongswan.plugins subsection
391 .BR libstrongswan.plugins.attr-sql.database
392 Database URI for attr-sql plugin used by charon and pluto
394 .BR libstrongswan.plugins.attr-sql.lease_history " [yes]"
395 Enable logging of SQL IP pool leases
397 .BR libstrongswan.plugins.gcrypt.quick_random " [no]"
398 Use faster random numbers in gcrypt; for testing only, produces weak keys!
400 .BR libstrongswan.plugins.openssl.engine_id " [pkcs11]"
401 ENGINE ID to use in the OpenSSL plugin
403 .BR libstrongswan.plugins.pkcs11.modules
406 .BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
409 .BR libstrongswan.plugins.x509.enforce_critical " [no]"
410 Discard certificates with unsupported or unknown critical extensions
414 List of TLS encryption ciphers
416 .BR libtls.key_exchange
417 List of TLS key exchange methods
420 List of TLS MAC algorithms
423 List of TLS cipher suites
427 Credential database URI for manager
429 .BR manager.debug " [no]"
430 Enable debugging in manager
433 Plugins to load in manager
436 FastCGI socket of manager, to run it statically
438 .BR manager.threads " [10]"
439 Threads to use for request handling
441 .BR manager.timeout " [15m]"
442 Session timeout for manager
443 .SS mediation client section
446 Mediation client database URI
448 .BR medcli.dpd " [5m]"
449 DPD timeout to use in mediation client plugin
451 .BR medcli.rekey " [20m]"
452 Rekeying time on mediation connections in mediation client plugin
453 .SS mediation server section
456 Mediation server database URI
458 .BR medsrv.debug " [no]"
459 Debugging in mediation server web application
461 .BR medsrv.dpd " [5m]"
462 DPD timeout to use in mediation server plugin
465 Plugins to load in mediation server plugin
467 .BR medsrv.password_length " [6]"
468 Minimum password length required for mediation server user accounts
470 .BR medsrv.rekey " [20m]"
471 Rekeying time on mediation connections in mediation server plugin
474 Run Mediation server web application statically on socket
476 .BR medsrv.threads " [5]"
477 Number of thread for mediation service web application
479 .BR medsrv.timeout " [15m]"
480 Session timeout for mediation service
484 Plugins to load in ipsec openac tool
488 Plugins to load in ipsec pki tool
494 DNS servers assigned to peer via Mode Config
497 Plugins to load in IKEv1 pluto daemon
502 WINS servers assigned to peer via Mode Config
504 .BR pluto.threads " [4]"
505 Number of worker threads in pluto
506 .SS pluto.plugins section
508 .BR pluto.plugins.attr
509 Section to specify arbitrary attributes that are assigned to a peer via
512 .BR charon.plugins.kernel-klips.ipsec_dev_count " [4]"
513 Number of ipsecN devices
515 .BR charon.plugins.kernel-klips.ipsec_dev_mtu " [0]"
516 Set MTU of ipsecN device
520 Plugins to load in ipsec pool tool
521 .SS scepclient section
524 Plugins to load in ipsec scepclient tool
527 .BR starter.load_warning " [yes]"
528 Disable charon/pluto plugin load option warning
530 .SH LOGGER CONFIGURATION
531 The options described below provide a much more flexible way to configure
532 loggers for the IKEv2 daemon charon than using the
538 that if any loggers are specified in strongswan.conf,
540 does not have any effect.
542 There are currently two types of loggers defined:
545 Log directly to a file and are defined by specifying the full path to the
546 file as subsection in the
548 section. To log to the console the two special filenames
549 .BR stdout " and " stderr
553 Log into a syslog facility and are defined by specifying the facility to log to
554 as the name of a subsection in the
556 section. The following facilities are currently supported:
557 .BR daemon " and " auth .
559 Multiple loggers can be defined for each type with different log verbosity for
560 the different subsystems of the daemon.
563 .BR charon.filelog.<filename>.default " [1]"
565 .BR charon.syslog.<facility>.default
566 Specifies the default loglevel to be used for subsystems for which no specific
569 .BR charon.filelog.<filename>.<subsystem> " [<default>]"
571 .BR charon.syslog.<facility>.<subsystem>
572 Specifies the loglevel for the given subsystem.
574 .BR charon.filelog.<filename>.append " [yes]"
575 If this option is enabled log entries are appended to the existing file.
577 .BR charon.filelog.<filename>.flush_line " [no]"
578 Enabling this option disables block buffering and enables line buffering.
580 .BR charon.filelog.<filename>.ike_name " [no]"
582 .BR charon.syslog.<facility>.ike_name
583 Prefix each log entry with the connection name and a unique numerical
584 identifier for each IKE_SA.
586 .BR charon.filelog.<filename>.time_format
587 Prefix each log entry with a timestamp. The option accepts a format string as
594 Main daemon setup/cleanup/signal handling
597 IKE_SA manager, handling synchronization for IKE_SA access
606 Jobs queueing/processing and thread pool management
609 Configuration management and plugins
612 IPsec/Networking kernel interface
615 IKE network communication
618 Packet encoding/decoding encryption/decryption operations
621 libtls library messages
624 libstrongwan library messages
631 Very basic auditing logs, (e.g. SA up/SA down)
634 Generic control flow with errors, a good default to see whats going on
637 More detailed debugging control flow
640 Including RAW data dumps in Hex
643 Also include sensitive material in dumps, e.g. keys
649 /var/log/charon.log {
650 time_format = %b %e %T
661 # enable logging to LOG_DAEMON, use defaults
664 # minimalistic IKE auditing logging to LOG_AUTHPRIV
674 To do stability testing and performance optimizations, the IKEv2 daemon charon
675 provides the load-tester plugin. This plugin allows to setup thousands of
676 tunnels concurrently against the daemon itself or a remote host.
679 Never enable the load-testing plugin on productive systems. It provides
680 preconfigured credentials and allows an attacker to authenticate as any user.
683 .BR charon.plugins.load-tester.child_rekey " [600]"
684 Seconds to start CHILD_SA rekeying after setup
686 .BR charon.plugins.load-tester.delay " [0]"
687 Delay between initiatons for each thread
689 .BR charon.plugins.load-tester.delete_after_established " [no]"
690 Delete an IKE_SA as soon as it has been established
692 .BR charon.plugins.load-tester.dynamic_port " [0]"
693 Base port to be used for requests (each client uses a different port)
695 .BR charon.plugins.load-tester.enable " [no]"
696 Enable the load testing plugin
698 .BR charon.plugins.load-tester.fake_kernel " [no]"
699 Fake the kernel interface to allow load-testing against self
701 .BR charon.plugins.load-tester.ike_rekey " [0]"
702 Seconds to start IKE_SA rekeying after setup
704 .BR charon.plugins.load-tester.initiators " [0]"
705 Number of concurrent initiator threads to use in load test
707 .BR charon.plugins.load-tester.initiator_auth " [pubkey]"
708 Authentication method(s) the intiator uses
710 .BR charon.plugins.load-tester.iterations " [1]"
711 Number of IKE_SAs to initate by each initiator in load test
713 .BR charon.plugins.load-tester.pool
714 Provide INTERNAL_IPV4_ADDRs from a named pool
716 .BR charon.plugins.load-tester.proposal " [aes128-sha1-modp768]"
717 IKE proposal to use in load test
719 .BR charon.plugins.load-tester.remote " [127.0.0.1]"
720 Address to initiation connections to
722 .BR charon.plugins.load-tester.responder_auth " [pubkey]"
723 Authentication method(s) the responder uses
725 .BR charon.plugins.load-tester.request_virtual_ip " [no]"
726 Request an INTERNAL_IPV4_ADDR from the server
728 .BR charon.plugins.load-tester.shutdown_when_complete " [no]"
729 Shutdown the daemon after all IKE_SAs have been established
730 .SS Configuration details
731 For public key authentication, the responder uses the
732 .B \(dqCN=srv, OU=load-test, O=strongSwan\(dq
733 identity. For the initiator, each connection attempt uses a different identity
735 .BR "\(dqCN=c1-r1, OU=load-test, O=strongSwan\(dq" ,
736 where the first number inidicates the client number, the second the
737 authentication round (if multiple authentication is used).
739 For PSK authentication, FQDN identities are used. The server uses
740 .BR srv.strongswan.org ,
741 the client uses an identity in the form
742 .BR c1-r1.strongswan.org .
744 For EAP authentication, the client uses a NAI in the form
745 .BR 100000000010001@strongswan.org .
747 To configure multiple authentication, concatenate multiple methods using, e.g.
749 initiator_auth = pubkey|psk|eap-md5|eap-aka
752 The responder uses a hardcoded certificate based on a 1024-bit RSA key.
753 This certificate additionally serves as CA certificate. A peer uses the same
754 private key, but generates client certificates on demand signed by the CA
755 certificate. Install the Responder/CA certificate on the remote host to
756 authenticate all clients.
758 To speed up testing, the load tester plugin implements a special Diffie-Hellman
759 implementation called modpnull. By setting
761 proposal = aes128-sha1-modpnull
763 this wicked fast DH implementation is used. It does not provide any security
764 at all, but allows to run tests without DH calculation overhead.
767 In the simplest case, the daemon initiates IKE_SAs against itself using the
768 loopback interface. This will actually establish double the number of IKE_SAs,
769 as the daemon is initiator and responder for each IKE_SA at the same time.
770 Installation of IPsec SAs would fails, as each SA gets installed twice. To
771 simulate the correct behavior, a fake kernel interface can be enabled which does
772 not install the IPsec SAs at the kernel level.
774 A simple loopback configuration might look like this:
778 # create new IKE_SAs for each CHILD_SA to simulate
781 # turn off denial of service protection
788 # use 4 threads to initiate connections
791 # each thread initiates 1000 connections
793 # delay each initiation in each thread by 20ms
795 # enable the fake kernel interface to
803 This will initiate 4000 IKE_SAs within 20 seconds. You may increase the delay
804 value if your box can not handle that much load, or decrease it to put more
805 load on it. If the daemon starts retransmitting messages your box probably can
806 not handle all connection attempts.
808 The plugin also allows to test against a remote host. This might help to test
809 against a real world configuration. A connection setup to do stress testing of
810 a gateway might look like this:
820 # 10000 connections, ten in parallel
823 # use a delay of 100ms, overall time is:
824 # iterations * delay = 100s
826 # address of the gateway
828 # IKE-proposal to use
829 proposal = aes128-sha1-modp1024
830 # use faster PSK authentication instead
834 # request a virtual IP using configuration
836 request_virtual_ip = yes
837 # enable CHILD_SA every 60s
844 .SH IKEv2 RETRANSMISSION
845 Retransmission timeouts in the IKEv2 daemon charon can be configured globally
846 using the three keys listed below:
850 .BR charon.retransmit_base " [1.8]"
851 .BR charon.retransmit_timeout " [4.0]"
852 .BR charon.retransmit_tries " [5]"
856 The following algorithm is used to calculate the timeout:
859 relative timeout = retransmit_timeout * retransmit_base ^ (n-1)
864 is the current retransmission count.
866 Using the default values, packets are retransmitted in:
872 Retransmission Relative Timeout Absolute Timeout
885 ipsec.conf (5), ipsec.secrets (5)
888 .UR http://www.strongswan.org
891 by Tobias Brunner, Andreas Steffen and Martin Willi.