Date: Wed, 7 May 2014 10:12:00 +0200 From: amine tay <amine.tay91@gmail.com> To: Doug Ambrisko <ambrisko@ambrisko.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: vm+ipxe+pxeboot fail Message-ID: <CAMMGsZK1NYCSjS70%2Bu_Js%2BTHu6KBZx9LcTMeuJGiXKA7auOLBg@mail.gmail.com> In-Reply-To: <20140506154021.GA53537@ambrisko.com> References: <CAMMGsZKLkXPJAyuoiNoRo3DQEOgzMps-D7-iTThz8ARPyjZXTg@mail.gmail.com> <20140506154021.GA53537@ambrisko.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ambrisko@ambrisko.com>: > 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 > | <http://man.freebsd.org/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 > | pxeboot<http://man.freebsd.org/pxeboot>loader. > | > | 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. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMMGsZK1NYCSjS70%2Bu_Js%2BTHu6KBZx9LcTMeuJGiXKA7auOLBg>