Install TFTP Server on Centos 6

Share on:

Recently I had to troubleshoot a TFTP server that was part of a vSphere AutoDeploy environment. In the attempt to reproduce the issue in my lab, I deployed and configured a TFTP Server running on Centos 6. Here is what I did.

Step 1 - Update the server:

1yum update && yum upgrade -y

Step 2 - Install the following packages

1yum install -y tftp tftp-server tcpdump

[Optional] If the server is not connected to internet, mount the iso DVD and install from local source:

1mount /dev/cdrom /media/cdrom

And install the packages from the local repository (CDROM):

1yum --disablerepo=\* --enablerepo=c6-media install tftp tftp-server tcpdump

Step 3 - TFTP in CentOS 6.x runs under the xinetd Super Daemon. The configuration file is in /etc/xinetd.d/tftp
tftp settings under xinetd

Change disable = yes to disable = no

Step 4 - Start xinetd service:

1service xinetd start

Check if the server is waiting for connections on port udp 69:

1netstat -tulpn

netstat -tulpn

Don't forget to check the firewall:

1iptables -L INPUT -v

iptables rules

If needed, add a rule to allow traffic on udp port 69:

1iptables -I INPUT -p udp -m state --state NEW -m udp --dport 69 -j ACCEPT

iptables udp 69 allowed

Logs are written in /var/log/messages.

Use tcpdump to capture incoming traffic on port 69:

1tcpdump -nei eth0 udp port 69


comments powered by Disqus