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]#
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.CentOS blocks inbound UDP tftp requests with
iptables
on ethernet interfaces by default... disabling theiptables
service fixed the problem (this is a lab machine, so disablingiptables
is ok).