]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - etc/rc.d/rtadvd
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / etc / rc.d / rtadvd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: rtadvd
7 # REQUIRE: DAEMON
8 # BEFORE:  LOGIN
9 # KEYWORD: nojail shutdown
10
11 . /etc/rc.subr
12 . /etc/network.subr
13
14 name="rtadvd"
15 rcvar="rtadvd_enable"
16 command="/usr/sbin/${name}"
17 start_precmd="rtadvd_precmd"
18
19 rtadvd_precmd()
20 {
21         # This should be enabled with a great care.
22         # You may want to fine-tune /etc/rtadvd.conf.
23         #
24         # And if you wish your rtadvd to receive and process
25         # router renumbering messages, specify your Router Renumbering
26         # security policy by -R option.
27         #
28         # See `man 3 ipsec_set_policy` for IPsec policy specification
29         # details.
30         # (CAUTION: This enables your routers prefix renumbering
31         # from another machine, so if you enable this, do it with
32         # enough care.)
33         #
34         # If specific interfaces haven't been specified,
35         # get a list of interfaces and enable it on them
36         #
37         case ${rtadvd_interfaces} in
38         [Aa][Uu][Tt][Oo]|'')
39                 command_args=
40                 for i in `list_net_interfaces`; do
41                         case $i in
42                         lo0)    continue ;;
43                         esac
44                         if ipv6if $i; then
45                                 command_args="${command_args} ${i}"
46                         fi
47                 done
48                 ;;
49         [Nn][Oo][Nn][Ee])
50                 ;;
51         *)
52                 command_args="${rtadvd_interfaces}"
53                 ;;
54         esac
55
56         # Enable Router Renumbering, unicast case
57         # (use correct src/dst addr)
58         # rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
59         # Enable Router Renumbering, multicast case
60         # (use correct src addr)
61         # rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" ${ipv6_network_interfaces}
62         return 0
63 }
64
65 load_rc_config $name
66 run_rc_command "$1"