Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src add IPv6 configuration (ip6forwarding, rtsol, route6d and rt...



details:   https://anonhg.NetBSD.org/src/rev/3dbf2c05abe5
branches:  trunk
changeset: 474294:3dbf2c05abe5
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Jul 03 03:29:29 1999 +0000

description:
add IPv6 configuration (ip6forwarding, rtsol, route6d and rtadvd).
Right now netsetart does not bother you even if you do not have
"options INET6" in the kernel.

diffstat:

 etc/netstart             |  37 ++++++++++++++++++++++++++++++++++++-
 etc/rc                   |  10 +++++++++-
 etc/rc.conf              |   6 +++++-
 share/man/man5/rc.conf.5 |  43 ++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 92 insertions(+), 4 deletions(-)

diffs (182 lines):

diff -r 0c91389fd841 -r 3dbf2c05abe5 etc/netstart
--- a/etc/netstart      Sat Jul 03 01:45:56 1999 +0000
+++ b/etc/netstart      Sat Jul 03 03:29:29 1999 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#      $NetBSD: netstart,v 1.56 1999/05/28 21:01:42 christos Exp $
+#      $NetBSD: netstart,v 1.57 1999/07/03 03:29:29 itojun Exp $
 #      from: @(#)netstart      8.1 (Berkeley) 7/23/93
 
 if [ -f /etc/rc.subr ]; then
@@ -184,6 +184,41 @@
        dhclient $dhclient_flags
 fi
 
+# IPv6
+# Note that manual configuration can be done in the above, using ifconfig.
+dadcount=`sysctl net.inet6.ip6.dad_count | awk '{print $NF}'`
+if [ "x$dadcount" = "x" ]; then
+       # IPv6 is not configured in the kernel.  do not bother.
+else
+       sysctl -w net.inet6.ip6.forwarding=0
+       sysctl -w net.inet6.ip6.accept_rtadv=0
+       echo dadcount is $dadcount
+       if checkyesno ip6forwarding; then
+               if checkyesno rtsol; then
+                       echo "WARNING: ip6forwarding and rtsol " \
+                               "cannot be used together."
+               else
+                       sysctl -w net.inet6.ip6.forwarding=1
+               fi
+       else
+               if checkyesno rtsol; then
+                       echo -n "sending IPv6 router solicitation...";
+
+                       ifconfig $rtsol_flags up
+                       # wait till DAD is completed
+                       sleep $dadcount
+                       sleep 1
+
+                       sysctl -w net.inet6.ip6.accept_rtadv=1
+                       rtsol $rtsol_flags
+               fi
+       fi
+       # wait till DAD is completed.
+       # outside of the loop in case ifconfig is used
+       sleep $dadcount
+       sleep 1
+fi
+
 if [ -s /etc/netstart.local ]; then
        . /etc/netstart.local
 fi
diff -r 0c91389fd841 -r 3dbf2c05abe5 etc/rc
--- a/etc/rc    Sat Jul 03 01:45:56 1999 +0000
+++ b/etc/rc    Sat Jul 03 03:29:29 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: rc,v 1.126 1999/06/30 06:48:05 augustss Exp $
+#      $NetBSD: rc,v 1.127 1999/07/03 03:29:29 itojun Exp $
 #      originally from: @(#)rc 8.2 (Berkeley) 3/17/94
 
 # System startup script run by init on autoboot
@@ -413,6 +413,14 @@
        echo -n ' mrouted';             mrouted $mrouted_flags
 fi
 
+if checkyesno route6d; then
+       echo -n ' route6d';             route6d $route6d_flags
+fi
+
+if checkyesno rtadvd; then
+       echo -n ' rtadvd';              rtadvd $rtadvd_flags
+fi
+
 if checkyesno timed; then
        echo -n ' timed';               timed $timed_flags
 fi
diff -r 0c91389fd841 -r 3dbf2c05abe5 etc/rc.conf
--- a/etc/rc.conf       Sat Jul 03 01:45:56 1999 +0000
+++ b/etc/rc.conf       Sat Jul 03 03:29:29 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: rc.conf,v 1.53 1999/06/30 06:48:05 augustss Exp $
+#      $NetBSD: rc.conf,v 1.54 1999/07/03 03:29:29 itojun Exp $
 #
 # see rc.conf(5) for more information.
 
@@ -56,6 +56,8 @@
 dhclient_flags=""                              # blank: config all interfaces
 ntpdate=NO             ntpdate_hosts=""        # blank: hosts in /etc/ntp.conf
 ppp_peers=""                                   # /etc/ppp/peers to call
+ip6forwarding="NO"                             # IPv6 router
+rtsol="NO"             rtsol_flags=""          # IPv6 autoconf (on non-router)
 
 # Daemons required by other daemons
 inetd=YES              inetd_flags="-l"        # -l logs libwrap
@@ -75,6 +77,7 @@
 routed=NO              routed_flags="-q"
 gated=NO               gated_flags=""
 mrouted=NO             mrouted_flags=""
+route6d=NO             route6d_flags=""
 
 # Daemons used to boot other hosts over a network
 rarpd=NO               rarpd_flags="-a"
@@ -83,6 +86,7 @@
 dhcrelay=NO            dhcrelay_flags=""
 rbootd=NO              rbootd_flags=""
 mopd=NO                        mopd_flags="-a"
+rtadvd=NO              rtadvd_flags=""
 
 # X11 daemons:
 xfs=NO                 xfs_flags=""            # X11 font server
diff -r 0c91389fd841 -r 3dbf2c05abe5 share/man/man5/rc.conf.5
--- a/share/man/man5/rc.conf.5  Sat Jul 03 01:45:56 1999 +0000
+++ b/share/man/man5/rc.conf.5  Sat Jul 03 03:29:29 1999 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: rc.conf.5,v 1.23 1999/03/24 17:29:07 mellon Exp $
+.\"    $NetBSD: rc.conf.5,v 1.24 1999/07/03 03:29:30 itojun Exp $
 .\"
 .\"  Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 .\"  All rights reserved.
@@ -289,6 +289,29 @@
 with the
 .Dq call Sy peer
 option.
+.It Sy ip6forwarding
+YES or NO.
+An IPv6 node can be a router
+.Pq nodes that forward packet for others
+or host
+.Pq nodes that do not forward .
+By setting
+.Sy ip6forwarding
+to YES, the node will become an IPv6 router.
+Note that this is orthogonal to IPv4 forwarding/routing.
+.It Sy rtsol
+YES or NO.
+Run
+.Xr rtsol 8 ,
+router solicitation command for IPv6 host.
+By setting this option to YES, your host will be autoconfigured
+based on the information advertised by adjacent IPv6 router.
+Passes
+.Sy rtsol_flags .
+This is only for IPv6 host, so set
+.Sy ip6forwarding
+to NO if you use
+.Sy rtsol .
 .El
 .Pp
 .Ss Daemons required by other daemons:
@@ -413,6 +436,13 @@
 the DVMRP multicast routing protocol daemon.
 Passes
 .Sy mrouted_flags .
+.It Sy route6d
+YES or NO.
+Runs
+.Xr route6d 8 ,
+the RIPng routing protocol daemon for IPv6.
+Passes
+.Sy route6d_flags .
 .El
 .Pp
 .Ss Daemons used to boot other hosts over a network:
@@ -471,6 +501,17 @@
 machines.
 Passes
 .Sy mopd_flags .
+.It Sy rtadvd
+YES or NO.
+Runs
+.Xr rtadvd 8 ,
+the IPv6 router advertisement daemon, which is used to advertise
+information about the subnet to IPv6 end hosts.
+Passes
+.Sy rtadvd_flags .
+Should only be used on IPv6 router.
+If you use this make sure to check
+.Sy ip6forwarding .
 .El
 .Pp
 .Ss NIS (YP) daemons:



Home | Main Index | Thread Index | Old Index