From owner-freebsd-questions@FreeBSD.ORG Wed Oct 8 06:01:30 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17AD316A4E1 for ; Wed, 8 Oct 2003 06:01:30 -0700 (PDT) Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [66.30.200.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62C2743F75 for ; Wed, 8 Oct 2003 06:01:29 -0700 (PDT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id A30913AF9; Wed, 8 Oct 2003 09:01:28 -0400 (EDT) Sender: lowell@be-well.ilk.org To: "Roger 'Rocky' Vetterberg" References: <3F83F1AA.7060702@401.cx> From: Lowell Gilbert Date: 08 Oct 2003 09:01:28 -0400 In-Reply-To: <3F83F1AA.7060702@401.cx> Message-ID: <44llrvg9xz.fsf@be-well.ilk.org> Lines: 51 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: FreeBSD Questions Subject: [RTFM pointer] Re: dhcp overrides default route X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2003 13:01:30 -0000 "Roger 'Rocky' Vetterberg" writes: > Lets say you have this in rc.conf: > > ifconfig_dc0="inet 1.2.3.4 netmask 255.255.255.0" > ifconfig_dc1="DHCP" > default_router="1.2.3.254" > > The network on dc1 is 192.168.0.0/24 with the default router on that > subnet being 192.168.0.254. > > If I reboot the box, dhclient will set default router to > 192.168.0.254, overriding the value I specified in rc.conf. > Is there a way to prevent that? > > Right now, I have a shellscript that runs as soon as the box is > finished booting that resets the default route to its correct value, > but somehow it feels that this is not the right way to do it. Right. What you want to do is simply tell dhclient(8) not to do that. The way you do that configuration is with dhclient.conf(5). I would recommend the following statement: prepend routers 192.168.0.254 My own dhclient.conf looks like the following, in which the only statement that actually does anything useful is the one pointing the main name server entry at myself. # $FreeBSD: src/etc/dhclient.conf,v 1.2.2.1 2001/12/14 11:44:31 rwatson Exp $ # # This file is required by the ISC DHCP client. # See ``man 5 dhclient.conf'' for details. # # In most cases an empty file is sufficient for most people as the # defaults are usually fine. # interface "fxp0" { request subnet-mask, broadcast-address, routers, domain-name-servers, domain-name, host-name; send host-name "lowellg.ne.client2.attbi.com"; send dhcp-lease-time 5184000; prepend domain-name-servers 127.0.0.1; # require domain-name-servers; # default host-name "lowellg"; # default domain-name "ne.mediaone.net"; # supersede host-name "lowellg.ne.mediaone.net"; }