diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-01-02 05:14:53 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-01-02 05:14:53 +0000 |
commit | e7c96660f60fdd84229096783bf861d1d4df29ea (patch) | |
tree | eb4cd30aae8672bd65957a1c09532366497a5d80 | |
parent | 7164bdc352d72f109f42ce60467a086fd96bfdad (diff) |
ipv6 autoconf on hosts (non-routers).
to do this,
1. in sysctl.conf, add these lines:
net.inet6.ip6.forwarding=0
net.inet6.ip6.accept_rtadv=1
2. in hostname.foo, add
rtsol
specifying two or more interfaces with "rtsol" may result in strange
behavior - ipv6 spec does not permit multi-interface node to be autoconfig'ed.
-rw-r--r-- | etc/netstart | 18 | ||||
-rw-r--r-- | etc/sysctl.conf | 5 |
2 files changed, 20 insertions, 3 deletions
diff --git a/etc/netstart b/etc/netstart index 66191565053..b2630d00d60 100644 --- a/etc/netstart +++ b/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.55 2000/01/02 04:38:17 todd Exp $ +# $OpenBSD: netstart,v 1.56 2000/01/02 05:14:52 itojun Exp $ # Returns true if $1 contains only alphanumerics isalphanumeric() { @@ -53,6 +53,8 @@ if ifconfig lo0 inet6 >/dev/null 2>&1; then # disallow "internal" addresses to appear on the wire. route add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject route add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + + rtsolif="" else ip6kernel=NO fi @@ -95,6 +97,9 @@ for hn in /etc/hostname.*; do ifconfig $if $name $mask $bcaddr $ext1 $ext2 down cmd="dhclient $if" ;; + "rtsol") + rtsolif="$rtsolif $if" + ;; "up") # The only one of these guaranteed to be set is $if # the remaining ones exist so that media controls work @@ -143,6 +148,17 @@ for hn in /etc/hostname.*; do eval "$cmd" done < /etc/hostname.$if done + +if [ "$ip6kernel" = "YES" -a "x$rtsolif" != "x" ]; then + fw=`sysctl -n net.inet6.ip6.forwarding` + ra=`sysctl -n net.inet6.ip6.accept_rtadv` + if [ "x$fw" = "x0" -a "x$ra" = "x1" ]; then + rtsol $rtsolif + else + echo "WARNING: inconsistent config - check /etc/sysctl.conf for IPv6 autoconf" + fi +fi + for bn in /etc/bridgename.*; do # Strip off /etc/bridgename. prefix if=${bn#/etc/bridgename.} diff --git a/etc/sysctl.conf b/etc/sysctl.conf index 6e7945436f9..0b06eb5c38a 100644 --- a/etc/sysctl.conf +++ b/etc/sysctl.conf @@ -1,9 +1,10 @@ -# $OpenBSD: sysctl.conf,v 1.14 1999/12/30 19:38:42 provos Exp $ +# $OpenBSD: sysctl.conf,v 1.15 2000/01/02 05:14:52 itojun Exp $ # This files contains a list of sysctl options the user wants set at # boot time. # ie. #net.inet.ip.forwarding=1 # 1=Permit forwarding (routing) of packets -#net.inet.ip6.forwarding=1 # 1=Permit forwarding (routing) of packets +#net.inet6.ip6.forwarding=1 # 1=Permit forwarding (routing) of packets +#net.inet6.ip6.accept_rtadv=1 # 1=Permit IPv6 autoconf (forwarding must be 0) #net.inet.tcp.rfc1323=0 # 0=disable TCP RFC1323 extensions (for if tcp is slow) #net.inet.esp.enable=1 # 1=Enable the ESP IPSec protocol #net.inet.ah.enable=1 # 1=Enable the AH IPSec protocol |