diff options
author | ume <ume@FreeBSD.org> | 2003-10-30 17:55:52 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2003-10-30 17:55:52 +0000 |
commit | a580a14832f1f0612ed4967b4d7cf373e49736ea (patch) | |
tree | 81f485a504fd7a06f0c3b4dbaab50034a1fa8337 /etc | |
parent | 0a0369dedddf2869ccc77443d949e3f2d227b8a2 (diff) | |
download | FreeBSD-src-a580a14832f1f0612ed4967b4d7cf373e49736ea.zip FreeBSD-src-a580a14832f1f0612ed4967b4d7cf373e49736ea.tar.gz |
install address selection policy into kernel when there is
/etc/ip6addrctl.conf.
following sample of ip6addrctl.conf is a good default:
#Prefix Precedence Label
::1/128 50 0
::/0 40 1
2002::/16 30 2
::/96 20 3
::ffff:0:0/96 10 4
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/Makefile | 2 | ||||
-rw-r--r-- | etc/rc.d/ip6addrctl | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index b25b5cd..c790741 100755 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -15,7 +15,7 @@ FILES= DAEMON LOGIN NETWORKING SERVERS \ gbde \ hostname \ inetd initdiskless initrandom \ - ip6fw ipfilter ipfs ipfw ipmon \ + ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted isdnd \ jail \ kadmind kerberos keyserv kldxref kpasswdd \ diff --git a/etc/rc.d/ip6addrctl b/etc/rc.d/ip6addrctl new file mode 100644 index 0000000..26b8365 --- /dev/null +++ b/etc/rc.d/ip6addrctl @@ -0,0 +1,33 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ip6addrctl +# REQUIRE: mountcritlocal netif +# BEFORE: network_ipv6 +# KEYWORD: FreeBSD + +. /etc/rc.subr +. /etc/network.subr + +name="ip6addrctl" +start_cmd="ip6addrctl_start" +stop_cmd=':' + +ip6addrctl_start() +{ + if ifconfig lo0 inet6 >/dev/null 2>&1; then + # We have IPv6 support in kernel. + + # install the policy of the address selection algorithm. + if [ -f /etc/ip6addrctl.conf ]; then + ip6addrctl flush >/dev/null 2>&1 + ip6addrctl install /etc/ip6addrctl.conf + ip6addrctl + fi + fi +} + +load_rc_config $name +run_rc_command "$1" |