Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run tftpd from xinetd on CentOS 6; however, I can only tftp from localhost.

I have a file in /opt/tftpboot/fw.test.conf that I can retrieve if I tftp to localhost:

[mpenning@localhost ~]$ tftp localhost
tftp> get fw.test.conf
tftp> quit
[mpenning@localhost ~]$ ls
fw.test.conf
[mpenning@localhost ~]$

However, I cannot receive this file if I tftp to eth1 on this server (the address on eth1 is 172.16.1.4).

[mpenning@localhost ~]$ sudo tshark -i eth1 udp and host 172.16.1.5
Running as user "root" and group "root". This could be dangerous.
Capturing on eth1
  0.000000   172.16.1.5 -> 172.16.1.4   TFTP Read Request, File: fw.test.conf\000, Transfer type: netascii\000
  5.000133   172.16.1.5 -> 172.16.1.4   TFTP Read Request, File: fw.test.conf\000, Transfer type: netascii\000
 10.000184   172.16.1.5 -> 172.16.1.4   TFTP Read Request, File: fw.test.conf\000, Transfer type: netascii\000
 15.000297   172.16.1.5 -> 172.16.1.4   TFTP Read Request, File: fw.test.conf\000, Transfer type: netascii\000
 20.000331   172.16.1.5 -> 172.16.1.4   TFTP Read Request, File: fw.test.conf\000, Transfer type: netascii\000
^C5 packets captured
[mpenning@localhost ~]$

I have the following xinetd configuration:

[root@localhost mpenning]# cat /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
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /opt/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
[root@localhost mpenning]#
share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

In a production environment you would want to specifically allow TFTP through the firewall. This can be done by running system-config-firewall-tui, customising the firewall, and selecting the "TFTP" service.

share|improve this answer
    
fortunately, system-config-firewall-tui has a curses UI, so it's useful in text or GUI mode –  Mike Pennington Sep 29 '12 at 21:51
add comment

CentOS blocks inbound UDP tftp requests with iptables on ethernet interfaces by default... disabling the iptables service fixed the problem (this is a lab machine, so disabling iptables is ok).

[root@localhost mpenning]# chkconfig iptables off
[root@localhost mpenning]# /etc/init.d/iptables stop
[root@localhost mpenning]# 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.