How can I make my tftp server visible/available on my local network?
Since you have only INPUT
rules, which means you only accept incoming traffic from port 69 but you have traffic going out aswell, that means you need to ACCEPT
outgoing traffic aswell.
sudo iptables -A OUTPUT -p tcp --dport 69 -j ACCEPT
sudo iptables -A OUTPUT -p udp --dport 69 -j ACCEPT
Related videos on Youtube
Alex Meuer
Updated on September 18, 2022Comments
-
Alex Meuer over 1 year
I have looked at the following questions without success:
- How to install and configure a tftp server on 14 04
- How to setup a tftp server in ubuntu 14 04
- How to install and setup tftp server in ubuntu 14 10 utopic
- How do i install and run a tftp server
I've tried using tftp-hpa, atftpd and tftp. I've returned to tftp as using the others made no difference.
So far I have:
Installed tftp
sudo apt-get install xinetd tftpd tftp
Set up /etc/xinetd.d/tftp
service tftp { protocol = udp port = 69 socket_type = dgram wait = yes user = nobody server = /usr/sbin/in.tftpd server_args = /tftpboot disable = no }
Created the /tftpboot folder and ran the following for it:
sudo chmod -R 777 /tftpboot sudo chown -R nobody /tftpboot
I have allowed port 69 through iptables:
sudo iptables -A INPUT -p tcp --dport 69 -j ACCEPT sudo iptables -A INPUT -p udp --dport 69 -j ACCEPT sudo iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:tftp ACCEPT udp -- anywhere anywhere udp dpt:tftp
and restarted the service:
sudo /etc/init.d/xinetd restart
I can connect fine using localhost (same result if I explicitly use 127.0.0.1):
tftp localhost tftp> status Connected to localhost. Mode: netascii Verbose: off Tracing: off Rexmt-interval: 5 seconds, Max-timeout: 25 seconds tftp> get test Received 21 bytes in 0.0 seconds tftp> quit
However, none of my colleagues can access it from their machines (same network, same subnet mask) and, most importantly, I can't access it from the embedded board that I need it for (ethernet cables plugged into same switch). I've been googling for hours and haven't found a fix yet.
The fact that it works locally would suggest its a firewall/port problem but port 69 is allowed on iptables and I'm not sure what else I an do.
-
Gen almost 8 yearsCan you try telnet from your colleague for port 69 to your machine? If it does/doesn't work, let me know.
-
Alex Meuer almost 8 yearsI'm using
tftp 10.42.143.17
from another pc, andload -b tftp://10.42.243.17/zbimage-linux-xload
from the embedded system. According to other questions and tutorials udp port 69 is the default for tftp. -
Alex Meuer almost 8 years@Gen Telnet on port 69 fails.
-
Gen almost 8 years@AlexMeuer this means problem is at firewall inside your server or router. To be sure make same iptables rules for output, just change
INPUT
toOUTPUT
and let me know if problem still exist. -
Alex Meuer almost 8 years@Gen Adding the OUTPUT rules fixed my problem. Thank you so much!
-
SPRBRN almost 8 yearsWith problems like these, disable the firewall, then test again.