1 Index: strongswan-2.8.2/programs/_updown/_updown.8
2 ===================================================================
3 --- strongswan-2.8.2.orig/programs/_updown/_updown.8 2007-06-04 13:23:04.632029720 +0200
4 +++ strongswan-2.8.2/programs/_updown/_updown.8 2007-06-04 13:23:06.656721920 +0200
7 is invoked by pluto when it has brought up a new connection. This script
8 is used to insert the appropriate routing entries for IPsec operation.
9 -It can also be used to insert and delete dynamic iptables firewall rules.
10 -The interface to the script is documented in the pluto man page.
11 +It also inserts and deletes dynamic iptables firewall rules. IMPORTANT!
12 +By default, it will ACCEPT as appropriate on the INPUT, OUTPUT, FORWARD
13 +tables. Most distributions will want to change that to provide more
14 +flexibility in their firewall configuration.
15 +The script looks for the environment variables
16 +.B IPSEC_UPDOWN_RULE_IN
17 +for the iptables table it should insert into,
18 +.B IPSEC_UPDOWN_DEST_IN
19 +for where the rule should -j jump to,
20 +.B IPSEC_UPDOWN_RULE_OUT
21 +.B IPSEC_UPDOWN_DEST_OUT
22 +for the same on outgoing packets, and
23 +.B IPSEC_UPDOWN_FWD_RULE_IN
24 +.B IPSEC_UPDOWN_FWD_DEST_IN
25 +.B IPSEC_UPDOWN_FWD_RULE_OUT
26 +.B IPSEC_UPDOWN_FWD_DEST_OUT
27 +respectively for packets being forwarded to/from the local networks.
29 ipsec(8), ipsec_pluto(8).
31 Index: strongswan-2.8.2/programs/_updown/_updown.in
32 ===================================================================
33 --- strongswan-2.8.2.orig/programs/_updown/_updown.in 2007-06-04 13:23:04.642028200 +0200
34 +++ strongswan-2.8.2/programs/_updown/_updown.in 2007-06-04 13:23:06.657721768 +0200
36 # Copyright (C) 2003-2004 Tuomo Soini
37 # Copyright (C) 2002-2004 Michael Richardson
38 # Copyright (C) 2005-2006 Andreas Steffen <andreas.steffen@strongswan.org>
39 +# Copyright (C) 2007 Kevin Cody Jr <kcody@vegaresearch.com>
41 # This program is free software; you can redistribute it and/or modify it
42 # under the terms of the GNU General Public License as published by the
44 # restricted on the peer side.
47 -# uncomment to log VPN connections
50 +# set to /bin/true to silence log messages
53 # tag put in front of each log entry:
57 # syslog facility and priority used:
58 -FAC_PRIO=local0.notice
60 -# to create a special vpn logging file, put the following line into
61 -# the syslog configuration file /etc/syslog.conf:
63 -# local0.notice -/var/log/vpn
65 +FAC_PRIO=authpriv.info
68 +# in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
69 +if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ] ; then
73 + IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
74 + IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
75 + IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
78 +# are there port numbers?
79 +if [ "$PLUTO_MY_PORT" != 0 ] ; then
80 + S_MY_PORT="--sport $PLUTO_MY_PORT"
81 + D_MY_PORT="--dport $PLUTO_MY_PORT"
84 +if [ "$PLUTO_PEER_PORT" != 0 ] ; then
85 + S_PEER_PORT="--sport $PLUTO_PEER_PORT"
86 + D_PEER_PORT="--dport $PLUTO_PEER_PORT"
89 +# import firewall behavior
90 +IPT_RULE_IN=$IPSEC_UPDOWN_RULE_IN
91 +IPT_DEST_IN=$IPSEC_UPDOWN_DEST_IN
92 +IPT_RULE_OUT=$IPSEC_UPDOWN_RULE_OUT
93 +IPT_DEST_OUT=$IPSEC_UPDOWN_DEST_OUT
95 +# import forwarding behavior
96 +FWD_RULE_IN=$IPSEC_UPDOWN_FWD_RULE_IN
97 +FWD_DEST_IN=$IPSEC_UPDOWN_FWD_DEST_IN
98 +FWD_RULE_OUT=$IPSEC_UPDOWN_FWD_RULE_OUT
99 +FWD_DEST_OUT=$IPSEC_UPDOWN_FWD_DEST_OUT
101 +# default firewall behavior
102 +[ -z "$IPT_RULE_IN" ] && IPT_RULE_IN=INPUT
103 +[ -z "$IPT_DEST_IN" ] && IPT_DEST_IN=ACCEPT
104 +[ -z "$IPT_RULE_OUT" ] && IPT_RULE_OUT=OUTPUT
105 +[ -z "$IPT_DEST_OUT" ] && IPT_DEST_OUT=ACCEPT
107 +# default forwarding behavior
108 +[ -z "$FWD_RULE_IN" ] && FWD_RULE_IN=FORWARD
109 +[ -z "$FWD_DEST_IN" ] && FWD_DEST_IN=ACCEPT
110 +[ -z "$FWD_RULE_OUT" ] && FWD_RULE_OUT=FORWARD
111 +[ -z "$FWD_DEST_OUT" ] && FWD_DEST_OUT=ACCEPT
114 # check interface version
115 case "$PLUTO_VERSION" in
120 -iptables:iptables) # due to (left/right)firewall; for default script only
122 custom:*) # custom parameters (see above CAUTION comment)
124 *) echo "$0: unknown parameters \`$*'" >&2
125 @@ -159,345 +199,307 @@
130 # utility functions for route manipulation
131 # Meddling with this stuff should not be necessary and requires great care.
149 + [ -n "$in_rule" -a -n "$in_dest" ] && \
150 + iptables -I $in_rule 1 \
151 + -i $PLUTO_INTERFACE \
152 + -p $PLUTO_MY_PROTOCOL \
153 + -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
154 + -d $PLUTO_MY_CLIENT $D_MY_PORT \
158 + [ -n "$out_rule" -a -n "$out_dest" ] && \
159 + iptables -I $out_rule 1 \
160 + -o $PLUTO_INTERFACE \
161 + -p $PLUTO_PEER_PROTOCOL \
162 + -s $PLUTO_MY_CLIENT $S_MY_PORT \
163 + -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
164 + $IPSEC_POLICY_OUT \
175 + [ -n "$in_rule" -a -n "$in_dest" ] && \
176 + iptables -D $in_rule \
177 + -i $PLUTO_INTERFACE \
178 + -p $PLUTO_MY_PROTOCOL \
179 + -s $PLUTO_PEER_CLIENT $S_PEER_PORT \
180 + -d $PLUTO_MY_CLIENT $D_MY_PORT \
184 + [ -n "$out_rule" -a -n "$out_dest" ] && \
185 + iptables -D $out_rule \
186 + -o $PLUTO_INTERFACE \
187 + -p $PLUTO_PEER_PROTOCOL \
188 + -s $PLUTO_MY_CLIENT $S_MY_PORT \
189 + -d $PLUTO_PEER_CLIENT $D_PEER_PORT \
190 + $IPSEC_POLICY_OUT \
197 - if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local
200 + if ! ip -o route get ${PLUTO_MY_SOURCEIP%/*} | grep -q ^local ; then
202 it="ip addr add ${PLUTO_MY_SOURCEIP%/*}/32 dev $PLUTO_INTERFACE"
203 oops="`eval $it 2>&1`"
205 - if test " $oops" = " " -a " $st" != " 0"
208 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
209 oops="silent error, exit status $st"
211 - if test " $oops" != " " -o " $st" != " 0"
214 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
215 echo "$0: addsource \`$it' failed ($oops)" >&2
224 parms="$PLUTO_PEER_CLIENT"
225 + parms2="dev $PLUTO_INTERFACE"
228 - if [ -n "$PLUTO_NEXT_HOP" ]
230 - parms2="via $PLUTO_NEXT_HOP"
232 - parms2="$parms2 dev $PLUTO_INTERFACE"
234 - if [ -z "$PLUTO_MY_SOURCEIP" ]
236 - if [ -f /etc/sysconfig/defaultsource ]
238 - . /etc/sysconfig/defaultsource
240 + if [ -z "$PLUTO_MY_SOURCEIP" ] ; then
242 - if [ -f /etc/conf.d/defaultsource ]
244 - . /etc/conf.d/defaultsource
246 + [ -f /etc/sysconfig/defaultsource ] && \
247 + . /etc/sysconfig/defaultsource
249 + [ -f /etc/conf.d/defaultsource ] && \
250 + . /etc/conf.d/defaultsource
252 + [ -n "$DEFAULTSOURCE" ] && \
253 + PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
255 - if [ -n "$DEFAULTSOURCE" ]
257 - PLUTO_MY_SOURCEIP=$DEFAULTSOURCE
262 - if test "$1" = "add" -a -n "$PLUTO_MY_SOURCEIP"
264 + if [ "$1" = "add" -a -n "$PLUTO_MY_SOURCEIP" ] ; then
266 parms3="$parms3 src ${PLUTO_MY_SOURCEIP%/*}"
269 - case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
271 + if [ "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" = \
272 + "0.0.0.0/0.0.0.0" ] ; then
273 # opportunistic encryption work around
274 # need to provide route that eclipses default, without
276 - it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
277 - ip route $1 128.0.0.0/1 $parms2 $parms3"
279 - *) it="ip route $1 $parms $parms2 $parms3"
282 + it="ip route $1 0.0.0.0/1 $parms2 $parms3 &&
283 + ip route $1 128.0.0.0/1 $parms2 $parms3"
285 + it="ip route $1 $parms $parms2 $parms3"
288 oops="`eval $it 2>&1`"
290 - if test " $oops" = " " -a " $st" != " 0"
292 - oops="silent error, exit status $st"
294 - if test " $oops" != " " -o " $st" != " 0"
296 - echo "$0: doroute \`$it' failed ($oops)" >&2
298 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
299 + oops="silent error, exit status $st"
302 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
303 + echo "$0: doroute \`$it' failed ($oops)" >&2
309 -# in the presence of KLIPS and ipsecN interfaces do not use IPSEC_POLICY
310 -if [ `echo "$PLUTO_INTERFACE" | grep "ipsec"` ]
313 - IPSEC_POLICY_OUT=""
315 - IPSEC_POLICY="-m policy --pol ipsec --proto esp --reqid $PLUTO_REQID"
316 - IPSEC_POLICY_IN="$IPSEC_POLICY --dir in"
317 - IPSEC_POLICY_OUT="$IPSEC_POLICY --dir out"
320 -# are there port numbers?
321 -if [ "$PLUTO_MY_PORT" != 0 ]
323 - S_MY_PORT="--sport $PLUTO_MY_PORT"
324 - D_MY_PORT="--dport $PLUTO_MY_PORT"
326 -if [ "$PLUTO_PEER_PORT" != 0 ]
328 - S_PEER_PORT="--sport $PLUTO_PEER_PORT"
329 - D_PEER_PORT="--dport $PLUTO_PEER_PORT"
334 + if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ] ; then
337 + rem="$PLUTO_PEER_CLIENT == $PLUTO_PEER"
340 + if [ "$PLUTO_MY_CLIENT" == "$PLUTO_ME/32" ] ; then
343 + loc="$PLUTO_ME == $PLUTO_MY_CLIENT"
346 + $LOGGER -t $TAG -p $FAC_PRIO "$action $rem -- $loc ($PLUTO_PEER_ID)"
352 case "$PLUTO_VERB:$1" in
353 prepare-host:*|prepare-client:*)
354 # delete possibly-existing route (preliminary to adding a route)
355 - case "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" in
357 - # need to provide route that eclipses default, without
359 + if [ "$PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK" = \
360 + "0.0.0.0/0.0.0.0" ] ; then
361 + # need to remove the route that eclipses default, without
364 - parms2="128.0.0.0/1"
365 - it="ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1"
366 - oops="`ip route delete $parms1 2>&1 ; ip route delete $parms2 2>&1`"
369 - parms="$PLUTO_PEER_CLIENT"
370 - it="ip route delete $parms 2>&1"
371 - oops="`ip route delete $parms 2>&1`"
375 - if test " $oops" = " " -a " $status" != " 0"
377 - oops="silent error, exit status $status"
378 + it="( ip route delete 0.0.0.0/1 ;
379 + ip route delete 128.0.0.0/1 )"
381 + it="ip route delete $PLUTO_PEER_CLIENT"
387 + if [ " $oops" = " " -a " $st" != " 0" ] ; then
388 + oops="silent error, exit status $st"
392 *'RTNETLINK answers: No such process'*)
393 # This is what route (currently -- not documented!) gives
394 # for "could not find such a route".
400 - if test " $oops" != " " -o " $status" != " 0"
403 + if [ " $oops" != " " -o " $st" != " 0" ] ; then
404 echo "$0: \`$it' failed ($oops)" >&2
411 route-host:*|route-client:*)
412 # connection to me or my client subnet being routed
414 + ipsec _showstatus valid
418 unroute-host:*|unroute-client:*)
419 # connection to me or my client subnet being unrouted
421 + ipsec _showstatus invalid
427 # connection to me coming up
428 - # If you are doing a custom version, firewall commands go here.
430 + ipsec _showstatus up
431 + upfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
432 + dologentry "VPN-UP"
437 # connection to me going down
438 - # If you are doing a custom version, firewall commands go here.
441 - # connection to my client subnet coming up
442 - # If you are doing a custom version, firewall commands go here.
445 - # connection to my client subnet going down
446 - # If you are doing a custom version, firewall commands go here.
448 + ipsec _showstatus down
449 + downfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
450 + dologentry "VPN-DN"
454 - # connection to me, with (left/right)firewall=yes, coming up
455 - # This is used only by the default updown script, not by your custom
456 - # ones, so do not mess with it; see CAUTION comment up at top.
457 - iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
458 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
459 - -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
460 - iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
461 - -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
462 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT -j ACCEPT
464 - # log IPsec host connection setup
465 - if [ $VPN_LOGGING ]
467 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
469 - logger -t $TAG -p $FAC_PRIO \
470 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME"
472 - logger -t $TAG -p $FAC_PRIO \
473 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
478 - # connection to me, with (left/right)firewall=yes, going down
479 - # This is used only by the default updown script, not by your custom
480 - # ones, so do not mess with it; see CAUTION comment up at top.
481 - iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
482 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
483 - -d $PLUTO_ME $D_MY_PORT $IPSEC_POLICY_IN -j ACCEPT
484 - iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
485 - -s $PLUTO_ME $S_MY_PORT $IPSEC_POLICY_OUT \
486 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT -j ACCEPT
488 - # log IPsec host connection teardown
489 - if [ $VPN_LOGGING ]
491 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
493 - logger -t $TAG -p $FAC_PRIO -- \
494 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME"
496 - logger -t $TAG -p $FAC_PRIO -- \
497 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME"
502 - # connection to client subnet, with (left/right)firewall=yes, coming up
503 - # This is used only by the default updown script, not by your custom
504 - # ones, so do not mess with it; see CAUTION comment up at top.
505 - if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
507 - iptables -I FORWARD 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
508 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
509 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
510 - $IPSEC_POLICY_OUT -j ACCEPT
511 - iptables -I FORWARD 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
512 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
513 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
514 - $IPSEC_POLICY_IN -j ACCEPT
516 + # connection to client subnet coming up
518 + ipsec _showstatus up
520 + if [ "$PLUTO_MY_CLIENT" != "$PLUTO_ME/32" -a \
521 + "$PLUTO_MY_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ] ; then
522 + upfirewall $FWD_RULE_IN $FWD_DEST_IN $FWD_RULE_OUT $FWD_DEST_OUT
526 # a virtual IP requires an INPUT and OUTPUT rule on the host
527 # or sometimes host access via the internal IP is needed
528 - if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
530 - iptables -I INPUT 1 -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
531 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
532 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
533 - $IPSEC_POLICY_IN -j ACCEPT
534 - iptables -I OUTPUT 1 -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
535 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
536 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
537 - $IPSEC_POLICY_OUT -j ACCEPT
540 - # log IPsec client connection setup
541 - if [ $VPN_LOGGING ]
543 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
545 - logger -t $TAG -p $FAC_PRIO \
546 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
548 - logger -t $TAG -p $FAC_PRIO \
549 - "+ `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
553 -down-client:iptables)
554 - # connection to client subnet, with (left/right)firewall=yes, going down
555 - # This is used only by the default updown script, not by your custom
556 - # ones, so do not mess with it; see CAUTION comment up at top.
557 - if [ "$PLUTO_PEER_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ]
559 - iptables -D FORWARD -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
560 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
561 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
562 - $IPSEC_POLICY_OUT -j ACCEPT
563 - iptables -D FORWARD -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
564 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
565 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
566 - $IPSEC_POLICY_IN -j ACCEPT
567 + if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ] ; then
568 + upfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
571 + dologentry "VPN-UP"
575 + # connection to client subnet going down
577 + ipsec _showstatus down
579 + if [ "$PLUTO_MY_CLIENT" != "$PLUTO_ME/32" -a \
580 + "$PLUTO_MY_CLIENT" != "$PLUTO_MY_SOURCEIP/32" ] ; then
581 + downfirewall $FWD_RULE_IN $FWD_DEST_IN $FWD_RULE_OUT $FWD_DEST_OUT
585 # a virtual IP requires an INPUT and OUTPUT rule on the host
586 # or sometimes host access via the internal IP is needed
587 - if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ]
589 - iptables -D INPUT -i $PLUTO_INTERFACE -p $PLUTO_MY_PROTOCOL \
590 - -s $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $S_PEER_PORT \
591 - -d $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $D_MY_PORT \
592 - $IPSEC_POLICY_IN -j ACCEPT
593 - iptables -D OUTPUT -o $PLUTO_INTERFACE -p $PLUTO_PEER_PROTOCOL \
594 - -s $PLUTO_MY_CLIENT_NET/$PLUTO_MY_CLIENT_MASK $S_MY_PORT \
595 - -d $PLUTO_PEER_CLIENT_NET/$PLUTO_PEER_CLIENT_MASK $D_PEER_PORT \
596 - $IPSEC_POLICY_OUT -j ACCEPT
599 - # log IPsec client connection teardown
600 - if [ $VPN_LOGGING ]
602 - if [ "$PLUTO_PEER_CLIENT" == "$PLUTO_PEER/32" ]
604 - logger -t $TAG -p $FAC_PRIO -- \
605 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
607 - logger -t $TAG -p $FAC_PRIO -- \
608 - "- `echo -e $PLUTO_PEER_ID` $PLUTO_PEER_CLIENT == $PLUTO_PEER -- $PLUTO_ME == $PLUTO_MY_CLIENT"
610 + if [ -n "$PLUTO_MY_SOURCEIP" -o -n "$PLUTO_HOST_ACCESS" ] ; then
611 + downfirewall $IPT_RULE_IN $IPT_DEST_IN $IPT_RULE_OUT $OUT_DEST_OUT
614 + dologentry "VPN-DN"
620 prepare-host-v6:*|prepare-client-v6:*)
623 route-host-v6:*|route-client-v6:*)
624 # connection to me or my client subnet being routed
629 unroute-host-v6:*|unroute-client-v6:*)
630 # connection to me or my client subnet being unrouted
636 # connection to me coming up
637 # If you are doing a custom version, firewall commands go here.
641 # connection to me going down
642 # If you are doing a custom version, firewall commands go here.
646 # connection to my client subnet coming up
647 # If you are doing a custom version, firewall commands go here.
651 # connection to my client subnet going down
652 # If you are doing a custom version, firewall commands go here.
655 -*) echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2
657 + echo "$0: unknown verb \`$PLUTO_VERB' or parameter \`$1'" >&2