3 # $NetBSD: ipsec,v 1.13 2013/09/12 19:52:50 christos Exp $
7 # REQUIRE: root bootconf mountcritlocal tty
10 $_rc_subr_loaded .
/etc
/rc.subr
14 start_precmd
="ipsec_prestart"
15 start_cmd
="ipsec_start"
16 stop_precmd
="test -f /etc/ipsec.conf"
18 reload_cmd
="ipsec_reload"
19 extra_commands
="reload"
23 if [ ! -f /etc
/ipsec.conf
]; then
24 warn
"/etc/ipsec.conf not readable; ipsec start aborted."
33 ifconfig
$1 |
while read what address rest
; do
35 inet
) echo "$address";;
42 /sbin
/setkey
-f /etc
/ipsec.conf
44 sed -e "s/@LOCAL_ADDR@/$1/" < /etc
/ipsec.conf | \
51 local addr
="$(ipsec_getip "$ipsec_flags")"
55 *) ipsec_load
"$addr"; return;;
62 echo "Installing ipsec manual keys/policies."
63 if [ -n "$ipsec_flags" ]; then
72 echo "Clearing ipsec manual keys/policies."
74 # still not 100% sure if we would like to do this.
75 # it is very questionable to do this during shutdown session, since
76 # it can hang any of remaining IPv4/v6 session.
84 echo "Reloading ipsec manual keys/policies."