Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jan 2004 07:53:08 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Michael Hollmann <michael.hollmann@jawa.at>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: can?t set default router in rc.conf FreeBSD 5.2
Message-ID:  <20040119075308.GC8185@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <400B8A71.9060100@jawa.at>
References:  <400B8A71.9060100@jawa.at>

next in thread | previous in thread | raw e-mail | index | archive | help

--kfjH4zxOES6UT95V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 19, 2004 at 08:42:41AM +0100, Michael Hollmann wrote:
>=20
> i tried to set the default router in /etc/rc.conf:
>=20
> defaultrouter=3D"192.168.xxx.xxx"
>=20
> but this doesn?t work. why.
>=20
> it does only work after following command: route add default 192.168.xxx.=
xxx
>=20
> could anybody help me? please

The settings you make in /etc/rc.conf are what the system refers to
when it reboots, and only when it reboots.  The clue is in the name --
all those scripts in /etc called 'rc.something' and the /etc/rc.d
directory (if you're running 5.x) are exactly what is run to boot up
the system. 'rc.conf' is a configuration file for those scripts.

If you delve into the workings of the rc scripts, you will find that
setting

    defaultrouter=3D"192.168.0.1"

in rc.conf ultimately results in the command:

    route add default 192.168.0.1

being run.  This command is, as you have observed, what is required to
set the default route for the system and you can run it whenever it is
necessary, not just at boot time.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--kfjH4zxOES6UT95V
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAC4zkdtESqEQa7a0RAnGDAJwM5xKHMI4vwm+DMyGSPOjvt3jqfwCffbbF
HUAIgCkirWm+LWD+96Hi+Uk=
=EroS
-----END PGP SIGNATURE-----

--kfjH4zxOES6UT95V--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040119075308.GC8185>