Fog Project: Difference between revisions
| Line 94: | Line 94: | ||
<li><pre>ln -s /srv/tftp /tftpboot</pre></li> |
<li><pre>ln -s /srv/tftp /tftpboot</pre></li> |
||
<li> |
<li>control FOG IP address in file /tftpboot/default.ipxe and change if it need</li> |
||
<li>Restart dnsmasq with <pre>sudo service dnsmasq restart</pre></li></ol> |
<li>Restart dnsmasq with <pre>sudo service dnsmasq restart</pre></li></ol> |
||
Revision as of 05:56, 22 September 2022
Overview
This combines FOG with a proxyDHCP server. What a proxyDHCP service does is listen to DHCP requests and respond to clients identifying themselves as PXE Clients. It leaves the role of assigning IP addresses to the other DHCP servers, but provides the necessary information so the client can PXE boot. ProxyDHCP is a solution for those of you who are working with an unmodifiable DHCP server or wish to avoid the hassle of editing the already existing DHCP server, or even as a portable imaging solution.
How ProxyDHCP works
- When a PXE client boots up, it sends a DHCP Discover broadcast on the network, which includes a list of information the client would like from the DHCP server, and some information identifying itself as a PXE capable device.
- A regular DHCP server responds with a DHCP Offer, which contains possible values for network settings requested by the client.Usually a possible IP address, subnet mask, router (gateway) address, dns domain name, etc.
- Because the client identified itself as a PXEClient, the proxyDHCP server also responds with a DHCP Offer with additional information, but not IP address info. It leaves the IP address assigning to the regular DHCP server. The proxyDHCP server provides the next-server-name and boot file name values, which is used by the client during the upcoming TFTP transaction.
- The PXE Client responds to the DHCP Offer with a DHCP Request, where it officially requests the IP configuration information from the regular DHCP server.
- The regular DHCP server responds back with an ACK (acknowledgement), letting the client know it can use the IP configuration information it requested.
- The client now has its IP configuration information, TFTP Server name, and boot file name and it initiate a TFTP transaction to download the boot file.
Environment
Tested working with:
| (k)Ubuntu 20.04 x64 | Fog v1.5.9 |
- dnsmasq
- LTSP Server, further documentation at Ubuntu LTSP/ProxyDHCP.
Setup and Configuration
- First get your desired linux flavor installed
- Install FOG (use instructions on wiki user manual)
- Make sure you do a normal server installation, don't setup a DHCP router address or a DNS server address, also don't use FOG as a DHCP server.
- If you set a MySQL password make sure you change it in /var/www/fog/commons/config.php and also in /opt/fog/service/etc/config.php
- Edit /etc/exports to look like this:
/images *(ro,async,no_wdelay,insecure_locks,no_root_squash,insecure) /images/dev *(rw,async,no_wdelay,no_root_squash,insecure)
- Install dnsmasq using:
sudo apt-get install dnsmasq
- Create /etc/dnsmasq.d/ltsp.conf using the following settings, modify as needed:
# Sample configuration for dnsmasq to function as a proxyDHCP server, # enabling LTSP clients to boot when an external, unmodifiable DHCP # server is present. # The main dnsmasq configuration is in /etc/dnsmasq.conf; # the contents of this script are added to the main configuration. # You may modify the file to suit your needs. # Don't function as a DNS server: port=0 # Log lots of extra information about DHCP transactions. log-dhcp # Set the root directory for files available via FTP. tftp-root=/tftpboot # Disable re-use of the DHCP servername and filename fields as extra # option space. That's to avoid confusing some old or broken DHCP clients. dhcp-no-override # inspect the vendor class string and match the text to set the tag dhcp-vendorclass=BIOS,PXEClient:Arch:00000 dhcp-vendorclass=UEFI32,PXEClient:Arch:00006 dhcp-vendorclass=UEFI,PXEClient:Arch:00007 dhcp-vendorclass=UEFI64,PXEClient:Arch:00009 #UUID for a Dell e6230 I tested (this info was gleaned from the dnsmasq log file that recorded # a pxe boot session of this target computer dhcp-match=set:e6230,97,00:44:45:4c:4c:38:00:10:36:80:4e:c4:c0:4f:4a:58:31 # Set the boot file name based on the matching tag from the vendor class (above) dhcp-boot=net:UEFI32,i386-efi/ipxe.efi,,<FOG ip address> dhcp-boot=net:UEFI,ipxe.efi,,<FOG ip address> dhcp-boot=net:UEFI64,ipxe.efi,,<FOG ip address> # Our test to ensure both the UEFI and e6230 tags are set. dhcp-boot=tag:UEFI,tag:e6230, intel.efi, <FOG ip address>, <FOG ip address> # The boot filename, Server name, Server Ip Address dhcp-boot=undionly.kpxe,,<FOG ip address> # PXE menu. The first part is the text displayed to the user. The second is the timeout, in seconds. pxe-prompt="Booting FOG Client", 1 dhcp-range=<FOG ip address>,proxy
mkdir /srv/tftp
ln -s /srv/tftp /tftpboot
- control FOG IP address in file /tftpboot/default.ipxe and change if it need
- Restart dnsmasq with
sudo service dnsmasq restart
Note: After getting everything working, you can change the timeout to 0 on the line:
pxe-prompt="Press F8 for boot menu", 3
Serving ProxyDHCP to multiple subnets
If you are serving ProxyDHCP to multiple subnets some changes must be made to your switches/routers and your server config.
- Modify your /etc/dnsmasq.d/ltsp.conf file by adding the subnet mask option to line:
dhcp-range=192.168.1.10,proxy
to make itdhcp-range=192.168.1.10,proxy,255.255.0.0
which will serve all 192.168.x.x subnets. If you are using 10.x.x.x addressing, use subnet mask "255.0.0.0" (8-bit) and if you are using 172.16.x.x, use subnet mask "255.240.0.0" (12 bit). Basically set the subnet mask so that all subnets on which ProxyDHCP should answer are covered. If you don't do this, the ProxyDHCP server will not respond to DHCP requests for hosts outside of it's own subnet. - Add an IP Helper/DHCP Relay record to your router or switch so the DHCP broadcasts are sent to your normal DHCP server AND the Fog server.
Additional Info
Using FOG with an unmodifiable DHCP server/ Using FOG with no DHCP server