rob897
January 20th, 2004, 18:09
I recently upgraded to 5.2 from 5.1 without any problems accept that now everytime I reboot I have to:
[code:1:90a40ffc32]route add default 192.168.1.1[/code:1:90a40ffc32]
in order to get online.

I have this set in my rc.conf:
[code:1:90a40ffc32]defaultrouter="192.168.1.1"
ifconfig_dc0="inet 192.168.1.2 netmask 255.255.255.0"[/code:1:90a40ffc32]

Not sure where else to look.
Any ideas?

bsdjunkie
January 20th, 2004, 18:19
Do you have gateway_enable=YES in rc.conf as well??

rob897
January 20th, 2004, 18:21
No I don't, should I add this in?

rob897
January 20th, 2004, 18:34
Well I added that in and rebooted still did not work.

rob897
January 22nd, 2004, 22:34
Anyone have any other ideas? This is really troublesome.

optyk
January 23rd, 2004, 09:08
What do you use this box for? It might be worth trying a buildworld to make sure any cruft from 5.1 is cleaned out.

rob897
January 23rd, 2004, 18:44
It my main machine for pretty much all day to day use.

frisco
January 23rd, 2004, 19:10
I have this set in my rc.conf:
[code:1:590d5ff09a]defaultrouter="192.168.1.1"
ifconfig_dc0="inet 192.168.1.2 netmask 255.255.255.0"[/code:1:590d5ff09a]


It needs to be 'defaultroute' not 'defaultrouter'.

optyk
January 23rd, 2004, 20:46
d'OH!
Great proofreading, frisco ;)

Kernel_Killer
January 23rd, 2004, 22:30
defaultrouter in my rc.conf, but who knows. This system hasn't gone down in a long while, and I'm not about to shut it down to test. :D

rob897
January 23rd, 2004, 23:20
defaultrouter is correct according the the freebsd docs.

frisco
January 24th, 2004, 00:15
I'm not very familiar with FreeBSD, so i looked through /etc/rc.d/network (http://www.freebsd.org/cgi/cvsweb.cgi/root/src/src/etc/rc.d/network?rev=1.3&content-type=text/x-cvsweb-markup&only_with_tag=RELENG_5_2) to see where 'route add default' was run:

[code:1:7465deb2a6]
# Check $defaultroute, then /etc/mygate, for the name of my gateway
# host. 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
[/code:1:7465deb2a6]

That's what made me believe $defaultroute was correct.

I see a defaultrouter in /etc/rc.d/routing (http://www.freebsd.org/cgi/cvsweb.cgi/root/src/src/etc/rc.d/routing?rev=1.139&content-type=text/x-cvsweb-markup)
and perhaps it's somewhere else too. In that file it sets:
[code:1:7465deb2a6]
case ${defaultrouter} in
[Nn][Oo] | '')
;;
*)
static_routes="default ${static_routes}"
route_default="default ${defaultrouter}"
;;
esac
[/code:1:7465deb2a6]

But i don't have the time to search for where $route_default is used.

Anyways, if i were you i'd trace through my startup files looking for where my default route should be set. Start at /etc/rc, this runs all the files in /etc/rc.d/, so search through those to see where the default route is getting added. Good luck.

Kernel_Killer
January 24th, 2004, 02:43
You know. If you wanted to make it easy on yourself, you could always run /stand/sysinstall, and reconfigure the interface with the gateway, and it should replace all entries pertaining to the default router, and IP.

Don't know why I didn't think of that before. :roll:

rob897
January 25th, 2004, 12:51
Kernel, yea that was my first attempt at getting it to work..
Still nothing..


Frisco, I will look into this more when I get some time.

rob897
January 25th, 2004, 13:27
Ok well looking through my /etc/rc.d/ folder the only file similar to the network one is: /etc/rc.d/network_ipv6

which contains the following code:
[code:1:bbcf9fca59]!/bin/sh
#
# Copyright (c) 2000 The KAME Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: src/etc/rc.d/network_ipv6,v 1.34 2003/05/12 11:36:50 ume Exp $
# From: src/etc/rc.network6,v 1.29 2002/04/06 15:15:43
#

# PROVIDE: network_ipv6
# REQUIRE: network2
# KEYWORD: FreeBSD

. /etc/rc.subr
. /etc/network.subr

name="network_ipv6"
rcvar=`set_rcvar ipv6`
start_cmd="network_ipv6_start"

network_ipv6_start()

# 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

case ${ipv6_network_interfaces} in
[Aa][Uu][Tt][Oo])
# Get a list of network interfaces
ipv6_network_interfaces="`ifconfig -l`"
;;
[Nn][Oo][Nn][Ee])
ipv6_network_interfaces=''
;;
esac

if checkyesno ipv6_gateway_enable; then
# act as a router
${SYSCTL_W} net.inet6.ip6.forwarding=1
${SYSCTL_W} net.inet6.ip6.accept_rtadv=0

# wait for DAD
for i in $ipv6_network_interfaces; do
ifconfig $i up
done
sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
sleep 1
else
# act as endhost - start with manual configuration
# Setup of net.inet6.ip6.accept_rtadv is done later by
# network6_interface_setup.
${SYSCTL_W} net.inet6.ip6.forwarding=0
fi

if [ -n "${ipv6_network_interfaces}" ]; then
# Setup the interfaces
network6_interface_setup $ipv6_network_interfaces

# wait for DAD's completion (for global addrs)
sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
sleep 1
fi
# Filter out interfaces on which IPv6 initialization failed.
if checkyesno ipv6_gateway_enable; then
ipv6_working_interfaces=""
for i in ${ipv6_network_interfaces}; do
laddr=`network6_getladdr $i exclude_tentative`
case ${laddr} in
'')
;;
*)
ipv6_working_interfaces="$i \
${ipv6_working_interfaces}"
;;
esac
done
ipv6_network_interfaces=${ipv6_working_interfaces}
fi

# Setup IPv6 to IPv4 mapping
network6_stf_setup

# Install the "default interface" to kernel, which will be used
# as the default route when there's no router.
network6_default_interface_setup

# Setup static routes
network6_static_routes_setup

# Setup faith
network6_faith_setup

# Support for IPv4 address tacked onto an IPv6 address
if checkyesno ipv6_ipv4mapping; then
echo 'IPv4 mapped IPv6 address support=YES'
${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
else
echo 'IPv4 mapped IPv6 address support=NO'
${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
fi
}

load_rc_config $name
run_rc_command "$1"[/code:1:bbcf9fca59]

Do you think this could be the problem?
I did not setup the IPv6 so I am not sure what needs to be done.