can?t set default router in rc.conf FreeBSD 5.2

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Jan 18 23:53:15 PST 2004


On Mon, Jan 19, 2004 at 08:42:41AM +0100, Michael Hollmann wrote:
> 
> i tried to set the default router in /etc/rc.conf:
> 
> defaultrouter="192.168.xxx.xxx"
> 
> but this doesn?t work. why.
> 
> it does only work after following command: route add default 192.168.xxx.xxx
> 
> 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="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

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040119/66bf2370/attachment.bin


More information about the freebsd-questions mailing list