Date: Tue, 23 Oct 2001 08:30:58 -0700 (PDT) From: John Polstra <jdp@polstra.com> To: net@freebsd.org Subject: Re: PXE boot vs. DHCP Message-ID: <200110231530.f9NFUwm46770@vashon.polstra.com> In-Reply-To: <XFMail.011014203733.jdp@polstra.com> References: <XFMail.011014203733.jdp@polstra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <XFMail.011014203733.jdp@polstra.com>,
John Polstra <jdp@polstra.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110231530.f9NFUwm46770>
