From owner-freebsd-current Tue Jul 4 17:43:46 2000 Delivered-To: freebsd-current@freebsd.org Received: from dt052n3e.san.rr.com (dt052n3e.san.rr.com [204.210.33.62]) by hub.freebsd.org (Postfix) with ESMTP id 8B81737B569 for ; Tue, 4 Jul 2000 17:43:42 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt052n3e.san.rr.com (8.9.3/8.9.3) with ESMTP id RAA04271; Tue, 4 Jul 2000 17:42:05 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <3962845C.F195E50D@gorean.org> Date: Tue, 04 Jul 2000 17:42:04 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0702 i386) X-Accept-Language: en MIME-Version: 1.0 To: Greg Lehey Cc: Samuel Tardieu , current@FreeBSD.ORG Subject: Re: DHCP does not honor default router? References: <2000-07-04-15-42-11+trackit+sam@antinea.enst.fr> <20000705094217.C97425@wantadilla.lemis.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Lehey wrote: > > On Tuesday, 4 July 2000 at 15:42:10 +0200, Samuel Tardieu wrote: > > My laptop gets a fixed IP address (137.194.161.7) using DHCP (so that > > I do not have to set up multiple configurations depending on the > > network). > > > > However, even when it receives router information, it does not update > > the routing table: I updated my dhclient script to handle this case, since it happens on the roadrunner network as well. I can send you the patch if you want, but I have a lot of other hacks in my script so it might be confusing. Starting right around line 106 of the default script, I have: if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \ [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then # Added: if [ -z "$old_routers"]; then # Assume worst case scenario till we know better $LOGGER "Doing worst case scenario route flush" if [ x$reason = xBOUND ]; then arp -a -d route flush fi fi # End of added stuff ifconfig $interface inet $new_ip_address $new_netmask_arg \ Prior to adding that bit I used to get hung up every time my new IP was on a different network segment, with that and a few other hacks I've had clear sailing for almost a year. FWIW, this is one area where solaris has it better than we do. I can, while telnet'ed into a solaris machine do: route add default 22.33.44.1 route delete default 22.33.55.1 and have it use the old default right up until I delete it, then the new default instantly takes effect. Assuming I have a path to the machine through the new default, I never lose connectivity. Unless I'm missing something, freebsd doesn't allow this. While I'm at it, I prefer their method of aliasing IP's to a nic as well, but I digress. :) Hope this helps, Doug -- "Live free or die" - State motto of my ancestral homeland, New Hampshire Do YOU Yahoo!? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message