From owner-freebsd-net@FreeBSD.ORG Tue Nov 23 20:52:52 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEEAF106566B for ; Tue, 23 Nov 2010 20:52:52 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id BDAE78FC1A for ; Tue, 23 Nov 2010 20:52:52 +0000 (UTC) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id 48169BDC75 for ; Tue, 23 Nov 2010 12:52:52 -0800 (PST) To: freebsd-net@freebsd.org In-Reply-To: <20101123155323.GA51348@laptop.levsha.me> Date: Tue, 23 Nov 2010 12:52:52 -0800 Message-ID: <45858.1290545572@tristatelogic.com> From: "Ronald F. Guilmette" Subject: Re: Configuring for 1 static and 1 DHCP interface ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2010 20:52:52 -0000 In message <20101123155323.GA51348@laptop.levsha.me>, Mykola Dzham wrote: > Ronald F. Guilmette wrote: >> This is problematic for several reasons. First, as I have learned, >> having any interface set to "DHCP" in the /etc/rc.conf file causes >> all sorts of DHCP magic to happen at startup time, and the end result >> of all that magic is that two undesirable things happen: >> >> 1) The /etc/resolv.conf file gets replaced with something that >> causes DNS resolutions to go someplace other than where I want >> them to go, and... >> >> 2) the default route that I attempted to set in the /etc/rc.conf >> file gets clobbered and replaced by a default route obtained >> from the DHCP negotiation on the second interface. > >You can totally disable resolv.conf changing and rote setting: put into >/etc/dhclient-enter-hooks file this code: > >add_new_resolv_conf() { > echo "doing nothing to resolv.conf" >} > >add_new_routes() { > echo "do not set routes" >} Wow! This is _very_ interesting! How did you know to even suggest this? I mean are these things documented on some man page that I mised? Well, anyway, that first part sure sounds like a perfect fix for the first of the two issues I described. But as regards to that second part, maybe that's doing a but more than what I want. I don't want the DHCP stuff to set -no- routes at all... I still do want it to create a route to 192.168.1.0/24. I just don't want it make any change to the default route that would otherwise be set, you know, as a result of the defaultrouter= statement in my /etc/rc.conf file. So is there a nice clean & simple way to get the DHCP stuff to only create just that route to 192.168.1.0/24 , while leaving the default route alone? Regards, rfg P.S. Oh yea... and one other question... at the top of this new /etc/dhclient-enter-hooks file, should I be putting "#!/bin/sh" ? Is that OK? Is it needed?