From owner-freebsd-net@FreeBSD.ORG Tue Aug 28 18:46:14 2012 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 5284F106566C for ; Tue, 28 Aug 2012 18:46:14 +0000 (UTC) (envelope-from thciobanu@nth.ro) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C3AC58FC08 for ; Tue, 28 Aug 2012 18:46:13 +0000 (UTC) Received: by weyx56 with SMTP id x56so12351411wey.13 for ; Tue, 28 Aug 2012 11:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nth.ro; s=ga; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=Sats1dvDH0XDSWPrzv9qnW7mig2lZ02vgrr1G7RhtqE=; b=Z49haNJnQOLprucwkmOxiOFS+wNnPPP9AU9mT8BJjGULaWX3k4HG8rfiimTCp3GSIq IbymmitOyDvjRyWuMyeUPPfKFH96QrQ36TWdhtm0L5WePmN76bSzAuNqttIa0OQRkYBb +GmGKEvzI8IpnZf+XvbeWcGGlKa5cwBHaHo9Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=Sats1dvDH0XDSWPrzv9qnW7mig2lZ02vgrr1G7RhtqE=; b=GzCjoEIV54TreKPbHGzizPMVTHINIlisac0O9g6b8fDL/rMZezZEzTpth8sPjilKhO Nahjo6QGVFBqNqA0r32mkTcKAR6ZfUtMPPo/MH1+8wIQUoxSp3r7TJx7N806j1qtE5kW axIvr56zGiwCJ6DhRDvne0dvhEESF/ETYkVzUV27c40GtGQ0DUDAuiSxE+AKAgKhT8N+ onh+Uj1eIRqTU8S32ApF2d6f6YtjyA7X9R1zjlpP7/OBj6u873y7AavE5Txwd19sliK0 1na1AGq7D6E4qWnZy1r4saz7mvxm4RSVfkIw6Gzs8s541LzasywVYi5py4ih6AQxQrlG HkrQ== Received: by 10.216.242.196 with SMTP id i46mr8938709wer.140.1346179566929; Tue, 28 Aug 2012 11:46:06 -0700 (PDT) Received: from unknown ([86.121.79.151]) by mx.google.com with ESMTPS id ef5sm9242871wib.3.2012.08.28.11.46.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Aug 2012 11:46:06 -0700 (PDT) Date: Tue, 28 Aug 2012 21:45:38 +0300 From: Theodor-Iulian Ciobanu To: Bernard Higonnet Message-ID: <20120828214538.00006729@unknown> In-Reply-To: <503CE66B.8000702@gmail.com> References: <503B9298.5060602@gmail.com> <503CE66B.8000702@gmail.com> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.24.8; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmjqYA+fwY/FM1oaAf7DSApZ/bFr4cFrU8FpmKNTim0C9JC1B2HuXgPdcV2XCggnQ1rEJ+D Cc: freebsd-net@freebsd.org Subject: Re: Seems DHCP request is ignoring default route info FreeBSD 9.0 - more info... 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, 28 Aug 2012 18:46:14 -0000 On Tue, 28 Aug 2012 17:40:27 +0200 Bernard Higonnet wrote: > On 28/08/2012 00:37, David Cornejo wrote: > > > > > > On Mon, Aug 27, 2012 at 5:30 AM, Bernard Higonnet > > > wrote: > > > > Hello, > > > > I have two machines running 9.0 and which use DHCP. The DHCP > > server is on a third machine using dnsmasq, also under 9.0, and > > provides an explicit default router address. > > > > dnsmasq is sending the right stuff, as evidenced by the dnsmasq > > log on the one hand, and by the fact that a Windows7 machine and a > > Windows XP machine are using the same DHCP server and those > > machines get the proper default gateway info on the other hand. > > > > Here is output from dnsmasq.log > > > > Aug 27 16:32:19 dnsmasq-dhcp[922]: 4078691060 > > sent size: 4 option: 3 router 192.168.4.1 > > > > What happens on the two FreeBSD machines is that I end up with > > no default gateway at all! > > > > When the same DHCP server used to provide its default gateway > > (i.e. the machine dnsmasq is running on) everything was OK. > > > > TIA > > Bernard Higonnet > > _________________________________________________ > > freebsd-net@freebsd.org > > mailing list http://lists.freebsd.org/__mailman/listinfo/freebsd-net > > > > To unsubscribe, send any mail to > > "freebsd-net-unsubscribe@__freebsd.org > > " > > > > > > Can you supply the output of "netstat -nr" from the machine that is > > missing a default route please? > > I hope I shall not be flamed too severely, but I did not mention > something in my original email because I thought it not pertinent, > but it turns out to have been... > > I have instructed dnsmasq to > > a) specify a non-standard default gateway and > b) add a classless-static-route This actually changes everything. :) The RFC requires DHCP clients to ignore the default route option when a classless route option exists.[1] So when using the latter, you actually have to specify at least two routes - the one you need to notify the clients of and 0.0.0.0/0, the default. Linux (or at least the distro I worked with) doesn't respect this, as it accepts the default gateway option even when classless routes are sent and some versions of Windows use a completely different option for classless routes than the standard (249 instead of 121 IIRC). FreeBSD > Each of these instructions are handled correctly by the FreeBSD > machines making a DHCP request, but not both at the same time. If > dnsmasq sends both, only the classless-static-route will be correctly > handled and there will be no default gateway at all. > > If dnsmasq does not provide the classless-static-route, the desired > default gateway works fine > > ?? > > Bernard Higonnet -- Theo [1] From page 5 of http://tools.ietf.org/html/rfc3442 If the DHCP server returns both a Classless Static Routes option and a Router option, the DHCP client MUST ignore the Router option.