WHAT IS TFTP SERVER AND HOW TO CONFIGURE TFTP IN LINUX.

 

In this article we are going to learn what is TFTP server? and how to configure ?

TFTP, or Trivial File Transfer Protocol, is a ve
ry basic file transfer protocol. It is very simple, doesn’t have any security authentication, and usually used for transferring small files.TFTP Server is multi-threaded and commonly used to upload and download executable images and backup configurations for routers and switches

Follow these steps to configure :

[root@localhost ~]# yum install tftp*
Loaded plugins: rhnplugin, security
Repository 'a' is missing name in configuration, using id
This system is not registered with RHN.
RHN support will be disabled.
a                                                                                      | 1.3 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i386 0:2.2.3-31.el5 set to be updated
a/filelists                                                                            | 2.3 MB     00:00
--> Processing Dependency: libapr-1.so.0 for package: httpd
--> Processing Dependency: libaprutil-1.so.0 for package: httpd
---> Package httpd-devel.i386 0:2.2.3-31.el5 set to be updated
--> Processing Dependency: apr-util-devel for package: httpd-devel
--> Processing Dependency: apr-devel for package: httpd-devel
---> Package httpd-manual.i386 0:2.2.3-31.el5 set to be updated
--> Running transaction check
Dependencies Resolved
==============================================================================================================
 Package                         Arch                Version                           Repository        Size
==============================================================================================================
Installing:
 httpd                           i386                2.2.3-31.el5                      a                1.2 M
 httpd-devel                     i386                2.2.3-31.el5                      a                146 k
 httpd-manual                    i386                2.2.3-31.el5                      a                811 k
Installing for dependencies:
 apr                             i386                1.2.7-11.el5_3.1                  a                123 k
 apr-devel                       i386                1.2.7-11.el5_3.1                  a                232 k
 apr-util                        i386                1.2.7-7.el5_3.2                   a                 76 k
 apr-util-devel                  i386                1.2.7-7.el5_3.2                   a                 53 k
 cyrus-sasl-devel                i386                2.1.22-5.el5                      a                1.4 M
 db4-devel                       i386                4.3.29-10.el5                     a                1.9 M
 expat-devel                     i386                1.95.8-8.2.1                      a                130 k
 gcc                             i386                4.1.2-46.el5                      a                5.2 M
 glibc-devel                     i386                2.5-42                            a                2.0 M
 glibc-headers                   i386                2.5-42                            a                601 k
 kernel-headers                  i386                2.6.18-164.el5                    a                993 k
 libgomp                         i386                4.4.0-6.el5                       a                 70 k
 openldap-devel                  i386                2.3.43-3.el5                      a                1.6 M
 postgresql-libs                 i386                8.1.11-1.el5_1.1
Install     17 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 17 M
Is this ok [y/N]: y
  • It calculate file size and ask you whether you wanna download it or not .Press y and hit ENTER. File will be installed in seconds.
Downloading Packages:
--------------------------------------------------------------------------------------------------------------
Total                                                                          75 MB/s |  17 MB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Complete!
  • Now we have to make changes in tftp configuration file . So we are going to open tftp configuration file .
[root@localhost ~]# vim /etc/xinetd.d/tftp
  • We have to make small change in this configuration file . You will see disable is yes.
# 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 /tftpboot
        disable                 = yes
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
~
~
  • Press I and you will be in  insert mode .Means now you can write anything in file .We have to make  DISABLE = no
# 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 /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
~
~
  • Press  ESC and type :wq (to save and quit)
~
~
~
:wq
  • Our firewall settings should be off to start tftp server. So we will check our firewall is on or not.
[root@localhost ~]# iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     esp  --  anywhere             anywhere
ACCEPT     ah   --  anywhere             anywhere
ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
  • You will see ACCEPT word that means your firewall settings is on .We will disable it + We will disable security enhance settings.
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0
  • Now check Whats ip of your machine.
[root@localhost ~]# ifconfig

Server part is done . Now comes the client role.

  • Type tftp and ip address of the server machine.It will connect you to the server machine within a seconds .
[root@localhost ~]# tftp 192.168.56.101
tftp>
  • Type  ?  and you will get all help you might need in this server.
tftp> ?

tftp-hpa 0.49
Commands may be abbreviated.  Commands are:
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
literal         toggle literal mode, ignore ':' in file name
status          show current status
binary          set mode to octet
ascii           set mode to netascii
rexmt           set per-packet transmission timeout
timeout         set total retransmission timeout
?               print help information
help            print help information

If you wanna download a file type = get filename

If you wanna upload a file type= put filename

WHAT IS TELNET AND HOW TO CONFIGURE TELNET IN LINUX AS SERVER AND WINDOWS OR ANDROID AS CLIENT.

HOW TO MAKE SECURE PHONE CALLS (ANDROID OR IOS)

HOW TO COMBINE FILES IN A SINGLE FILE AND HOW TO COMPRESS FILE IN LINUX

One thought on “WHAT IS TFTP SERVER AND HOW TO CONFIGURE TFTP IN LINUX.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s