| « HOWTO: Setup and install NUT to work with Fedora | HOWTO: Setup dnsmasq on Fedora as DNS DHCP and tftp for PXE » |
To setup a PXEserver with dnsmasq and fedora is really simple the second time
. This is how I do mine.
Setup dnsmasq so it is providing DNS and DHCP first. See my mini HOWTO.
decide where you are going to put the files for your PXE server. The files I mean are the copies of the install CD/DVD, the menus and configuration for the tftp server. I put mine in tftp and then in sub directories pxeboot and webroot. Create the empty directory structure now. From now on when I refer to pxeboot I mean /tftp/pxeboot and for webroot I mean /tftp/webroot. Also when I'm talking about http://localhost you can substitute the local ghost for a host name or IP address.
We will be needing a working HTTP server I use Apache as it is already used for a number of other things on my server/Nas machine. without further ado lets get on! Install apache, in fedora the package is called httpd.
The web server should have it's root directory pointing at /tftp/webroot. The simplest config file for this is
sudo service httpd start
To test the basic http service use the url http://localhost you should see the Fedora Apache web page.
To test the webroot directories, lets create a simple index.html page and check it displays in a browser. Create the file /tftp/webroot/index.html with the following text. Save it so it is readable by everyone.
Now reload the apache configuration
in your browser use the URL http://localhost/webroot/ and you should see the text from the index.html you save above. If you do not you did it wrong, please try again and follow all the steps in order.![]()
One more test to check that weget is working as expected. go to your HOME directory and get the index.html file from webroot.
">http://localhost/webroot/index.html[/khakisample]This should look something like this
To change a working install of Dnsmasq to work as a PXE server we need to turn on a few settings.
Edit the file /etc/dnsmasq.conf to turn on the following options, seethe comments in the file for what they do.
get dnsmasq to reload the changes
Download the latest Fedora installation DVD, not the live CD. This needs to be copied to webroot. I have a subdirectory structure that allows for continuous expansion and makes it easy to update from one version to another.
Mount the Fedora install DVD and copy everything over to the img directory for the correct release (f14, f15) and architecture (i386, X86_64). See my mini howto for that.
While that is copying over we can create the PXE server stuff in pxeboot. Create a subdirectory boot and then another subdirectory under that for the release of fedora, (f14, f15). Rather then copy the PXE boot files over again make a symbolic link back to the isolinux subdirectoy from the img directory you are copying from the DVD. In my case I use:
Create another subdirectory under pxeboot this time called pxelinux.cfg. This will hold your Menu configuration files.
Now get a copy of pxelinux.0 this can be found in the syslinux RPM, install it and copy it over from /usr/share/syslinux/pxelinux.0
also copy over a copy of the file vesamenu.c32 you can also get this from the isolinux directory this is common over a number of fedora release.
So assuming you are working with Fedora 15, the current version, lets create a simple menu to boot up from.
Using PXElinux it will eventually load the pxelinux.0/default. A quick and dirty one option menu would be
NOTE: The last line, APPEND, must be all on one line.