2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: rtadvd
|
|
|
|
# REQUIRE: DAEMON
|
2002-06-13 22:14:37 +00:00
|
|
|
# BEFORE: LOGIN
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
2009-09-12 23:00:01 +00:00
|
|
|
. /etc/network.subr
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
name="rtadvd"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="rtadvd_enable"
|
2001-06-16 07:16:14 +00:00
|
|
|
command="/usr/sbin/${name}"
|
|
|
|
start_precmd="rtadvd_precmd"
|
|
|
|
|
|
|
|
rtadvd_precmd()
|
|
|
|
{
|
2002-10-12 10:31:31 +00:00
|
|
|
# This should be enabled with a great care.
|
|
|
|
# You may want to fine-tune /etc/rtadvd.conf.
|
|
|
|
#
|
|
|
|
# And if you wish your rtadvd to receive and process
|
|
|
|
# router renumbering messages, specify your Router Renumbering
|
|
|
|
# security policy by -R option.
|
|
|
|
#
|
|
|
|
# See `man 3 ipsec_set_policy` for IPsec policy specification
|
|
|
|
# details.
|
|
|
|
# (CAUTION: This enables your routers prefix renumbering
|
|
|
|
# from another machine, so if you enable this, do it with
|
|
|
|
# enough care.)
|
|
|
|
#
|
2004-01-17 10:59:43 +00:00
|
|
|
# If specific interfaces haven't been specified,
|
|
|
|
# get a list of interfaces and enable it on them
|
|
|
|
#
|
|
|
|
case ${rtadvd_interfaces} in
|
2009-09-12 22:14:21 +00:00
|
|
|
[Aa][Uu][Tt][Oo]|'')
|
2012-10-25 08:37:08 +00:00
|
|
|
command_args=
|
2011-06-11 21:41:44 +00:00
|
|
|
for i in `list_net_interfaces`; do
|
2009-09-26 19:00:47 +00:00
|
|
|
case $i in
|
|
|
|
lo0) continue ;;
|
|
|
|
esac
|
|
|
|
if ipv6if $i; then
|
2012-10-25 08:37:08 +00:00
|
|
|
command_args="${command_args} ${i}"
|
2009-09-12 23:00:01 +00:00
|
|
|
fi
|
2004-01-17 10:59:43 +00:00
|
|
|
done
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
2012-10-25 08:37:08 +00:00
|
|
|
*)
|
|
|
|
command_args="${rtadvd_interfaces}"
|
|
|
|
;;
|
2002-06-13 22:14:37 +00:00
|
|
|
esac
|
2012-10-25 08:37:08 +00:00
|
|
|
|
2004-01-17 10:59:43 +00:00
|
|
|
# Enable Router Renumbering, unicast case
|
|
|
|
# (use correct src/dst addr)
|
|
|
|
# rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
|
|
|
|
# Enable Router Renumbering, multicast case
|
|
|
|
# (use correct src addr)
|
|
|
|
# rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
|
2002-06-13 22:14:37 +00:00
|
|
|
return 0
|
2001-06-16 07:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|