From owner-freebsd-hackers@FreeBSD.ORG Wed May 7 08:12:02 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0275CD37 for ; Wed, 7 May 2014 08:12:02 +0000 (UTC) Received: from mail-yk0-x229.google.com (mail-yk0-x229.google.com [IPv6:2607:f8b0:4002:c07::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B809267F for ; Wed, 7 May 2014 08:12:01 +0000 (UTC) Received: by mail-yk0-f169.google.com with SMTP id 200so528924ykr.14 for ; Wed, 07 May 2014 01:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CGhqfW/v8hmPfm3mKyZwcTI8Xgp177mQXVITP1pWKsM=; b=GJ7pnsvLnkFGttS811Z7WJurb16jVYHP5k9JxOSQ72Eyl3AtFYDthOOzXOGttnjX1v ncyOy/e4Nn+rzqJ/YtaDPj2UhBB2I3vjWfBOq6s5tVub8+qw5sadKFTh2TNOtKKQYPn2 dVQr4lZZWbAJvHhn4V1TqknvVDBZ9PxoFT9S4C2DyR6oJz7fhJwIZ0XQ8TKU9BCYEmrs jqbM0FncZIrtNW6YwVwCW8FoGXVDlV71Oe0PZa9AwpodufoTmyalXmB2BdXlJl3iONJc 1vsWFLChYYKiypLn1+6hGu/AfDlyJQ9cJRyceG5SCF4Zj3SXelEtzFmuWuLy1m+olB4h g44w== MIME-Version: 1.0 X-Received: by 10.236.0.200 with SMTP id 48mr65793477yhb.72.1399450320867; Wed, 07 May 2014 01:12:00 -0700 (PDT) Received: by 10.170.202.139 with HTTP; Wed, 7 May 2014 01:12:00 -0700 (PDT) In-Reply-To: <20140506154021.GA53537@ambrisko.com> References: <20140506154021.GA53537@ambrisko.com> Date: Wed, 7 May 2014 10:12:00 +0200 Message-ID: Subject: Re: vm+ipxe+pxeboot fail From: amine tay To: Doug Ambrisko Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:12:02 -0000 Thanks Doug for you reply, Your answer helped a lot, I will try your patch and let you know if it works. Amine. 2014-05-06 17:40 GMT+02:00 Doug Ambrisko : > On Wed, Apr 30, 2014 at 10:10:07AM +0200, amine tay wrote: > | Hi everyone, > | > | Lately I had some problems, trying to get FreeBSD to PXE boot. (Actually > | I'm using a VMware virtual machine.) First I'm using iPXE 1.0.0 and then > | load and launch the FreeBSD pxeboot > | loader. But I'm getting this : > | http://forums.freebsd.org/viewtopic.php?f=4&t=45901 > | When using isc-dhcp as DHCP server I'm getting the error but when using > | dnsmasq everything works fine. > | > | The problem seems that the client when booting is sending 2 DHCP requests > | and therefore gets two different IP addresses, the first one sent by the > | ROM and the second one by the FreeBSD > | pxebootloader. > | > | I found somewhere in some posts that the pxe.c file is doing a second > | bootprequest because it fails to get cached DHCP data from the ROM. > | > | Any help or more ideas would be appreciated. > > If you do a dump on the packets you can probably see the iPXE is sending > a client ID and the pxeboot isn't. So then ISC DHCP server doesn't like > that and gives a different IP. Then things don't match up anymore. > > This is a patch to fix libstand for iPXE but then seems to break HW PXE. > However, I'm finding with some new eval. HW, PXE is starting to fail on > something else. > > Index: bootp.c > =================================================================== > --- bootp.c (revision 255868) > +++ bootp.c (working copy) > @@ -146,8 +146,12 @@ > if (flag & BOOTP_PXE) { > bp->bp_vend[7] = TAG_CLASSID; > bp->bp_vend[8] = 9; > - bcopy("PXEClient", &bp->bp_vend[9], 9); > - bp->bp_vend[18] = TAG_END; > + bcopy(bp->bp_chaddr, &bp->bp_vend[9], 9); > + bp->bp_vend[18] = TAG_CLIENTID; > + bp->bp_vend[19] = 7; /* type and length */ > + bp->bp_vend[20] = 1; /* MAC */ > + bcopy(d->myea, &bp->bp_vend[21], 6); > + bp->bp_vend[27] = TAG_END; > } else > bp->bp_vend[7] = TAG_END; > #else > @@ -190,7 +194,11 @@ > bp->bp_vend[25] = TAG_CLASSID; > bp->bp_vend[26] = 9; > bcopy("PXEClient", &bp->bp_vend[27], 9); > - bp->bp_vend[36] = TAG_END; > + bp->bp_vend[36] = TAG_CLIENTID; > + bp->bp_vend[37] = 7; /* type and length */ > + bp->bp_vend[38] = 1; /* MAC */ > + bcopy(d->myea, &bp->bp_vend[39], 6); > + bp->bp_vend[45] = TAG_END; > } else > bp->bp_vend[25] = TAG_END; > > > You'll need to rebuild libstand.a, rebuild pxeboot with the new libstand.a. > I haven't figure out how to determine if it needs it or not. I ran into > this when trying to PXE boot in VirtualBox and QEMU. There might be > an option in dhcpd.conf to disable this check for client ID. > > Thanks, > > Doug A. >