1

Im trying to set up a TFTP server in docker as a first step of setting up PXE booting, but I can't connect to it.

I start the container using the command docker run --name tftp -p 0.0.0.0:69:69/udp -v /var/tftpboot/:/var/tftpboot -d local-tftp.

From inside the container I can run curl -o ./foo tftp://0.0.0.0/foo and it works, from outside the container I run the same command (with the proper ip) from the docker host or a different computer on the network, both don't work.

I tried disabling the firewall on the host, but that doesn't help either, do its not a firewall issue.

Any help, or an alternative solution to set this up, is appreciated.

ThaChillera
  • 35
  • 1
  • 7

3 Answers3

3

TFTP uses por 69 when negotiating a transfer but the actual data transfer occurs on a ephemeral port; try with

docker run --name tftp -p 69:69/udp -p 65500-65515:65500-65515/udp v /var/tftpboot/:/var/tftpboot -d local-tftp

or something like this considering the ephemeral ports used by your TFTP server.

Pat
  • 3,519
  • 2
  • 17
  • 17
  • It turned out to be my own fault, but thanks so much for the advice, it was the step in the right direction I needed! – ThaChillera Jun 10 '20 at 21:21
1

I stumbled on this question when debugging a similar problem. The solution for me was to add the --network=host option to the docker run command.

david
  • 11
  • 2
0

It turned out to be my client's firewall blocking the existing connection. Disabling it (or allowing an existing connection) solved this.

ThaChillera
  • 35
  • 1
  • 7