2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2017 IPFire Network Development Team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 IPSEC_CONNECTION_CONFIG_SETTINGS
="\
39 IPSEC_DEFAULT_AUTH_MODE
="PSK"
40 IPSEC_DEFAULT_DPD_ACTION
="restart"
41 IPSEC_DEFAULT_DPD_DELAY
="30"
42 IPSEC_DEFAULT_DPD_TIMEOUT
="120"
43 IPSEC_DEFAULT_INACTIVITY_TIMEOUT
="0"
44 IPSEC_DEFAULT_MODE
="tunnel"
45 IPSEC_DEFAULT_SECURITY_POLICY
="system"
46 IPSEC_DEFAULT_START_ACTION
="on-demand"
48 IPSEC_VALID_MODES
="gre-transport tunnel vti"
49 IPSEC_VALID_AUTH_MODES
="PSK"
57 cli_ipsec_connection $@
60 error
"Unrecognized argument: ${action}"
66 cli_ipsec_connection
() {
67 if ipsec_connection_exists
${1}; then
74 authentication|down|dpd|inactivity_timeout|
local|mode|peer|remote|security_policy|start_action|up
)
75 ipsec_connection_
${key} ${connection} $@
78 cli_ipsec_connection_show
"${connection}"
82 error
"Unrecognized argument: ${key}"
92 ipsec_connection_new $@
95 ipsec_connection_destroy $@
98 if [ -n "${action}" ]; then
99 error
"Unrecognized argument: '${action}'"
107 cli_ipsec_connection_show
() {
108 local connection
="${1}"
110 # Read the config settings
111 local ${IPSEC_CONNECTION_CONFIG_SETTINGS}
112 if ! ipsec_connection_read_config
"${connection}"; then
113 error
"Could not read the connection configuration"
117 cli_headline
0 "IPsec VPN Connection: ${connection}"
122 cli_print_fmt1
1 "Peer" "${PEER}"
126 cli_print_fmt1
1 "Security Policy" "${SECURITY_POLICY-${IPSEC_DEFAULT_SECURITY_POLICY}}"
129 cli_headline
2 "Authentication"
130 case "${AUTH_MODE^^}" in
132 cli_print_fmt1
2 "Mode" "Pre-Shared-Key"
135 cli_print_fmt1
2 "Pre-Shared-Key" "****"
137 cli_print_fmt1
2 "Pre-Shared-Key" "- is not set -"
147 for i
in LOCAL REMOTE
; do
150 cli_headline
2 "Local"
153 cli_headline
2 "Remote"
157 local id_var
="${i}_ID"
158 if [ -n "${!id_var}" ]; then
159 cli_print_fmt1
2 "ID" "${!id_var}"
162 local prefix_var
="${i}_PREFIX"
163 if isset
${prefix_var}; then
164 cli_headline
3 "Prefix(es)"
167 for prefix
in ${!prefix_var}; do
168 cli_print_fmt1
3 "${prefix}"
175 cli_headline
2 "Misc."
179 cli_print_fmt1
2 "Transport Mode" "GRE Transport"
182 cli_print_fmt1
2 "Transport Mode" "Tunnel"
185 cli_print_fmt1
2 "Transport Mode" "Virtual Tunnel Interface"
188 cli_print_fmt1
2 "Transport Mode" "- Unknown -"
193 if isset INACTIVITY_TIMEOUT
&& [ ${INACTIVITY_TIMEOUT} -gt 0 ]; then
194 cli_print_fmt1
2 "Inactivity Timeout" "$(format_time ${INACTIVITY_TIMEOUT})"
201 # This function writes all values to a via ${connection} specificated VPN IPsec configuration file
202 ipsec_connection_write_config
() {
205 local connection
="${1}"
207 if ! ipsec_connection_exists
"${connection}"; then
208 log ERROR
"No such VPN IPsec connection: ${connection}"
212 local path
="${NETWORK_IPSEC_CONNS_DIR}/${connection}/settings"
214 if ! settings_write
"${path}" ${IPSEC_CONNECTION_CONFIG_SETTINGS}; then
215 log ERROR
"Could not write configuration settings for VPN IPsec connection ${connection}"
219 ipsec_reload
${connection}
222 # This funtion writes the value for one key to a via ${connection} specificated VPN IPsec connection configuration file
223 ipsec_connection_write_config_key
() {
226 local connection
=${1}
232 if ! ipsec_connection_exists
"${connection}"; then
233 log ERROR
"No such VPN ipsec connection: ${connection}"
237 log DEBUG
"Set '${key}' to new value '${value}' in VPN ipsec connection '${connection}'"
239 local ${IPSEC_CONNECTION_CONFIG_SETTINGS}
241 # Read the config settings
242 if ! ipsec_connection_read_config
"${connection}"; then
246 # Set the key to a new value
247 assign
"${key}" "${value}"
249 if ! ipsec_connection_write_config
"${connection}"; then
256 # Reads one or more keys out of a settings file or all if no key is provided.
257 ipsec_connection_read_config
() {
260 local connection
="${1}"
263 if ! ipsec_connection_exists
"${connection}"; then
264 log ERROR
"No such VPN IPsec connection : ${connection}"
270 if [ $# -eq 0 ] && [ -n "${IPSEC_CONNECTION_CONFIG_SETTINGS}" ]; then
271 list_append args
${IPSEC_CONNECTION_CONFIG_SETTINGS}
276 local path
="${NETWORK_IPSEC_CONNS_DIR}/${connection}/settings"
278 if ! settings_read
"${path}" ${args}; then
279 log ERROR
"Could not read settings for VPN IPsec connection ${connection}"
284 # This function checks if a vpn ipsec connection exists
285 # Returns True when yes and false when not
286 ipsec_connection_exists
() {
289 local connection
=${1}
291 local path
="${NETWORK_IPSEC_CONNS_DIR}/${connection}"
293 [ -d "${path}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
296 # Reloads the connection after config changes
301 # Handle the cli after authentification
302 ipsec_connection_authentication() {
303 if [ ! $# -gt 1 ]; then
304 log ERROR "Not enough arguments
"
308 local connection=${1}
314 ipsec_connection_authentication_mode "${connection}" $@
317 ipsec_connection_authentication_psk "${connection}" $@
320 log ERROR "Unrecognized argument
: ${cmd}"
326 # Set the authentification mode
327 ipsec_connection_authentication_mode() {
328 if [ ! $# -eq 2 ]; then
329 log ERROR "Not enough arguments
"
332 local connection=${1}
335 if ! isoneof mode ${IPSEC_VALID_AUTH_MODES}; then
336 log ERROR "Auth mode
'${mode}' is invalid
"
340 if ! ipsec_connection_write_config_key "${connection}" "AUTH_MODE
" ${mode^^}; then
341 log ERROR "Could not
write configuration settings
"
347 ipsec_connection_authentication_psk() {
348 if [ ! $# -eq 2 ]; then
349 log ERROR "Not enough arguments
"
353 local connection=${1}
358 if [ ${length} -lt 4 ]; then
359 error "The PSK must be longer than four characters
"
363 if [ ${length} -gt 128 ]; then
364 error "The PSK cannot be longer than
128 characters
"
368 if ! ipsec_connection_write_config_key "${connection}" "PSK
" "${psk}"; then
369 log ERROR "Could not
write configuration settings
"
376 ipsec_connection_up() {
377 local connection="${1}"
379 if ! ipsec_connection_exists "${connection}"; then
380 error "No such VPN IPsec connection
: ${connection}"
384 cmd swanctl --initiate --child "${connection}"
387 ipsec_connection_down() {
388 local connection="${1}"
390 if ! ipsec_connection_exists "${connection}"; then
391 error "No such VPN IPsec connection
: ${connection}"
395 cmd swanctl --terminate --ike "${connection}"
398 # Handle the cli after authentification
399 ipsec_connection_dpd() {
400 if [ ! $# -gt 1 ]; then
401 log ERROR "Not enough arguments
"
405 local connection=${1}
411 ipsec_connection_dpd_action "${connection}" $@
414 ipsec_connection_dpd_delay "${connection}" $@
417 ipsec_connection_dpd_timeout "${connection}" $@
420 log ERROR "Unrecognized argument
: ${cmd}"
426 # Set the default dpd action
427 ipsec_connection_dpd_action() {
428 if [ ! $# -eq 2 ]; then
429 log ERROR "Not enough arguments
"
432 local connection=${1}
435 if ! isoneof action "restart
" "clear"; then
436 log ERROR "dpd action
'${action}' is invalid
"
440 if ! ipsec_connection_write_config_key "${connection}" "DPD_ACTION
" ${action}; then
441 log ERROR "Could not
write configuration settings
"
447 ipsec_connection_dpd_delay() {
448 if [ ! $# -ge 2 ]; then
449 log ERROR "Not enough arguments
"
453 local connection=${1}
457 if ! isinteger value; then
458 value=$(parse_time $@)
459 if [ ! $? -eq 0 ]; then
460 log ERROR "Parsing the passed
time was not sucessful please check the passed values.
"
465 if [ ${value} -lt 0 ]; then
466 log ERROR "The passed
time value must be
in the
sum greater or equal zero seconds.
"
470 if ! ipsec_connection_write_config_key "${connection}" "DPD_DELAY
" ${value}; then
471 log ERROR "Could not
write configuration settings
"
478 # Set the dpd timeout
479 ipsec_connection_dpd_timeout() {
480 if [ ! $# -ge 2 ]; then
481 log ERROR "Not enough arguments
"
485 local connection=${1}
489 if ! isinteger value; then
490 value=$(parse_time $@)
491 if [ ! $? -eq 0 ]; then
492 log ERROR "Parsing the passed
time was not sucessful please check the passed values.
"
497 if [ ${value} -le 0 ]; then
498 log ERROR "The passed
time value must be
in the
sum greater or equal zero seconds.
"
502 if ! ipsec_connection_write_config_key "${connection}" "DPD_TIMEOUT
" ${value}; then
503 log ERROR "Could not
write configuration settings
"
510 # Handle the cli after local
511 ipsec_connection_local() {
512 if [ ! $# -ge 2 ]; then
513 log ERROR "Not enough arguments
"
517 local connection=${1}
523 ipsec_connection_local_address "${connection}" $@
526 ipsec_connection_id "${connection}" "LOCAL
" $@
529 ipsec_connection_prefix "${connection}" "LOCAL
" $@
532 log ERROR "Unrecognized argument
: ${cmd}"
540 # Set the connection mode
541 ipsec_connection_mode() {
542 if [ ! $# -eq 2 ]; then
543 log ERROR "Not enough arguments
"
546 local connection=${1}
549 if ! isoneof mode ${IPSEC_VALID_MODES}; then
550 log ERROR "Mode
'${mode}' is invalid
"
554 if ! ipsec_connection_write_config_key "${connection}" "MODE
" ${mode}; then
555 log ERROR "Could not
write configuration settings
"
562 # Set the local address
563 ipsec_connection_local_address() {
564 if [ ! $# -eq 2 ]; then
565 log ERROR "Not enough arguments
"
568 local connection=${1}
569 local local_address=${2}
571 if ! ipsec_connection_check_peer ${local_address}; then
572 log ERROR "Local address
'${local_address}' is invalid
"
576 if ! ipsec_connection_write_config_key "${connection}" "LOCAL_ADDRESS
" ${local_address}; then
577 log ERROR "Could not
write configuration settings
"
584 # Set the peer to connect to
585 ipsec_connection_peer() {
586 if [ ! $# -eq 2 ]; then
587 log ERROR "Not enough arguments
"
590 local connection=${1}
593 if ! ipsec_connection_check_peer ${peer}; then
594 log ERROR "Peer
'${peer}' is invalid
"
598 if ! ipsec_connection_write_config_key "${connection}" "PEER
" ${peer}; then
599 log ERROR "Could not
write configuration settings
"
606 #Set the local or remote id
607 ipsec_connection_id() {
608 if [ ! $# -eq 3 ]; then
609 log ERROR "Not enough arguments
"
612 local connection=${1}
616 if ! ipsec_connection_check_id ${id}; then
617 log ERROR "Id
'${id}' is invalid
"
621 if ! ipsec_connection_write_config_key "${connection}" "${type}_ID" ${id}; then
622 log ERROR
"Could not write configuration settings"
629 # Set the local or remote prefix
630 ipsec_connection_prefix
() {
631 if [ ! $# -ge 3 ]; then
632 log ERROR
"Not enough arguments"
635 local connection
=${1}
639 local _prefix
="${type}_PREFIX"
641 if ! ipsec_connection_read_config
"${connection}" "${_prefix}"; then
645 # Remove duplicated entries to proceed the list safely
646 assign
"${_prefix}" "$(list_unique ${!_prefix} )"
649 local prefixes_removed
652 while [ $# -gt 0 ]; do
657 list_append prefixes_added
"${arg:1}"
660 list_append prefixes_removed
"${arg:1}"
663 list_append prefixes_set
"${arg}"
666 error
"Invalid argument: ${arg}"
673 # Check if the user is trying a mixed operation
674 if ! list_is_empty prefixes_set
&& (! list_is_empty prefixes_added ||
! list_is_empty prefixes_removed
); then
675 error
"You cannot reset the prefix list and add or remove prefixes at the same time"
679 # Set new prefix list
680 if ! list_is_empty prefixes_set
; then
681 # Check if all prefixes are valid
683 for prefix
in ${prefixes_set}; do
684 if ! ip_net_is_valid
${prefix}; then
685 error
"Unsupported prefix: ${prefix}"
690 assign
"${_prefix}" "${prefixes_set}"
692 # Perform incremental updates
696 # Perform all removals
697 for prefix
in ${prefixes_removed}; do
698 if ! list_remove
"${_prefix}" ${prefix}; then
699 warning
"${prefix} was not on the list and could not be removed"
704 for prefix
in ${prefixes_added}; do
705 if ip_net_is_valid
${prefix}; then
706 if ! list_append_unique
"${_prefix}" ${prefix}; then
707 warning
"${prefix} is already on the prefix list"
710 warning
"${prefix} is not a valid IP network and could not be added"
715 # Check if the list contain at least one valid prefix
716 if list_is_empty
${_prefix}; then
717 error
"Cannot save an empty prefix list"
722 if ! ipsec_connection_write_config_key
"${connection}" "${_prefix}" ${!_prefix}; then
723 log ERROR "Could not
write configuration settings
"
729 # Handle the cli after remote
730 ipsec_connection_remote() {
731 if [ ! $# -ge 2 ]; then
732 log ERROR "Not enough arguments
"
736 local connection=${1}
742 ipsec_connection_id "${connection}" "REMOTE
" $@
746 ipsec_connection_prefix "${connection}" "REMOTE
" $@
749 log ERROR "Unrecognized argument
: ${cmd}"
757 # Set the inactivity timeout
758 ipsec_connection_inactivity_timeout() {
759 if [ ! $# -ge 2 ]; then
760 log ERROR "Not enough arguments
"
764 local connection=${1}
768 if ! isinteger value; then
769 value=$(parse_time $@)
770 if [ ! $? -eq 0 ]; then
771 log ERROR "Parsing the passed
time was not sucessful please check the passed values.
"
776 if [ ${value} -le 0 ]; then
777 log ERROR "The passed
time value must be
in the
sum greater zero seconds.
"
781 if ! ipsec_connection_write_config_key "${connection}" "INACTIVITY_TIMEOUT
" ${value}; then
782 log ERROR "Could not
write configuration settings
"
789 # Set the default start action
790 ipsec_connection_start_action() {
791 if [ ! $# -eq 2 ]; then
792 log ERROR "Not enough arguments
"
795 local connection=${1}
798 if ! isoneof action "on-demand
" "always-on
"; then
799 log ERROR "Start action
'${action}' is invalid
"
803 if ! ipsec_connection_write_config_key "${connection}" "START_ACTION
" ${action}; then
804 log ERROR "Could not
write configuration settings
"
809 # Set the security policy to use
810 ipsec_connection_security_policy() {
811 if [ ! $# -eq 2 ]; then
812 log ERROR "Not enough arguments
"
815 local connection=${1}
816 local security_policy=${2}
818 if ! vpn_security_policy_exists ${security_policy}; then
819 log ERROR "No such vpn security policy
'${security_policy}'"
823 if ! ipsec_connection_write_config_key "${connection}" "SECURITY_POLICY
" ${security_policy}; then
824 log ERROR "Could not
write configuration settings
"
829 # Check if a id is valid
830 ipsec_connection_check_id() {
834 if [[ ${id} =~ ^@[[:alnum:]]+$ ]] || ip_is_valid ${id}; then
841 # Checks if a peer is valid
842 ipsec_connection_check_peer() {
846 # TODO Accept also FQDNs
847 if ip_is_valid ${peer}; then
854 # This function checks if a VPN IPsec connection name is valid
855 # Allowed are only A-Za-z0-9
856 ipsec_connection_check_name() {
859 local connection=${1}
861 [[ "${connection}" =~ [^[:alnum:]$] ]]
864 # Function that creates one VPN IPsec connection
865 ipsec_connection_new() {
866 if [ $# -gt 1 ]; then
867 error "Too many arguments
"
871 local connection="${1}"
872 if ! isset connection; then
873 error "Please provide a connection name
"
877 # Check for duplicates
878 if ipsec_connection_exists "${connection}"; then
879 error "The VPN IPsec connection
${connection} already exists
"
883 # Check if the name of the connection is valid
884 if ipsec_connection_check_name "${connection}"; then
885 error "'${connection}' contains illegal characters
"
889 log DEBUG "Creating VPN IPsec connection
${connection}"
891 if ! mkdir -p "${NETWORK_IPSEC_CONNS_DIR}/${connection}"; then
892 log ERROR "Could not create config directory
for ${connection}"
896 local ${IPSEC_CONNECTION_CONFIG_SETTINGS}
898 AUTH_MODE=${IPSEC_DEFAULT_AUTH_MODE}
899 DPD_ACTION=${IPSEC_DEFAULT_DPD_ACTION}
900 DPD_DELAY=${IPSEC_DEFAULT_DPD_DELAY}
901 DPD_TIMEOUT=${IPSEC_DEFAULT_DPD_TIMEOUT}
902 MODE=${IPSEC_DEFAULT_MODE}
903 START_ACTION=${IPSEC_DEFAULT_START_ACTION}
905 INACTIVITY_TIMEOUT=${IPSEC_DEFAULT_INACTIVITY_TIMEOUT}
906 SECURITY_POLICY=${IPSEC_DEFAULT_SECURITY_POLICY}
908 if ! ipsec_connection_write_config "${connection}"; then
909 log ERROR "Could not
write new config
file"
914 # Function that deletes based on the passed parameters one ore more vpn security policies
915 ipsec_connection_destroy() {
917 for connection in $@; do
918 if ! ipsec_connection_exists "${connection}"; then
919 log ERROR "The VPN IPsec connection
${connection} does not exist.
"
923 log DEBUG "Deleting VPN IPsec connection
${connection}"
924 if ! rm -rf "${NETWORK_IPSEC_CONNS_DIR}/${connection}"; then
925 log ERROR "Deleting the VPN IPsec connection
${connection} was not sucessful
"
931 # List all ipsec connections
932 ipsec_list_connections() {
934 for connection in ${NETWORK_IPSEC_CONNS_DIR}/*; do
935 [ -d ${connection} ] || continue
936 basename ${connection}
940 ipsec_connection_to_strongswan() {
941 local connection="${1}"
943 # Read the config settings
944 local ${IPSEC_CONNECTION_CONFIG_SETTINGS}
945 if ! ipsec_connection_read_config "${connection}"; then
946 error "Could not
read the connection
${connection}"
950 local path="${NETWORK_IPSEC_SWANCTL_CONNECTIONS_DIR}/${connection}.conf
"
953 # Write the connection section
954 _ipsec_connection_to_strongswan_connection "${connection}"
956 # Write the secrets section
957 _ipsec_connection_to_strongswan_secrets "${connection}"
962 _ipsec_connection_to_strongswan_connection() {
963 local connection="${1}"
965 # Read the security policy
966 local ${VPN_SECURITY_POLICIES_CONFIG_SETTINGS}
967 if ! vpn_security_policies_read_config "${SECURITY_POLICY}"; then
973 if isset DPD_DELAY && isinteger DPD_DELAY && [ ${DPD_DELAY} -gt 0 ]; then
977 print_indent 0 "connections
{"
978 print_indent 1 "${connection} {"
981 print_indent 2 "# IKE Version"
982 case "${KEY_EXCHANGE^^}" in
984 print_indent
2 "version = 1"
987 # Fall back to IKEv2 for any random values
989 print_indent
2 "version = 2"
995 print_indent
2 "# Local Address"
996 if isset LOCAL_ADDRESS
; then
997 print_indent
2 "local_addrs = ${LOCAL_ADDRESS}"
999 print_indent
2 "local_addrs = %any"
1004 print_indent
2 "# Remote Address"
1006 print_indent
2 "remote_addrs = ${PEER}"
1008 print_indent
2 "remote_addrs = %any"
1013 print_indent
2 "# IKE Proposals"
1014 print_indent
2 "proposals = $(vpn_security_policies_make_ike_proposal ${SECURITY_POLICY})"
1018 if enabled dpd
; then
1019 print_indent
2 "# Dead Peer Detection"
1020 print_indent
2 "dpd_delay = ${DPD_DELAY}"
1022 if isset DPD_TIMEOUT
; then
1023 print_indent
2 "dpd_timeout = ${DPD_TIMEOUT}"
1030 print_indent
2 "# Fragmentation"
1031 print_indent
2 "fragmentation = yes"
1035 print_indent
2 "local {"
1038 if isset LOCAL_ID
; then
1039 print_indent
3 "id = ${LOCAL_ID}"
1043 case "${AUTH_MODE}" in
1045 print_indent
3 "auth = psk"
1053 print_indent
2 "remote {"
1056 if isset REMOTE_ID
; then
1057 print_indent
3 "id = ${REMOTE_ID}"
1061 case "${AUTH_MODE}" in
1063 print_indent
3 "auth = psk"
1072 print_indent
2 "children {"
1073 print_indent
3 "${connection} {"
1075 print_indent
4 "# ESP Proposals"
1076 print_indent
4 "esp_proposals = $(vpn_security_policies_make_esp_proposal ${SECURITY_POLICY})"
1083 print_indent
4 "local_ts = dynamic[gre]"
1084 print_indent
4 "remote_ts = dynamic[gre]"
1088 if isset LOCAL_PREFIX
; then
1089 print_indent
4 "local_ts = $(list_join LOCAL_PREFIX ,)"
1091 print_indent
4 "local_ts = dynamic"
1095 if isset REMOTE_PREFIX
; then
1096 print_indent
4 "remote_ts = $(list_join REMOTE_PREFIX ,)"
1098 print_indent
4 "remote_ts = dynamic"
1105 print_indent
4 "# Netfilter Marks"
1106 print_indent
4 "mark_in = %unique"
1107 print_indent
4 "mark_out = %unique"
1110 # Dead Peer Detection
1111 if enabled dpd
; then
1112 print_indent
4 "# Dead Peer Detection"
1113 print_indent
4 "dpd_action = ${DPD_ACTION}"
1118 if isset LIFETIME
; then
1119 print_indent
4 "# Rekey Time"
1120 print_indent
4 "rekey_time = ${LIFETIME}"
1125 print_indent
4 "updown = ${NETWORK_HELPERS_DIR}/ipsec-updown"
1129 print_indent
4 "# Mode"
1132 print_indent
4 "mode = transport"
1135 print_indent
4 "mode = tunnel"
1141 print_indent
4 "# Compression"
1142 if enabled COMPRESSION
; then
1143 print_indent
4 "ipcomp = yes"
1145 print_indent
4 "ipcomp = no"
1149 # Inactivity Timeout
1150 if isset INACTIVITY_TIMEOUT
; then
1151 print_indent
4 "# Inactivity Timeout"
1152 print_indent
4 "inactivity = ${INACTIVITY_TIMEOUT}"
1157 print_indent
4 "# Start Action"
1158 case "${START_ACTION}" in
1160 print_indent
4 "start_action = trap"
1161 print_indent
4 "close_action = trap"
1164 print_indent
4 "start_action = none"
1165 print_indent
4 "close_action = none"
1168 print_indent
4 "start_action = start"
1169 print_indent
4 "close_action = start"
1183 _ipsec_connection_to_strongswan_secrets
() {
1184 local connection
="${1}"
1186 print_indent
0 "secrets {"
1188 case "${AUTH_MODE}" in
1190 print_indent
1 "ike {"
1193 print_indent
2 "secret = ${PSK}"
1196 if isset REMOTE_ID
; then
1197 print_indent
2 "id = ${REMOTE_ID}"