How to install and Configure tftp server in fedora 11

What is TFTP?

Trivial File Transfer Protocol (TFTP) is a file transfer protocol, with the functionality of a very basic form of File Transfer Protocol (FTP). TFTP server is commonly used to upload and download executable images and configurations of routers and switches. To install tftp server, type this command in the console:

yum install tftp-server tftp xinetd

Edit the file /etc/xinetd.d/tftp

vi /etc/xinetd.d/tftp

and find the line

        server_args             = -s /var/lib/tftpboot

and change it to

        server_args             = -c -v -s /var/lib/tftpboot

also this line

        disable                 = yes

and change it to no.

        disable                 = no

This will be the configuration of your tftp server.

# 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             = -c -v -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4

Then change the ownership and the file permission of the tftp folder.

chown nobody:nobody /var/lib/tftpboot/
chmod ug+rwx /var/lib/tftpboot/

Make sure you disable selinux and allow tftp in iptables before starting the tftp server.
Edit the file /etc/sysconfig/selinux and disable selinux.

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.

and allow it to pass through the firewall by typing this command.

iptables -A INPUT -p udp --dport 69 -j ACCEPT

Run the command below to start the tftp

service xinetd restart

You can now use your tftp server. Below are the tftp commands you can use.

connect 	 connect to remote tftp
mode    	 set file transfer mode
put     	 send file
get     	 receive file
quit    	 exit tftp
verbose 	 toggle verbose mode
trace   	 toggle packet tracing
status  	 show current status
binary  	 set mode to octet
ascii   	 set mode to netascii
rexmt   	 set per-packet retransmission timeout
timeout 	 set total retransmission timeout
?       	 print help information

Your tftp server is ready.