Modify the network settings in the file to suit your environment.
Step 2: Enable TFTP Server and Download Ubuntu Netboot files
Add the following options to the file to enable the TFTP server:
Download and extract the Ubuntu files to the tftp root directory by running the following commands:
sudo tar -xvzf netboot.tar.gz -C /srv/tftp/
sudo chown -R nobody:nogroup /srv/tftp/
Step 3: Configure the DHCP Server to send the name of the boot image
Add the following option to the dnsmasq.conf file to send the name of the image to boot.
Determine the MAC address of your client machine that you want to install Ubuntu on.
If you’re following along using VMware Fusion, it can be found by clicking Settings, then on the Network Adapter and then Advanced Settings.
Now assuming your MAC address is 00:50:56:39:87:7A and you want to assign an IP address of 10.1.1.21, add the following to the dnsmasq.conf file:
Save the changes and restart dnsmasq with the following command to apply the changes:
sudo systemctl restart dnsmasq
Step 4: Power on Client and Test
Power on your client machine and it should boot using PXE. The DHCP server will assign it the fixed IP address specified in the previous step and then the client will download the Ubuntu boot image from the TFTP server.
The following screenshots show this in action on a VMware Fusion virtual machine.
Now you can walk through the installation of Ubuntu as you would normally.
In this tutorial, we configured Dnsmasq on Ubuntu Server 18.04 to work as a DHCP, PXE and TFTP server. We setup a fixed IP for a client and tested booting the Ubuntu net installer over the network.
After installing Ubuntu over the network, future packages will be downloaded from the internet. Depending on how many machines you have on the network, you might want to change it so that all files are downloaded over the local network. Another thing you might want to do, is use a Kickstart file to fully automate the installation.