From owner-freebsd-net Tue Oct 23 8:31:10 2001 Delivered-To: freebsd-net@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 762F437B403 for ; Tue, 23 Oct 2001 08:31:06 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id f9NFUw892231 for ; Tue, 23 Oct 2001 08:30:58 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id f9NFUwm46770; Tue, 23 Oct 2001 08:30:58 -0700 (PDT) (envelope-from jdp) Date: Tue, 23 Oct 2001 08:30:58 -0700 (PDT) Message-Id: <200110231530.f9NFUwm46770@vashon.polstra.com> To: net@freebsd.org From: John Polstra Subject: Re: PXE boot vs. DHCP In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article , John Polstra wrote: > I've been setting up a 4.4-RELEASE system for net booting and diskless > operation with pxeboot, and I've run into a minor but annoying > problem. It seems that if you boot with PXE you can't use dhclient. > pxeboot configures the relevant network interface (let's call it > fxp0), NFS-mounts the root filesystem, boots the kernel, etc., and > begins to enter multi-user mode. The rc.network script then runs > dhclient, which tries to configure fxp0 (again). It apparently starts > out by unconfiguring fxp0's IP address, because NFS immediately hangs > with a "host unreachable" error. At that point I have to walk over > and press the reset button. The patch below for dhclient-script fixes the problem for me. If the script is about to change the IP address to 0.0.0.0 (in the PREINIT phase), the patched version first checks to see if the interface is already up. If it is up, there is no need to reset its IP address. We are just trying to get the interface into a state where it can send IP packets, and it is already in that state. Any objections? John Index: freebsd =================================================================== RCS file: /home/ncvs/src/contrib/isc-dhcp/client/scripts/freebsd,v retrieving revision 1.19 diff -U5 -r1.19 freebsd --- freebsd 2001/03/31 09:26:03 1.19 +++ freebsd 2001/10/23 15:24:41 @@ -62,12 +62,20 @@ if [ x$reason = xPREINIT ]; then if [ x$alias_ip_address != x ]; then ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1 route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1 fi - ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ - broadcast 255.255.255.255 up + # The interface may have already been brought up by pxeboot. Don't + # disturb it in that case. + case `ifconfig $interface` in + *flags=*[\<,]UP[\>,]*) + ;; + *) + ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \ + broadcast 255.255.255.255 up + ;; + esac exit_with_hooks 0 fi if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then exit_with_hooks 0; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message