A practical and simple way to configure the tftp Server

Source: Internet
Author: User

In the network protocol, we should be familiar with the TFTP protocol. Today, we will focus on the configuration of the tftp server. TFTPTrivial File Transfer Protocol simple File Transfer Protocol) is a Protocol used in the TCP/IP Protocol family to transmit simple files between the client and the server, provides File Transfer services that are not complex and costly. TFTP is carried on UDP and provides unreliable data stream transmission services. It does not provide access authorization and authentication mechanisms, and uses the timeout retransmission method to ensure data arrival. Compared with FTP, TFTP is much smaller, and TFTP is the simplest network protocol used to download remote files. It is implemented based on UDP protocol. It uses UDP port 69.

Configure the tftp Server 1. Check whether the system has installed the tftp service.

 
 
  1. [root@wk ~]# rpm -qa | grep tftp  
  2. tftp-0.42-3.1.el5.centos  
  3. tftp-server-0.42-3.1.el5.centos 

If no installation is available, you can mount the CentOS5.2 CD to install it.

 
 
  1. [root@wk ~]# mount -t auto /dev/cdrom /mnt/cdrom  
  2. mount: block device /dev/cdrom is write-protected mounting read-only  
  3. [root@wk ~]# cd /mnt/cdrom/CentOS  
  4. [root@wk CentOS]# rpm -ivh tftp-0.42-3.1.el5.centos.i386.rpm  
  5. [root@wk CentOS]# rpm -ivh tftp-server-0.42-3.1.el5.centos.i386.rpm 

Configure the tftp Server 2. Modify the startup configuration file

By default, the TFTP service is disabled, so you need to modify the file to enable the Service.

Modify the/etc/xinetd. d/tftp file. It mainly sets the root directory of the TFTP server and enables the service.

The modified configuration file is as follows:

 
 
  1. Service tftp
  2. {
  3. Disable = yes. Change "yes" to "no ".
  4. Socket_type = dgram
  5. Protocol = udp
  6. Wait = yes
  7. User = root
  8. Server =/usr/sbin/in. tftpd
  9. Server_args =-s/tftpboot-c
  10. Per_source = 11
  11. CPIs = 100 2
  12. Flags = IPv4
  13. }

Specify/tftpboot as the root directory of the tftp server.

The-s parameter specifies the chroot and-c specifies the file to be created.

Configure the tftp server 3. Create the tftp root directory, disable the firewall, and start the tftp-server

 
 
  1. [root@wk ~]# mkdir /tftpboot  
  2. [root@wk ~]# chmod -R 777 /tftpboot  
  3. [root@wk ~]# /etc/init.d/iptables stop  
  4. [root@wk ~]# service xinetd restart 

Restart the xinetd service. Because the TFTP service is controlled by the xinetd service, xinetd is a service that manages services and does not open ports.

Check whether port 69 is enabled for TFTP:

 
 
  1. [root@wk ~]# netstat -nlp  
  2. udp 0 0 0.0.0.0:67 0.0.0.0:* 5172/dnsmasq  
  3. udp 0 0 0.0.0.0:67 0.0.0.0:* 4745/dhcpd  
  4. udp 0 0 0.0.0.0:69 0.0.0.0:* 6171/xinetd  
  5. udp 0 0 0.0.0.0:994 0.0.0.0:* 4633/rpc.rquotad 

Configure the tftp Server 4. Test the tftp Server

 
 
  1. [root@wk ~]# tftp 192.168.0.110  
  2. tftp>get  
  3. tftp>put  
  4. tftp>q 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.