1 diff -ruN strongswan-2.8.2-orig/programs/_updown/_updown.8 strongswan-2.8.2/programs/_updown/_updown.8
2 --- strongswan-2.8.2-orig/programs/_updown/_updown.8 2006-04-17 02:48:49.000000000 -0400
3 +++ strongswan-2.8.2/programs/_updown/_updown.8 2007-02-05 02:13:05.252612099 -0500
6 is invoked by pluto when it has brought up a new connection. This script
7 is used to insert the appropriate routing entries for IPsec operation.
8 -It can also be used to insert and delete dynamic iptables firewall rules.
9 -The interface to the script is documented in the pluto man page.
10 +It also inserts and deletes dynamic iptables firewall rules. IMPORTANT!
11 +By default, it will ACCEPT as appropriate on the INPUT, OUTPUT, FORWARD
12 +tables. Most distributions will want to change that to provide more
13 +flexibility in their firewall configuration.
14 +The script looks for the environment variables
15 +.B IPSEC_UPDOWN_RULE_IN
16 +for the iptables table it should insert into,
17 +.B IPSEC_UPDOWN_DEST_IN
18 +for where the rule should -j jump to,
19 +.B IPSEC_UPDOWN_RULE_OUT
20 +.B IPSEC_UPDOWN_DEST_OUT
21 +for the same on outgoing packets, and
22 +.B IPSEC_UPDOWN_FWD_RULE_IN
23 +.B IPSEC_UPDOWN_FWD_DEST_IN
24 +.B IPSEC_UPDOWN_FWD_RULE_OUT
25 +.B IPSEC_UPDOWN_FWD_DEST_OUT
26 +respectively for packets being forwarded to/from the local networks.
28 ipsec(8), ipsec_pluto(8).
30 diff -ruN strongswan-2.8.2-orig/programs/_updown/_updown.in strongswan-2.8.2/programs/_updown/_updown.in
31 --- strongswan-2.8.2-orig/programs/_updown/_updown.in 2006-04-17 11:06:29.000000000 -0400
32 +++ strongswan-2.8.2/programs/_updown/_updown.in 2007-02-05 02:08:24.969100428 -0500
34 # Copyright (C) 2003-2004 Tuomo Soini
35 # Copyright (C) 2002-2004 Michael Richardson
36 # Copyright (C) 2005-2006 Andreas Steffen <andreas.steffen@strongswan.org>
37 +# Copyright (C) 2007 Kevin Cody Jr <kcody@vegaresearch.com>
39 # This program is free software; you can redistribute it and/or modify it
40 # under the terms of the GNU General Public License as published by the
42 # restricted on the peer side.
45 -# uncomment to log VPN connections
48 +# set to /bin/true to silence log messages
51 # tag put in front of each log entry:
55 # syslog facility and priority used:
56 -FAC_PRIO=local0.notice
58 -# to create a special vpn logging file, put the following line into
59 -# the syslog configuration file /etc/syslog.conf:
61 -# local0.notice -/var/log/vpn
63 +FAC_PRIO=authpriv.info
66 +# in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
67 +if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ] ; then
71 + IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
72 + IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
73 + IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
76 +# are there port numbers?
77 +if [ "$PLUTO_MY_PORT" != 0 ] ; then
78 + S_MY_PORT="--sport $PLUTO_MY_PORT"
79 + D_MY_PORT="--dport $PLUTO_MY_PORT"
82 +if [ "$PLUTO_PEER_PORT" != 0 ] ; then
83 + S_PEER_PORT="--sport $PLUTO_PEER_PORT"
84 + D_PEER_PORT="--dport $PLUTO_PEER_PORT"
87 +# import firewall behavior
88 +IPT_RULE_IN=$IPSEC_UPDOWN_RULE_IN
89 +IPT_DEST_IN=$IPSEC_UPDOWN_DEST_IN
90 +IPT_RULE_OUT=$IPSEC_UPDOWN_RULE_OUT
91 +IPT_DEST_OUT=$IPSEC_UPDOWN_DEST_OUT
93 +# import forwarding behavior
94 +FWD_RULE_IN=$IPSEC_UPDOWN_FWD_RULE_IN
95 +FWD_DEST_IN=$IPSEC_UPDOWN_FWD_DEST_IN
96 +FWD_RULE_OUT=$IPSEC_UPDOWN_FWD_RULE_OUT
97 +FWD_DEST_OUT=$IPSEC_UPDOWN_FWD_DEST_OUT
99 +# default firewall behavior
100 +[ -z "$IPT_RULE_IN" ] && IPT_RULE_IN=INPUT
101 +[ -z "$IPT_DEST_IN" ] && IPT_DEST_IN=ACCEPT
102 +[ -z "$IPT_RULE_OUT" ] && IPT_RULE_OUT=OUTPUT
103 +[ -z "$IPT_DEST_OUT" ] && IPT_DEST_OUT=ACCEPT
105 +# default forwarding behavior
106 +[ -z "$FWD_RULE_IN" ] && FWD_RULE_IN=FORWARD
107 +[ -z "$FWD_DEST_IN" ] && FWD_DEST_IN=ACCEPT
108 +[ -z "$FWD_RULE_OUT" ] && FWD_RULE_OUT=FORWARD
109 +[ -z "$FWD_DEST_OUT" ] && FWD_DEST_OUT=ACCEPT
112 # check interface version
113 case "$PLUTO_VERSION" in
118 -iptables:iptables) # due to (left/right)firewall; for default script only
120 custom:*) # custom parameters (see above CAUTION comment)
122 *) echo "$0: unknown parameters \`$*'" >&2
123 @@ -159,345 +199,307 @@
128 # utility functions for route manipulation
129 # Meddling with this stuff should not be necessary and requires great care.
147 + [ -n "$in_rule" -a -n "$in_dest" ] && \
148 + iptables -I $in_rule 1 \
149 + -i $PLUTO_INTERFACE \
150 + -p $PLUTO_MY_PROTOCOL \
151 + -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
152 + -d $PLUTO_MY_CLIENT $D_MY_PORT \
156 + [ -n "$out_rule" -a -n "$out_dest" ] && \
157 + iptables -I $out_rule 1 \
158 + -o $PLUTO_INTERFACE \
159 + -p $PLUTO_PEER_PROTOCOL \
160 + -s $PLUTO_MY_CLIENT $S_MY_PORT \
161 + -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
162 + $IPSEC_POLICY_OUT \
173 + [ -n "$in_rule" -a -n "$in_dest" ] && \
174 + iptables -D $in_rule \
175 + -i $PLUTO_INTERFACE \
176 + -p $PLUTO_MY_PROTOCOL \
177 + -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
178 + -d $PLUTO_MY_CLIENT $D_MY_PORT \
182 + [ -n "$out_rule" -a -n "$out_dest" ] && \
183 + iptables -D $out_rule \
184 + -o $PLUTO_INTERFACE \
185 + -p $PLUTO_PEER_PROTOCOL \
186 + -s $PLUTO_MY_CLIENT $S_MY_PORT \
187 + -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
188 + $IPSEC_POLICY_OUT \
195 - if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local
198 + if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local ; then
200 it="ip addr add ${PLUTO_MY_SOURCEIP%/*}/32 dev $PLUTO_INTERFACE"
201 oops="`eval $it 2>&1`"
203 - if test " $oops" = " " -a " $st" != " 0"
206 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
207 oops="silent error, exit status $st"
209 - if test " $oops" != " " -o " $st" != " 0"
212 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
213 echo "$0: addsource \`$it' failed ($oops)" >&2
222 parms="$PLUTO_PEER_CLIENT"
223 + parms2="dev $PLUTO_INTERFACE"
226 - if [ -n "$PLUTO_NEXT_HOP" ]
228 - parms2="via $PLUTO_NEXT_HOP"
230 - parms2="$parms2 dev $PLUTO_INTERFACE"
232 - if [ -z "$PLUTO_MY_SOURCEIP" ]
234 - if [ -f /etc/sysconfig/defaultsource ]
236 - . /etc/sysconfig/defaultsource
238 + if [ -z "$PLUTO_MY_SOURCEIP" ] ; then
240 - if [ -f /etc/conf.d/defaultsource ]
242 - . /etc/conf.d/defaultsource
244 + [ -f /etc/sysconfig/defaultsource ] && \
245 + . /etc/sysconfig/defaultsource
247 + [ -f /etc/conf.d/defaultsource ] && \
248 + . /etc/conf.d/defaultsource
250 + [ -n "$DEFAULTSOURCE" ] && \
251 + PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
253 - if [ -n "$DEFAULTSOURCE" ]
255 - PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
260 - if test "$1" = "add" -a -n "$PLUTO_MY_SOURCEIP"
262 + if [ "$1" = "add" -a -n "$PLUTO_MY_SOURCEIP" ] ; then
264 parms3="$parms3 src ${PLUTO_MY_SOURCEIP%/*}"
267 - case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
269 + if [ "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" = \
270 + "0.0.0.0/0.0.0.0" ] ; then
271 # opportunistic encryption work around
272 # need to provide route that eclipses default, without
274 - it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
275 - ip route $1 128.0.0.0/1 $parms2 $parms3"
277 - *) it="ip route $1 $parms $parms2 $parms3"
280 + it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
281 + ip route $1 128.0.0.0/1 $parms2 $parms3"
283 + it="ip route $1 $parms $parms2 $parms3"
286 oops="`eval $it 2>&1`"
288 - if test " $oops" = " " -a " $st" != " 0"
290 - oops="silent error, exit status $st"
292 - if test " $oops" != " " -o " $st" != " 0"
294 - echo "$0: doroute \`$it' failed ($oops)" >&2
296 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
297 + oops="silent error, exit status $st"
300 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
301 + echo "$0: doroute \`$it' failed ($oops)" >&2
307 -# in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
308 -if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ]
311 - IPSEC_POLICY_OUT=""
313 - IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
314 - IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
315 - IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
318 -# are there port numbers?
319 -if [ "$PLUTO_MY_PORT" != 0 ]
321 - S_MY_PORT="--sport $PLUTO_MY_PORT"
322 - D_MY_PORT="--dport $PLUTO_MY_PORT"
324 -if [ "$PLUTO_PEER_PORT" != 0 ]
326 - S_PEER_PORT="--sport $PLUTO_PEER_PORT"
327 - D_PEER_PORT="--dport $PLUTO_PEER_PORT"
332 + if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ] ; then
335 + rem="$PLUTO_PEER_CLIENT == $PLUTO_PEER"
338 + if [ "$PLUTO_MY_CLIENT" == "$PLUTO_ME/32" ] ; then
341 + loc="$PLUTO_ME == $PLUTO_MY_CLIENT"
344 + $LOGGER -t $TAG -p $FAC_PRIO "$action $rem -- $loc ($PLUTO_PEER_ID)"
350 case "$PLUTO_VERB:$1" in
351 prepare-host:*|prepare-client:*)
352 # delete possibly-existing route (preliminary to adding a route)
353 - case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
355 - # need to provide route that eclipses default, without
357 + if [ "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" = \
358 + "0.0.0.0/0.0.0.0" ] ; then
359 + # need to remove the route that eclipses default, without
362 - parms2="128.0.0.0/1"
363 - it="ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1"
364 - oops="`ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1`"
367 - parms="$PLUTO_PEER_CLIENT"
368 - it="ip route delete $parms 2>&1"
369 - oops="`ip route delete $parms 2>&1`"
373 - if test " $oops" = " " -a " $status" != " 0"
375 - oops="silent error, exit status $status"
376 + it="( ip route delete 0.0.0.0/1 ;
377 + ip route delete 128.0.0.0/1 )"
379 + it="ip route delete $PLUTO_PEER_CLIENT"
385 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
386 + oops="silent error, exit status $st"
390 *'RTNETLINK answers: No such process'*)
391 # This is what route (currently -- not documented!) gives
392 # for "could not find such a route".
398 - if test " $oops" != " " -o " $status" != " 0"
401 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
402 echo "$0: \`$it' failed ($oops)" >&2
409 route-host:*|route-client:*)
410 # connection to me or my client subnet being routed
412 + ipsec _showstatus valid
416 unroute-host:*|unroute-client:*)
417 # connection to me or my client subnet being unrouted
419 + ipsec _showstatus invalid
425 # connection to me coming up
426 - # If you are doing a custom version, firewall commands go here.
428 + ipsec _showstatus up
429 + upfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
430 + dologentry "VPN-UP"
435 # connection to me going down
436 - # If you are doing a custom version, firewall commands go here.
439 - # connection to my client subnet coming up
440 - # If you are doing a custom version, firewall commands go here.
443 - # connection to my client subnet going down
444 - # If you are doing a custom version, firewall commands go here.
446 + ipsec _showstatus down
447 + downfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
448 + dologentry "VPN-DN"
452 - # connection to me, with (left/right)firewall=yes, coming up
453 - # This is used only by the default updown script, not by your custom
454 - # ones, so do not mess with it; see CAUTION comment up at top.
455 - iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
456 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
457 - -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
458 - iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
459 - -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
460 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT -j ACCEPT
462 - # log IPsec host connection setup
463 - if [ $VPN_LOGGING ]
465 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
467 - logger -t $TAG -p $FAC_PRIO \
468 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME"
470 - logger -t $TAG -p $FAC_PRIO \
471 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
476 - # connection to me, with (left/right)firewall=yes, going down
477 - # This is used only by the default updown script, not by your custom
478 - # ones, so do not mess with it; see CAUTION comment up at top.
479 - iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
480 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
481 - -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
482 - iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
483 - -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
484 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT -j ACCEPT
486 - # log IPsec host connection teardown
487 - if [ $VPN_LOGGING ]
489 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
491 - logger -t $TAG -p $FAC_PRIO -- \
492 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME"
494 - logger -t $TAG -p $FAC_PRIO -- \
495 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
500 - # connection to client subnet, with (left/right)firewall=yes, coming up
501 - # This is used only by the default updown script, not by your custom
502 - # ones, so do not mess with it; see CAUTION comment up at top.
503 - if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
505 - iptables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
506 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
507 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
508 - $IPSEC_POLICY_OUT -j ACCEPT
509 - iptables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
510 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
511 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
512 - $IPSEC_POLICY_IN -j ACCEPT
514 + # connection to client subnet coming up
516 + ipsec _showstatus up
518 + if [ "$PLUTO_MY_CLIENT" != "$PLUTO_ME/32" -a \
519 + "$PLUTO_MY_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ] ; then
520 + upfirewall $FWD_RULE_IN $FWD_DEST_IN $FWD_RULE_OUT $FWD_DEST_OUT
524 # a virtual IP requires an INPUT and OUTPUT rule on the host
525 # or sometimes host access via the internal IP is needed
526 - if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
528 - iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
529 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
530 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
531 - $IPSEC_POLICY_IN -j ACCEPT
532 - iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
533 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
534 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
535 - $IPSEC_POLICY_OUT -j ACCEPT
538 - # log IPsec client connection setup
539 - if [ $VPN_LOGGING ]
541 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
543 - logger -t $TAG -p $FAC_PRIO \
544 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
546 - logger -t $TAG -p $FAC_PRIO \
547 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
551 -down-client:iptables)
552 - # connection to client subnet, with (left/right)firewall=yes, going down
553 - # This is used only by the default updown script, not by your custom
554 - # ones, so do not mess with it; see CAUTION comment up at top.
555 - if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
557 - iptables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
558 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
559 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
560 - $IPSEC_POLICY_OUT -j ACCEPT
561 - iptables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
562 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
563 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
564 - $IPSEC_POLICY_IN -j ACCEPT
565 + if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ] ; then
566 + upfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
569 + dologentry "VPN-UP"
573 + # connection to client subnet going down
575 + ipsec _showstatus down
577 + if [ "$PLUTO_MY_CLIENT" != "$PLUTO_ME/32" -a \
578 + "$PLUTO_MY_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ] ; then
579 + downfirewall $FWD_RULE_IN $FWD_DEST_IN $FWD_RULE_OUT $FWD_DEST_OUT
583 # a virtual IP requires an INPUT and OUTPUT rule on the host
584 # or sometimes host access via the internal IP is needed
585 - if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
587 - iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
588 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
589 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
590 - $IPSEC_POLICY_IN -j ACCEPT
591 - iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
592 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
593 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
594 - $IPSEC_POLICY_OUT -j ACCEPT
597 - # log IPsec client connection teardown
598 - if [ $VPN_LOGGING ]
600 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
602 - logger -t $TAG -p $FAC_PRIO -- \
603 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
605 - logger -t $TAG -p $FAC_PRIO -- \
606 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
608 + if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ] ; then
609 + downfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
612 + dologentry "VPN-DN"
618 prepare-host-v6:*|prepare-client-v6:*)
621 route-host-v6:*|route-client-v6:*)
622 # connection to me or my client subnet being routed
627 unroute-host-v6:*|unroute-client-v6:*)
628 # connection to me or my client subnet being unrouted
634 # connection to me coming up
635 # If you are doing a custom version, firewall commands go here.
639 # connection to me going down
640 # If you are doing a custom version, firewall commands go here.
644 # connection to my client subnet coming up
645 # If you are doing a custom version, firewall commands go here.
649 # connection to my client subnet going down
650 # If you are doing a custom version, firewall commands go here.
653 -*) echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2
655 + echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2