Skip to content
induslevel.com
Menu
  • Home
Menu
tftp-server

How to Install TFTP Server in CentOS 7

Posted on September 22, 2021October 10, 2021 by Waqar Azeem

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.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • More
  • Click to print (Opens in new window) Print
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to email a link to a friend (Opens in new window) Email

Related Articles

Share your thoughtsCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Easiest Way to Setup WordPress and OpenConnect VPN Server using Ansible
  • How to use port 443 for SSH and OpenConnect VPN on Linux using HAProxy
  • How to Backup ZFS Snapshots to AWS Glacier
  • How to Install and Setup OpenConnect VPN Server on CentOS 7
  • How to Compile Kitty SSH Client from Source Code

Recent Comments

  1. Waqar Azeem on How to Install and Setup Kubernetes Cluster with Flannel CNI in CentOS 7
  2. Owais Khaleeq on How to Install and Setup Kubernetes Cluster with Flannel CNI in CentOS 7
  3. Muhammad Rizwan Latif on How To Setup 3-Node DynaTrace Managed Cluster on Centos/Redhat 7
  4. Waqar Azeem on How To Setup 3-Node DynaTrace Managed Cluster on Centos/Redhat 7
  5. Tahir on How to Install Simple DHCP Server in Centos 7

Archives

  • August 2024
  • February 2024
  • January 2024
  • July 2023
  • October 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021

Categories

  • Uncategorized
© 2025 INDUS LEVEL | Powered by Minimalist Blog WordPress Theme