diff --git a/etc/rc.d/network b/etc/rc.d/network index ce1aa2220d52..b10dfe815a21 100755 --- a/etc/rc.d/network +++ b/etc/rc.d/network @@ -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 @@ network_start() 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 @@ network_start() 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