Subject: Re: /etc/mygate6?
To: None <tech-userlevel@netbsd.org>
From: Julian Coleman <jdc@coris.org.uk>
List: tech-userlevel
Date: 10/03/2003 09:43:18
> Sounds ok to me. Maybe don't make it conditional on ip6mode=router, as in
> a situation with ip6mode=host it will be useful too. You might warn with
> ip6mode=autohost though.

Sounds like a good idea.  How about the following?

J

 ---8<---------------------------- Cut here ---------------------------->8---
--- /usr/src/etc/rc.d/network	Fri Jan 10 11:02:19 2003
+++ network	Thu Oct  2 16:22:02 2003
@@ -224,14 +224,31 @@
 		echo "."
 	fi
 
-	# Check $defaultroute, then /etc/mygate, for the name of my gateway
-	# host. That name must be in /etc/hosts.
+	# Check $defaultroute, then /etc/mygate, for the name or address
+	# of my IPv4 gateway host. If using a name, that name must be in
+	# /etc/hosts.
 	#
 	if [ -z "$defaultroute" ] && [ -f /etc/mygate ]; then
 		defaultroute=`cat /etc/mygate`
 	fi
 	if [ -n "$defaultroute" ]; then
 		route add default $defaultroute
+	fi
+
+	# Check $defaultroute6, then /etc/mygate6, for the name or address
+	# of my IPv6 gateway host. If using a name, that name must be in
+	# /etc/hosts.
+	#
+	if [ -z "$defaultroute6" ] && [ -f /etc/mygate6 ]; then
+		defaultroute6=`cat /etc/mygate6`
+	fi
+	if [ -n "$defaultroute6" ]; then
+		if [ "$ip6mode" = "autohost" ]; then
+			echo
+			warn \
+	    "ip6mode is set to 'autohost' and a v6 default route is also set."
+		fi
+		route add -inet6 default $defaultroute6
 	fi
 
 	# Check if each configured interface xxN has an $ifaliases_xxN variable

 ---8<---------------------------- Cut here ---------------------------->8---

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/