19 May 2015

How to Configure TFTP Server on CentOS 6

#yum install -y tftp tftp-server xinetd

#mkdir /Backup
#chmod 777 /backup

#vi /etc/xinetd.d/tftp

# 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
{
        disable = no
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s -c /backup
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
        disable                 = no
}

#vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT

# /etc/init.d/xinetd restart
# /etc/init.d/iptables restart

Verify listen port services xinetd and tftp:
>netstat -tanup

Testing get file through TFTP Server:
#echo “TFTP Hello test” > /backup/test.txt
>tftp 127.0.0.1
>get test.txt