2 # iproute2 version, default updown script
4 # Copyright (C) 2003-2004 Nigel Meteringham
5 # Copyright (C) 2003-2004 Tuomo Soini
6 # Copyright (C) 2002-2004 Michael Richardson
7 # Copyright (C) 2005-2007 Andreas Steffen <andreas.steffen@strongswan.org>
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 2 of the License, or (at your
12 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 # CAUTION: Installing a new version of strongSwan will install a new
20 # copy of this script, wiping out any custom changes you make. If
21 # you need changes, make a copy of this under another name, and customize
22 # that, and use the (left/right)updown parameters in ipsec.conf to make
23 # strongSwan use yours instead of this default one.
25 # things that this script gets (from ipsec_pluto(8) man page)
28 # indicates what version of this interface is being
29 # used. This document describes version 1.1. This
30 # is upwardly compatible with version 1.0.
33 # specifies the name of the operation to be performed
34 # (prepare-host, prepare-client, up-host, up-client,
35 # down-host, or down-client). If the address family
36 # for security gateway to security gateway communica-
37 # tions is IPv6, then a suffix of -v6 is added to the
41 # is the name of the connection for which we are
45 # is the next hop to which packets bound for the peer
49 # is the name of the ipsec interface to be used.
52 # is the requid of the ESP policy
55 # is the IP address of our host.
58 # is the ID of our host.
61 # is the IP address / count of our client subnet. If
62 # the client is just the host, this will be the
63 # host's own IP address / max (where max is 32 for
64 # IPv4 and 128 for IPv6).
67 # is the IP address of our client net. If the client
68 # is just the host, this will be the host's own IP
71 # PLUTO_MY_CLIENT_MASK
72 # is the mask for our client net. If the client is
73 # just the host, this will be 255.255.255.255.
76 # if non-empty, then the source address for the route will be
77 # set to this IP address.
80 # is the IP protocol that will be transported.
83 # is the UDP/TCP port to which the IPsec SA is
84 # restricted on our side.
87 # is the IP address of our peer.
90 # is the ID of our peer.
93 # is the CA which issued the cert of our peer.
96 # is the IP address / count of the peer's client sub-
97 # net. If the client is just the peer, this will be
98 # the peer's own IP address / max (where max is 32
99 # for IPv4 and 128 for IPv6).
101 # PLUTO_PEER_CLIENT_NET
102 # is the IP address of the peer's client net. If the
103 # client is just the peer, this will be the peer's
106 # PLUTO_PEER_CLIENT_MASK
107 # is the mask for the peer's client net. If the
108 # client is just the peer, this will be
111 # PLUTO_PEER_PROTOCOL
112 # is the IP protocol that will be transported.
115 # is the UDP/TCP port to which the IPsec SA is
116 # restricted on the peer side.
119 # is an optional user ID employed by the XAUTH protocol
122 # is an optional XFRM mark set on the inbound IPsec SA
125 # is an optional XFRM mark set on the outbound IPsec SA
128 # contains the remote UDP port in the case of ESP_IN_UDP
132 # define a minimum PATH environment in case it is not set
133 PATH="/sbin:/bin:/usr/sbin:/usr/bin:@sbindir@"
136 # uncomment to log VPN connections
139 # tag put in front of each log entry:
142 # syslog facility and priority used:
143 FAC_PRIO=local0.notice
145 # to create a special vpn logging file, put the following line into
146 # the syslog configuration file /etc/syslog.conf:
148 # local0.notice -/var/log/vpn
150 # in order to use source IP routing the Linux kernel options
151 # CONFIG_IP_ADVANCED_ROUTER and CONFIG_IP_MULTIPLE_TABLES
154 # special routing table for sourceip routes
155 SOURCEIP_ROUTING_TABLE=@routing_table@
157 # priority of the sourceip routing table
158 SOURCEIP_ROUTING_TABLE_PRIO=@routing_table_prio@
160 # check interface version
161 case "$PLUTO_VERSION" in
162 1.[0|1]) # Older Pluto?!? Play it safe, script may be using new features.
163 echo "$0: obsolete interface version \`$PLUTO_VERSION'," >&2
164 echo "$0: called by obsolete Pluto?" >&2
168 *) echo "$0: unknown interface version \`$PLUTO_VERSION'" >&2
177 iptables:iptables) # due to (left/right)firewall; for default script only
179 custom:*) # custom parameters (see above CAUTION comment)
181 *) echo "$0: unknown parameters \`$*'" >&2
186 # utility functions for route manipulation
187 # Meddling with this stuff should not be necessary and requires great care.
199 if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local
201 it="ip addr add ${PLUTO_MY_SOURCEIP%/*}/32 dev $PLUTO_INTERFACE"
202 oops="`eval $it 2>&1`"
204 if test " $oops" = " " -a " $st" != " 0"
206 oops="silent error, exit status $st"
208 if test " $oops" != " " -o " $st" != " 0"
210 echo "$0: addsource \`$it' failed ($oops)" >&2
219 if [ -z "$PLUTO_MY_SOURCEIP" ]
221 for dir in /etc/sysconfig /etc/conf.d; do
222 if [ -f "$dir/defaultsource" ]
224 . "$dir/defaultsource"
228 if [ -n "$DEFAULTSOURCE" ]
230 PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
234 if [ -z "$KLIPS" -a -z "$PLUTO_MY_SOURCEIP" ]
236 # leave because no route entry is required
240 parms1="$PLUTO_PEER_CLIENT"
242 if [ -n "$PLUTO_NEXT_HOP" ]
244 parms2="via $PLUTO_NEXT_HOP"
246 parms2="via $PLUTO_PEER"
248 parms2="$parms2 dev $PLUTO_INTERFACE"
251 if [ -n "$PLUTO_MY_SOURCEIP" ]
256 if ! ip rule list | grep -q "lookup $SOURCEIP_ROUTING_TABLE"
258 ip rule add pref $SOURCEIP_ROUTING_TABLE_PRIO table $SOURCEIP_ROUTING_TABLE
261 parms3="$parms3 src ${PLUTO_MY_SOURCEIP%/*} table $SOURCEIP_ROUTING_TABLE"
264 case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
266 # opportunistic encryption work around
267 # need to provide route that eclipses default, without
269 it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
270 ip route $1 128.0.0.0/1 $parms2 $parms3"
272 *) it="ip route $1 $parms1 $parms2 $parms3"
275 oops="`eval $it 2>&1`"
277 if test " $oops" = " " -a " $st" != " 0"
279 oops="silent error, exit status $st"
281 if test " $oops" != " " -o " $st" != " 0"
283 echo "$0: doroute \`$it' failed ($oops)" >&2
288 # in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
289 if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ]
296 IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
297 IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
298 IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
301 # are there port numbers?
302 if [ "$PLUTO_MY_PORT" != 0 ]
304 S_MY_PORT="--sport $PLUTO_MY_PORT"
305 D_MY_PORT="--dport $PLUTO_MY_PORT"
307 if [ "$PLUTO_PEER_PORT" != 0 ]
309 S_PEER_PORT="--sport $PLUTO_PEER_PORT"
310 D_PEER_PORT="--dport $PLUTO_PEER_PORT"
313 # resolve octal escape sequences
314 PLUTO_MY_ID=`printf "$PLUTO_MY_ID"`
315 PLUTO_PEER_ID=`printf "$PLUTO_PEER_ID"`
318 case "$PLUTO_VERB:$1" in
319 prepare-host:*|prepare-client:*)
320 if [ -z "$KLIPS" -a -z "$PLUTO_MY_SOURCEIP" ]
322 # exit because no route will be added,
323 # so that existing routes can stay
327 # delete possibly-existing route (preliminary to adding a route)
328 case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
330 # need to provide route that eclipses default, without
334 it="ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1"
335 oops="`ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1`"
338 parms="$PLUTO_PEER_CLIENT"
339 it="ip route delete $parms 2>&1"
340 oops="`ip route delete $parms 2>&1`"
344 if test " $oops" = " " -a " $status" != " 0"
346 oops="silent error, exit status $status"
349 *'RTNETLINK answers: No such process'*)
350 # This is what route (currently -- not documented!) gives
351 # for "could not find such a route".
356 if test " $oops" != " " -o " $status" != " 0"
358 echo "$0: \`$it' failed ($oops)" >&2
362 route-host:*|route-client:*)
363 # connection to me or my client subnet being routed
366 unroute-host:*|unroute-client:*)
367 # connection to me or my client subnet being unrouted
371 # connection to me coming up
372 # If you are doing a custom version, firewall commands go here.
375 # connection to me going down
376 # If you are doing a custom version, firewall commands go here.
379 # connection to my client subnet coming up
380 # If you are doing a custom version, firewall commands go here.
383 # connection to my client subnet going down
384 # If you are doing a custom version, firewall commands go here.
387 # connection to me, with (left/right)firewall=yes, coming up
388 # This is used only by the default updown script, not by your custom
389 # ones, so do not mess with it; see CAUTION comment up at top.
390 iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
391 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
392 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
393 iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
394 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
395 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
397 # log IPsec host connection setup
400 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
402 logger -t $TAG -p $FAC_PRIO \
403 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
405 logger -t $TAG -p $FAC_PRIO \
406 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
411 # connection to me, with (left/right)firewall=yes, going down
412 # This is used only by the default updown script, not by your custom
413 # ones, so do not mess with it; see CAUTION comment up at top.
414 iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
415 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
416 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
417 iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
418 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
419 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
421 # log IPsec host connection teardown
424 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
426 logger -t $TAG -p $FAC_PRIO -- \
427 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
429 logger -t $TAG -p $FAC_PRIO -- \
430 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
435 # connection to client subnet, with (left/right)firewall=yes, coming up
436 # This is used only by the default updown script, not by your custom
437 # ones, so do not mess with it; see CAUTION comment up at top.
438 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
440 iptables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
441 -s $PLUTO_MY_CLIENT $S_MY_PORT \
442 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
443 iptables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
444 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
445 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
448 # a virtual IP requires an INPUT and OUTPUT rule on the host
449 # or sometimes host access via the internal IP is needed
450 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
452 iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
453 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
454 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
455 iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
456 -s $PLUTO_MY_CLIENT $S_MY_PORT \
457 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
460 # log IPsec client connection setup
463 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
465 logger -t $TAG -p $FAC_PRIO \
466 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
468 logger -t $TAG -p $FAC_PRIO \
469 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
473 down-client:iptables)
474 # connection to client subnet, with (left/right)firewall=yes, going down
475 # This is used only by the default updown script, not by your custom
476 # ones, so do not mess with it; see CAUTION comment up at top.
477 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
479 iptables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
480 -s $PLUTO_MY_CLIENT $S_MY_PORT \
481 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
482 $IPSEC_POLICY_OUT -j ACCEPT
483 iptables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
484 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
485 -d $PLUTO_MY_CLIENT $D_MY_PORT \
486 $IPSEC_POLICY_IN -j ACCEPT
489 # a virtual IP requires an INPUT and OUTPUT rule on the host
490 # or sometimes host access via the internal IP is needed
491 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
493 iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
494 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
495 -d $PLUTO_MY_CLIENT $D_MY_PORT \
496 $IPSEC_POLICY_IN -j ACCEPT
497 iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
498 -s $PLUTO_MY_CLIENT $S_MY_PORT \
499 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
500 $IPSEC_POLICY_OUT -j ACCEPT
503 # log IPsec client connection teardown
506 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
508 logger -t $TAG -p $FAC_PRIO -- \
509 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
511 logger -t $TAG -p $FAC_PRIO -- \
512 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
519 prepare-host-v6:*|prepare-client-v6:*)
521 route-host-v6:*|route-client-v6:*)
522 # connection to me or my client subnet being routed
525 unroute-host-v6:*|unroute-client-v6:*)
526 # connection to me or my client subnet being unrouted
530 # connection to me coming up
531 # If you are doing a custom version, firewall commands go here.
534 # connection to me going down
535 # If you are doing a custom version, firewall commands go here.
538 # connection to my client subnet coming up
539 # If you are doing a custom version, firewall commands go here.
542 # connection to my client subnet going down
543 # If you are doing a custom version, firewall commands go here.
546 # connection to me, with (left/right)firewall=yes, coming up
547 # This is used only by the default updown script, not by your custom
548 # ones, so do not mess with it; see CAUTION comment up at top.
549 ip6tables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
550 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
551 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
552 ip6tables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
553 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
554 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
556 # log IPsec host connection setup
559 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
561 logger -t $TAG -p $FAC_PRIO \
562 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
564 logger -t $TAG -p $FAC_PRIO \
565 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
569 down-host-v6:iptables)
570 # connection to me, with (left/right)firewall=yes, going down
571 # This is used only by the default updown script, not by your custom
572 # ones, so do not mess with it; see CAUTION comment up at top.
573 ip6tables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
574 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
575 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
576 ip6tables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
577 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
578 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
580 # log IPsec host connection teardown
583 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
585 logger -t $TAG -p $FAC_PRIO -- \
586 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
588 logger -t $TAG -p $FAC_PRIO -- \
589 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
593 up-client-v6:iptables)
594 # connection to client subnet, with (left/right)firewall=yes, coming up
595 # This is used only by the default updown script, not by your custom
596 # ones, so do not mess with it; see CAUTION comment up at top.
597 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/128" ]
599 ip6tables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
600 -s $PLUTO_MY_CLIENT $S_MY_PORT \
601 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
602 ip6tables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
603 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
604 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
607 # a virtual IP requires an INPUT and OUTPUT rule on the host
608 # or sometimes host access via the internal IP is needed
609 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
611 ip6tables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
612 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
613 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
614 ip6tables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
615 -s $PLUTO_MY_CLIENT $S_MY_PORT \
616 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
619 # log IPsec client connection setup
622 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
624 logger -t $TAG -p $FAC_PRIO \
625 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
627 logger -t $TAG -p $FAC_PRIO \
628 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
632 down-client-v6:iptables)
633 # connection to client subnet, with (left/right)firewall=yes, going down
634 # This is used only by the default updown script, not by your custom
635 # ones, so do not mess with it; see CAUTION comment up at top.
636 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/128" ]
638 ip6tables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
639 -s $PLUTO_MY_CLIENT $S_MY_PORT \
640 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
641 $IPSEC_POLICY_OUT -j ACCEPT
642 ip6tables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
643 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
644 -d $PLUTO_MY_CLIENT $D_MY_PORT \
645 $IPSEC_POLICY_IN -j ACCEPT
648 # a virtual IP requires an INPUT and OUTPUT rule on the host
649 # or sometimes host access via the internal IP is needed
650 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
652 ip6tables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
653 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
654 -d $PLUTO_MY_CLIENT $D_MY_PORT \
655 $IPSEC_POLICY_IN -j ACCEPT
656 ip6tables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
657 -s $PLUTO_MY_CLIENT $S_MY_PORT \
658 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
659 $IPSEC_POLICY_OUT -j ACCEPT
662 # log IPsec client connection teardown
665 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
667 logger -t $TAG -p $FAC_PRIO -- \
668 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
670 logger -t $TAG -p $FAC_PRIO -- \
671 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
675 *) echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2