tomclegg.net |
FreeBSD network boot server Posted April 18, 2005 How to boot diskless clients into FreeBSD using PXE: Set up the client's root directory on the server.Create the mkdir /home/pxe Install a FreeBSD distribution in cd /usr/src && make installworld DESTDIR=/home/pxe cd /usr/src && make distribution DESTDIR=/home/pxe -DNO_MAKEDEV_RUN cd /home/pxe/dev && sh MAKEDEV all cd /home/pxe && ln -s boot/pxeboot Install a dhcp server.cd /usr/ports/net/isc-dhcp3-server make install echo dhcpd_enable=YES >> /etc/rc.conf /usr/local/etc/rc.d/isc-dhcpd.sh start Configure the dhcp server to supply a network boot filename.Sample
Restart the server after modifying the configuration file. /usr/local/etc/rc.d/isc-dhcpd.sh restart Turn on tftp and nfs services on the server.Add to /home -alldirs -ro -maproot=root -network 192.168.2 -mask 255.255.255.0(replace 192.168.2 with your network number) Add to tftp dgram udp wait root /usr/libexec/tftpd tftpd -s /home/pxe Add to inetd_enable=YES portmap_enable=YES nfs_server_enable=YES Reboot, or start inetd and nfsd manually. cat /var/run/inetd.pid || inetd netstat -an | fgrep -w '*.111' || /usr/sbin/portmap cat /var/run/mountd.pid || /sbin/mountd netstat -an | fgrep -w '*.2049' || /sbin/nfsd -u -t -n 4 Set up net client configuration files.Create 192.168.2.2:/home/pxe / nfs ro 0 0 Create ipaddr="`ifconfig|grep inet | head -n 1 | cut -d\ -f2`" hostname="`echo "$ipaddr" | tr . -`".example.com(this will give the client a hostname like 192-168-2-199.example.com) Set up applications to run on the clientYou can set up the client to run a script instead of showing a login prompt. In this example, the client downloads a disk image from a web server and writes it to the built-in flash disk on an HP T5700 thin terminal. Replace the line in ttyv0 "/usr/libexec/getty image" cons25 on secure Add to the end of image:al=root:tc=Pc: Add to the end of ./image Create /home/pxe/root/image
Make chmod +x /home/pxe/root/image Edit or remove |