Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc/rc.d Allow an IPv6 default route to be set from /etc/myg...
details: https://anonhg.NetBSD.org/src/rev/6d6cb0317177
branches: trunk
changeset: 553195:6d6cb0317177
user: jdc <jdc%NetBSD.org@localhost>
date: Sun Oct 12 09:50:05 2003 +0000
description:
Allow an IPv6 default route to be set from /etc/mygate6 or $defaultroute6.
Approved by itojun@.
diffstat:
etc/rc.d/network | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r 7c65fa8f301a -r 6d6cb0317177 etc/rc.d/network
--- a/etc/rc.d/network Sun Oct 12 07:21:57 2003 +0000
+++ b/etc/rc.d/network Sun Oct 12 09:50:05 2003 +0000
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: network,v 1.43 2003/01/09 15:52:58 christos Exp $
+# $NetBSD: network,v 1.44 2003/10/12 09:50:05 jdc Exp $
#
# PROVIDE: network
@@ -224,8 +224,9 @@
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`
@@ -234,6 +235,23 @@
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. Note that the gateway host address must be a link-local
+ # address if it is not using an stf* interface.
+ #
+ 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
# associated, then configure additional IP addresses for that interface.
# The variable contains a list of "address netmask" pairs, with
Home |
Main Index |
Thread Index |
Old Index