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
21 # CAUTION: Installing a new version of strongSwan will install a new
22 # copy of this script, wiping out any custom changes you make. If
23 # you need changes, make a copy of this under another name, and customize
24 # that, and use the (left/right)updown parameters in ipsec.conf to make
25 # strongSwan use yours instead of this default one.
27 # things that this script gets (from ipsec_pluto(8) man page)
30 # indicates what version of this interface is being
31 # used. This document describes version 1.1. This
32 # is upwardly compatible with version 1.0.
35 # specifies the name of the operation to be performed
36 # (prepare-host, prepare-client, up-host, up-client,
37 # down-host, or down-client). If the address family
38 # for security gateway to security gateway communica
39 # tions is IPv6, then a suffix of -v6 is added to the
43 # is the name of the connection for which we are
47 # is the next hop to which packets bound for the peer
51 # is the name of the ipsec interface to be used.
54 # is the requid of the ESP policy
57 # is the IP address of our host.
60 # is the ID of our host.
63 # is the IP address / count of our client subnet. If
64 # the client is just the host, this will be the
65 # host's own IP address / max (where max is 32 for
66 # IPv4 and 128 for IPv6).
69 # is the IP address of our client net. If the client
70 # is just the host, this will be the host's own IP
73 # PLUTO_MY_CLIENT_MASK
74 # is the mask for our client net. If the client is
75 # just the host, this will be 255.255.255.255.
78 # if non-empty, then the source address for the route will be
79 # set to this IP address.
82 # is the IP protocol that will be transported.
85 # is the UDP/TCP port to which the IPsec SA is
86 # restricted on our side.
89 # is the IP address of our peer.
92 # is the ID of our peer.
95 # is the CA which issued the cert of our peer.
98 # is the IP address / count of the peer's client sub
99 # net. If the client is just the peer, this will be
100 # the peer's own IP address / max (where max is 32
101 # for IPv4 and 128 for IPv6).
103 # PLUTO_PEER_CLIENT_NET
104 # is the IP address of the peer's client net. If the
105 # client is just the peer, this will be the peer's
108 # PLUTO_PEER_CLIENT_MASK
109 # is the mask for the peer's client net. If the
110 # client is just the peer, this will be
113 # PLUTO_PEER_PROTOCOL
114 # is the IP protocol that will be transported.
117 # is the UDP/TCP port to which the IPsec SA is
118 # restricted on the peer side.
121 # define a minimum PATH environment in case it is not set
122 PATH="/sbin:/bin:/usr/sbin:/usr/bin:@IPSEC_SBINDIR@"
125 # uncomment to log VPN connections
128 # tag put in front of each log entry:
131 # syslog facility and priority used:
132 FAC_PRIO=local0.notice
134 # to create a special vpn logging file, put the following line into
135 # the syslog configuration file /etc/syslog.conf:
137 # local0.notice -/var/log/vpn
139 # in order to use source IP routing the Linux kernel options
140 # CONFIG_IP_ADVANCED_ROUTER and CONFIG_IP_MULTIPLE_TABLES
143 # special routing table for sourceip routes
144 SOURCEIP_ROUTING_TABLE=@IPSEC_ROUTING_TABLE@
146 # priority of the sourceip routing table
147 SOURCEIP_ROUTING_TABLE_PRIO=@IPSEC_ROUTING_TABLE_PRIO@
149 # check interface version
150 case "$PLUTO_VERSION" in
151 1.[0|1]) # Older Pluto?!? Play it safe, script may be using new features.
152 echo "$0: obsolete interface version \`$PLUTO_VERSION'," >&2
153 echo "$0: called by obsolete Pluto?" >&2
157 *) echo "$0: unknown interface version \`$PLUTO_VERSION'" >&2
166 iptables:iptables) # due to (left/right)firewall; for default script only
168 custom:*) # custom parameters (see above CAUTION comment)
170 *) echo "$0: unknown parameters \`$*'" >&2
175 # utility functions for route manipulation
176 # Meddling with this stuff should not be necessary and requires great care.
188 if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local
190 it="ip addr add ${PLUTO_MY_SOURCEIP%/*}/32 dev $PLUTO_INTERFACE"
191 oops="`eval $it 2>&1`"
193 if test " $oops" = " " -a " $st" != " 0"
195 oops="silent error, exit status $st"
197 if test " $oops" != " " -o " $st" != " 0"
199 echo "$0: addsource \`$it' failed ($oops)" >&2
208 if [ -z "$PLUTO_MY_SOURCEIP" ]
210 if [ -f /etc/sysconfig/defaultsource ]
212 . /etc/sysconfig/defaultsource
215 if [ -f /etc/conf.d/defaultsource ]
217 . /etc/conf.d/defaultsource
220 if [ -n "$DEFAULTSOURCE" ]
222 PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
226 if [ -z "$KLIPS" -a -z "$PLUTO_MY_SOURCEIP" ]
228 # leave because no route entry is required
232 parms1="$PLUTO_PEER_CLIENT"
234 if [ -n "$PLUTO_NEXT_HOP" ]
236 parms2="via $PLUTO_NEXT_HOP"
238 parms2="via $PLUTO_PEER"
240 parms2="$parms2 dev $PLUTO_INTERFACE"
243 if [ -n "$PLUTO_MY_SOURCEIP" ]
248 if ! ip rule list | grep -q "lookup $SOURCEIP_ROUTING_TABLE"
250 ip rule add pref $SOURCEIP_ROUTING_TABLE_PRIO table $SOURCEIP_ROUTING_TABLE
253 parms3="$parms3 src ${PLUTO_MY_SOURCEIP%/*} table $SOURCEIP_ROUTING_TABLE"
256 case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
258 # opportunistic encryption work around
259 # need to provide route that eclipses default, without
261 it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
262 ip route $1 128.0.0.0/1 $parms2 $parms3"
264 *) it="ip route $1 $parms1 $parms2 $parms3"
267 oops="`eval $it 2>&1`"
269 if test " $oops" = " " -a " $st" != " 0"
271 oops="silent error, exit status $st"
273 if test " $oops" != " " -o " $st" != " 0"
275 echo "$0: doroute \`$it' failed ($oops)" >&2
280 # in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
281 if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ]
288 IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
289 IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
290 IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
293 # are there port numbers?
294 if [ "$PLUTO_MY_PORT" != 0 ]
296 S_MY_PORT="--sport $PLUTO_MY_PORT"
297 D_MY_PORT="--dport $PLUTO_MY_PORT"
299 if [ "$PLUTO_PEER_PORT" != 0 ]
301 S_PEER_PORT="--sport $PLUTO_PEER_PORT"
302 D_PEER_PORT="--dport $PLUTO_PEER_PORT"
305 # resolve octal escape sequences
306 PLUTO_MY_ID=`printf "$PLUTO_MY_ID"`
307 PLUTO_PEER_ID=`printf "$PLUTO_PEER_ID"`
310 case "$PLUTO_VERB:$1" in
311 prepare-host:*|prepare-client:*)
312 if [ -z "$KLIPS" -a -z "$PLUTO_MY_SOURCEIP" ]
314 # exit because no route will be added,
315 # so that existing routes can stay
319 # delete possibly-existing route (preliminary to adding a route)
320 case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
322 # need to provide route that eclipses default, without
326 it="ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1"
327 oops="`ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1`"
330 parms="$PLUTO_PEER_CLIENT"
331 it="ip route delete $parms 2>&1"
332 oops="`ip route delete $parms 2>&1`"
336 if test " $oops" = " " -a " $status" != " 0"
338 oops="silent error, exit status $status"
341 *'RTNETLINK answers: No such process'*)
342 # This is what route (currently -- not documented!) gives
343 # for "could not find such a route".
348 if test " $oops" != " " -o " $status" != " 0"
350 echo "$0: \`$it' failed ($oops)" >&2
354 route-host:*|route-client:*)
355 # connection to me or my client subnet being routed
358 unroute-host:*|unroute-client:*)
359 # connection to me or my client subnet being unrouted
363 # connection to me coming up
364 # If you are doing a custom version, firewall commands go here.
367 # connection to me going down
368 # If you are doing a custom version, firewall commands go here.
371 # connection to my client subnet coming up
372 # If you are doing a custom version, firewall commands go here.
375 # connection to my client subnet going down
376 # If you are doing a custom version, firewall commands go here.
379 # connection to me, with (left/right)firewall=yes, coming up
380 # This is used only by the default updown script, not by your custom
381 # ones, so do not mess with it; see CAUTION comment up at top.
382 iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
383 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
384 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
385 iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
386 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
387 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
389 # log IPsec host connection setup
392 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
394 logger -t $TAG -p $FAC_PRIO \
395 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
397 logger -t $TAG -p $FAC_PRIO \
398 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
403 # connection to me, with (left/right)firewall=yes, going down
404 # This is used only by the default updown script, not by your custom
405 # ones, so do not mess with it; see CAUTION comment up at top.
406 iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
407 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
408 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
409 iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
410 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
411 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
413 # log IPsec host connection teardown
416 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
418 logger -t $TAG -p $FAC_PRIO -- \
419 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
421 logger -t $TAG -p $FAC_PRIO -- \
422 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
427 # connection to client subnet, with (left/right)firewall=yes, coming up
428 # This is used only by the default updown script, not by your custom
429 # ones, so do not mess with it; see CAUTION comment up at top.
430 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
432 iptables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
433 -s $PLUTO_MY_CLIENT $S_MY_PORT \
434 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
435 iptables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
436 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
437 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
440 # a virtual IP requires an INPUT and OUTPUT rule on the host
441 # or sometimes host access via the internal IP is needed
442 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
444 iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
445 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
446 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
447 iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
448 -s $PLUTO_MY_CLIENT $S_MY_PORT \
449 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
452 # log IPsec client connection setup
455 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
457 logger -t $TAG -p $FAC_PRIO \
458 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
460 logger -t $TAG -p $FAC_PRIO \
461 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
465 down-client:iptables)
466 # connection to client subnet, with (left/right)firewall=yes, going down
467 # This is used only by the default updown script, not by your custom
468 # ones, so do not mess with it; see CAUTION comment up at top.
469 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
471 iptables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
472 -s $PLUTO_MY_CLIENT $S_MY_PORT \
473 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
474 $IPSEC_POLICY_OUT -j ACCEPT
475 iptables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
476 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
477 -d $PLUTO_MY_CLIENT $D_MY_PORT \
478 $IPSEC_POLICY_IN -j ACCEPT
481 # a virtual IP requires an INPUT and OUTPUT rule on the host
482 # or sometimes host access via the internal IP is needed
483 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
485 iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
486 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
487 -d $PLUTO_MY_CLIENT $D_MY_PORT \
488 $IPSEC_POLICY_IN -j ACCEPT
489 iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
490 -s $PLUTO_MY_CLIENT $S_MY_PORT \
491 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
492 $IPSEC_POLICY_OUT -j ACCEPT
495 # log IPsec client connection teardown
498 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/32" ]
500 logger -t $TAG -p $FAC_PRIO -- \
501 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
503 logger -t $TAG -p $FAC_PRIO -- \
504 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
511 prepare-host-v6:*|prepare-client-v6:*)
513 route-host-v6:*|route-client-v6:*)
514 # connection to me or my client subnet being routed
517 unroute-host-v6:*|unroute-client-v6:*)
518 # connection to me or my client subnet being unrouted
522 # connection to me coming up
523 # If you are doing a custom version, firewall commands go here.
526 # connection to me going down
527 # If you are doing a custom version, firewall commands go here.
530 # connection to my client subnet coming up
531 # If you are doing a custom version, firewall commands go here.
534 # connection to my client subnet going down
535 # If you are doing a custom version, firewall commands go here.
538 # connection to me, with (left/right)firewall=yes, coming up
539 # This is used only by the default updown script, not by your custom
540 # ones, so do not mess with it; see CAUTION comment up at top.
541 ip6tables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
542 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
543 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
544 ip6tables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
545 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
546 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
548 # log IPsec host connection setup
551 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
553 logger -t $TAG -p $FAC_PRIO \
554 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
556 logger -t $TAG -p $FAC_PRIO \
557 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
561 down-host-v6:iptables)
562 # connection to me, with (left/right)firewall=yes, going down
563 # This is used only by the default updown script, not by your custom
564 # ones, so do not mess with it; see CAUTION comment up at top.
565 ip6tables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
566 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
567 -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
568 ip6tables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
569 -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
570 -d $PLUTO_PEER_CLIENT $D_PEER_PORT -j ACCEPT
572 # log IPsec host connection teardown
575 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
577 logger -t $TAG -p $FAC_PRIO -- \
578 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME"
580 logger -t $TAG -p $FAC_PRIO -- \
581 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
585 up-client-v6:iptables)
586 # connection to client subnet, with (left/right)firewall=yes, coming up
587 # This is used only by the default updown script, not by your custom
588 # ones, so do not mess with it; see CAUTION comment up at top.
589 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/128" ]
591 ip6tables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
592 -s $PLUTO_MY_CLIENT $S_MY_PORT \
593 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
594 ip6tables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
595 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
596 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
599 # a virtual IP requires an INPUT and OUTPUT rule on the host
600 # or sometimes host access via the internal IP is needed
601 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
603 ip6tables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
604 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
605 -d $PLUTO_MY_CLIENT $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
606 ip6tables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
607 -s $PLUTO_MY_CLIENT $S_MY_PORT \
608 -d $PLUTO_PEER_CLIENT $D_PEER_PORT $IPSEC_POLICY_OUT -j ACCEPT
611 # log IPsec client connection setup
614 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
616 logger -t $TAG -p $FAC_PRIO \
617 "+ $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
619 logger -t $TAG -p $FAC_PRIO \
620 "+ $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
624 down-client-v6:iptables)
625 # connection to client subnet, with (left/right)firewall=yes, going down
626 # This is used only by the default updown script, not by your custom
627 # ones, so do not mess with it; see CAUTION comment up at top.
628 if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/128" ]
630 ip6tables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
631 -s $PLUTO_MY_CLIENT $S_MY_PORT \
632 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
633 $IPSEC_POLICY_OUT -j ACCEPT
634 ip6tables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
635 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
636 -d $PLUTO_MY_CLIENT $D_MY_PORT \
637 $IPSEC_POLICY_IN -j ACCEPT
640 # a virtual IP requires an INPUT and OUTPUT rule on the host
641 # or sometimes host access via the internal IP is needed
642 if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
644 ip6tables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
645 -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
646 -d $PLUTO_MY_CLIENT $D_MY_PORT \
647 $IPSEC_POLICY_IN -j ACCEPT
648 ip6tables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
649 -s $PLUTO_MY_CLIENT $S_MY_PORT \
650 -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
651 $IPSEC_POLICY_OUT -j ACCEPT
654 # log IPsec client connection teardown
657 if [ "$PLUTO_PEER_CLIENT" = "$PLUTO_PEER/128" ]
659 logger -t $TAG -p $FAC_PRIO -- \
660 "- $PLUTO_PEER_ID $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
662 logger -t $TAG -p $FAC_PRIO -- \
663 "- $PLUTO_PEER_ID $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
667 *) echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2