<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.fogproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danielcssl</id>
		<title>FOG Project - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.fogproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Danielcssl"/>
		<link rel="alternate" type="text/html" href="https://wiki.fogproject.org/wiki/index.php?title=Special:Contributions/Danielcssl"/>
		<updated>2026-05-25T10:46:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.fogproject.org/wiki/index.php?title=Multiple_TFTP_servers&amp;diff=3515</id>
		<title>Multiple TFTP servers</title>
		<link rel="alternate" type="text/html" href="https://wiki.fogproject.org/wiki/index.php?title=Multiple_TFTP_servers&amp;diff=3515"/>
				<updated>2011-07-15T05:46:11Z</updated>
		
		<summary type="html">&lt;p&gt;Danielcssl: crontab scheduling - needs RV (at least on my servers) to actually update tftpboot properly on the nodes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Including multiple TFTP servers ==&lt;br /&gt;
&lt;br /&gt;
This section was added based on [https://sourceforge.net/projects/freeghost/forums/forum/730844/topic/3622667 this forum thread] with credit going to [https://sourceforge.net/users/jhoff484/ Jordan Hoff] who describes how to provide the necessary services to allow FOG to span across isolated network segments. A traditional 'Master Storage Node' as described [[Managing_FOG#Storage_Manangement|here]] only provides File Storage services to increase unicast throughput within a single network. The steps below describe how to modify a Storage Node to also provide PXE and TFTP services for a separate network segment.&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu Server LTS 10.04 using fog_0.29 ====&lt;br /&gt;
[http://en.wikipedia.org/wiki/Sudo &amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt;] is assumed unless specified.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===== Changes on the Master Server =====&lt;br /&gt;
On the master server, edit the &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; file, and append the following line: &amp;lt;pre&amp;gt;/tftpboot/pxelinux.cfg *(ro,sync,no_wdelay,no_root_squash,insecure,no_subtree_check)&amp;lt;/pre&amp;gt; While you're in there, append &amp;lt;tt&amp;gt;no_subtree_check&amp;lt;/tt&amp;gt; to the other entries to prevent warnings in the next step.&amp;lt;br&amp;gt;Then, enable the newly configured exports by executing the following command: &amp;lt;pre&amp;gt;exportfs -a&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we need to setup [https://help.ubuntu.com/community/rsync#Rsync%20Daemon rsyncd]:&amp;lt;br&amp;gt;&lt;br /&gt;
Edit /etc/default/rsync to change &amp;lt;tt&amp;gt;RSYNC_ENABLE=false&amp;lt;/tt&amp;gt; to:&lt;br /&gt;
&amp;lt;pre&amp;gt;RSYNC_ENABLE=inetd&amp;lt;/pre&amp;gt;&lt;br /&gt;
Install xinetd:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo apt-get -y install xinetd&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create or edit &amp;lt;tt&amp;gt;/etc/xinetd.d/rsync&amp;lt;/tt&amp;gt; file to launch rsync (if it already exists just change &amp;lt;tt&amp;gt;RSYNC_ENABLE=false&amp;lt;/tt&amp;gt; to:&amp;lt;tt&amp;gt;RSYNC_ENABLE=true&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;service rsync&lt;br /&gt;
{&lt;br /&gt;
    disable = no&lt;br /&gt;
    socket_type = stream&lt;br /&gt;
    wait = no&lt;br /&gt;
    user = root&lt;br /&gt;
    server = /usr/bin/rsync&lt;br /&gt;
    server_args = --daemon&lt;br /&gt;
    log_on_failure += USERID&lt;br /&gt;
    flags = IPv6&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create or edit a /etc/rsyncd.conf file with the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;max connections = 2&lt;br /&gt;
motd file = /etc/rsyncd.motd&lt;br /&gt;
log file = /var/log/rsyncd.log&lt;br /&gt;
pid file = /var/run/rsyncd.pid&lt;br /&gt;
lock file = /var/run/rsync.lock&lt;br /&gt;
timeout = 300&lt;br /&gt;
&lt;br /&gt;
[tftpboot]&lt;br /&gt;
    path = /tftpboot&lt;br /&gt;
    comment = Fog tftpboot share&lt;br /&gt;
    read only = true&lt;br /&gt;
    exclude = *pxelinux.cfg/*&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;And start the rsyncd daemon:&amp;lt;pre&amp;gt;rsync --daemon&amp;lt;/pre&amp;gt;&lt;br /&gt;
Restart xinetd:&amp;lt;pre&amp;gt;service xinetd restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
Now, our master server is ready to share everything it needs for another PXE server to operate. Lets go and setup a new server!&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===== Setting up the remote Storage Node ===== &lt;br /&gt;
Setup your secondary server as you normally would, before installing fog. (In this example, I use Ubuntu, so you will have to modify this process if you are using anything else)&amp;lt;br&amp;gt;&lt;br /&gt;
After the network is configured and updates are applied, download and extract fog_0.29 following the basic [http://www.fogproject.org/wiki/index.php?title=Ubuntu_10.04#Setting_up_FOG_on_Ubuntu instructions].&amp;lt;br&amp;gt;&lt;br /&gt;
Before executing the setup script, there are two files to modify:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Edit the main &amp;lt;tt&amp;gt;/opt/fog-setup/fog_0.29/bin/installfog.sh&amp;lt;/tt&amp;gt; script. Locate the section titled:&amp;lt;tt&amp;gt;# Storage Node installation&amp;lt;/tt&amp;gt;&lt;br /&gt;
Insert the following line after &amp;lt;tt&amp;gt;configureFTP;&amp;lt;/tt&amp;gt; and save the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;configureTFTPandPXE;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &amp;lt;tt&amp;gt;/opt/fog-setup/fog_0.29/lib/ubuntu/config.sh&amp;lt;/tt&amp;gt; script:&lt;br /&gt;
Locate the line beginning with &amp;lt;tt&amp;gt;storageNodePackages&amp;lt;/tt&amp;gt; (on line #24) and add these two packages within the quotes:&lt;br /&gt;
&amp;lt;pre&amp;gt;tftpd-hpa tftp-hpa&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Then, just install the fog storage node as usual. The modifications above will install and configure TFTP / PXE services for us. Then, all we have to do is tie it back to the main server. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
First, remove everything in the /tftpboot folder on the secondary node:&lt;br /&gt;
&amp;lt;pre&amp;gt;rm -rf /tftpboot/*&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now initiate rsync for the &amp;lt;tt&amp;gt;/tftpboot&amp;lt;/tt&amp;gt; folder:&lt;br /&gt;
&amp;lt;pre&amp;gt;rsync -rv mainserver.yourcompany.com::tftpboot/ /tftpboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we setup the crontab to run every hour(at the 15 minute mark of each, or modify to your liking)&lt;br /&gt;
&amp;lt;pre&amp;gt;crontab -e (you may be asked to select an editor)&lt;br /&gt;
15 * * * * rsync -rv mainserver.yourcompany.com::tftpboot /tftpboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, all that is left is to setup our NFS share for the pxelinux.cfg folder. Modify &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt; and add the following: &lt;br /&gt;
&amp;lt;pre&amp;gt;mainserver.yourcompany.com:/tftpboot/pxelinux.cfg /tftpboot/pxelinux.cfg nfs nolock 0 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
Save and close, then we mount this folder one time (the fstab entry above ensures that it will re-mount automatically at reboot):&lt;br /&gt;
&amp;lt;pre&amp;gt;mount /tftpboot/pxelinux.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Add the Storage Node to your main server =====&lt;br /&gt;
See: [[#Adding_the_Node_to_the_Management_Portal|Adding the Node to the Management Portal]]&amp;lt;br&amp;gt;&lt;br /&gt;
And that's it! Go ahead and test out your fancy new PXE server.&amp;lt;br&amp;gt;&lt;br /&gt;
===Exceptions===&lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;LI&amp;gt;Note that in testing the above solution did NOT automatically sync the /images folder. I manually run the following command for each image I want ''from the Storage Node'':&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo scp -r root@mainFOGserver:/images/nameOfImage /images/&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Another very useful addition is [https://sourceforge.net/projects/freeghost/forums/forum/716419/topic/4006688 this patch] which provides clients the intelligence to use the closest node.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This also does NOT provide WOL packets to be sent via the local Storage Nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Danielcssl</name></author>	</entry>

	</feed>