From owner-freebsd-hackers@FreeBSD.ORG Tue May 6 15:40:29 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 08026489 for ; Tue, 6 May 2014 15:40:29 +0000 (UTC) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id CD905F6A for ; Tue, 6 May 2014 15:40:28 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 06 May 2014 08:45:33 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id s46FeMgK058418; Tue, 6 May 2014 08:40:22 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id s46FeMeX058417; Tue, 6 May 2014 08:40:22 -0700 (PDT) (envelope-from ambrisko) Date: Tue, 6 May 2014 08:40:22 -0700 From: Doug Ambrisko To: amine tay Subject: Re: vm+ipxe+pxeboot fail Message-ID: <20140506154021.GA53537@ambrisko.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i 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: Tue, 06 May 2014 15:40:29 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --wac7ysb48OaltWcw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pxe_clientid.patch" 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; --wac7ysb48OaltWcw--