TFTP stands for Trivial File Transfer Protocol. TFTP is used to transfer data from server to client via udp unlike FTP which uses tcp protocol.
This article will help you setup tftp server on CentOS with minimum configurations. We are going to use the same machine which was configured as DHCP server. On that machine, we have already installed helper tools like htop, bash-completion etc.
Install tftp package along with syslinux package from yum. Syslinux package will provide binaries required to boot a system from network once the client makes a connection and asks for bootloader
yum install tftp-server syslinux-tftpboot -y
Enable the tftp service on startup
systemctl enable tftp.service
Make changes in host firewall and allow tftp inbound traffic
firewall-cmd --permanent --zone=public --add-service=tftp
You can enable the tftp traffic in running configuration by reloading the firewall as we have added tftp service to configuration files of firewalld in previous command. Reloading the service will force the firewalld daemon to re-read the configuration files and allow the tftp traffic
firewall-cmd --reload
Check the running configuration of firewalld
firewall-cmd --list-all
Backup the default configuration file
cp /etc/xinetd.d/tftp /root/tftp.bak
Now we are going to empty the tftp configuration file
>/etc/xinetd.d/tftp
Copy past following lines on terminal
cat > /etc/xinetd.d/tftp <<EOF
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s -v -v -v /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
EOF
Start the tftp service and check its status
systemctl start tftp.service && systemctl status tftp.service
In case of any error, check messages log file
tail /var/log/messages
Now tftp server is ready to serve the files to clients. We will be using this tftp server to serve files for network (PXE) booting of thin clients for OS installation. You will need to add next server information in your DHCP server for the thin clients along with filename.
Following snippet of DHCP configuration is enabling the thin clients to connect to tftp server and ask for bootloader file i.e. pxelinux.0
subnet 172.16.99.0 netmask 255.255.255.0 {
option broadcast-address 172.16.99.255;
option routers 172.16.99.1;
filename "/pxelinux.0";
pool {
range 172.16.99.150 172.16.99.230;
}
group {
next-server lhr-pxe1.induslevel.com;
host tclient110 {
hardware ethernet 00:0c:29:d3:a1:d1;
fixed-address 172.16.99.110;
option host-name "tclient110.induslevel.local";
In next article, we will configure local repository which will be used to install hardened CentOS 7 operating system on thin clients via network/PXE booting. All we have to do is to select the network boot option from BIOS and select the appropriate option from PXE menu and then complete installation and rebooting will be done by setup.