joe liu
joe liu

Reputation: 1

TFTP Request Failing on Host Machine Despite Working in Container

I expect the host machine to receive TFTP requests. When testing with tftpboot and busybox_tftp_client, I can successfully download the file using: tftp -g -l /tmp/testfile -r testfile tftpbootHowever, it fails when running on the host machine. Below is the docker-compose configuration:

services:
  tftpboot:
    container_name: tftpboot
    image: pghalliday/tftp:latest
    volumes:
      - ~/Documents/dev/tftp:/var/tftpboot
    command: /var/tftpboot
    tty: true
    ports:
      - "69:69/udp"
    networks:
      - mytftp
  busybox_tftp_client:
    container_name: busybox_tftp_client
    image: busybox:1.33.1-uclibc
    # command: tftp -g -l /tmp/testfile -r testfile tftpboot
    tty: true
    volumes:
      - ~/Documents/dev/tftp_client:/tmp
    networks:
      - mytftp
networks:
  mytftp:
    driver: bridge

I have already disabled the Windows firewall on the host machine. Below is the packet capture from tftpboot when the host machine receives a TFTP request:

 # tcpdump -vv
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:01:04.892316 IP (tos 0x0, ttl 64, id 43302, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.37680 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xc5a7!]  20 RRQ "testfile" netascii
09:01:04.892357 IP (tos 0xc0, ttl 64, id 55622, offset 0, flags [none], proto ICMP (1), length 76)
    77e71dbd5167 > 172.22.0.1: ICMP 77e71dbd5167 udp port 69 unreachable, length 56
        IP (tos 0x0, ttl 64, id 43302, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.37680 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xc5a7!]  20 RRQ "testfile" netascii
09:01:04.892811 IP (tos 0x0, ttl 64, id 55719, offset 0, flags [DF], proto UDP (17), length 69)
    77e71dbd5167.60685 > 192.168.65.7.53: [bad udp cksum 0xae0a -> 0x9c77!] 57639+ PTR? 1.0.22.172.in-addr.arpa. (41)
09:01:04.900630 IP (tos 0x0, ttl 63, id 1178, offset 0, flags [DF], proto UDP (17), length 69)
    192.168.65.7.53 > 77e71dbd5167.60685: [bad udp cksum 0xae0a -> 0x1bf4!] 57639 NXDomain q: PTR? 1.0.22.172.in-addr.arpa. 0/0/0 (41)
09:01:04.901230 IP (tos 0x0, ttl 64, id 4839, offset 0, flags [DF], proto UDP (17), length 71)
    77e71dbd5167.59054 > 192.168.65.7.53: [bad udp cksum 0xae0c -> 0xd09d!] 18503+ PTR? 7.65.168.192.in-addr.arpa. (43)
09:01:04.906643 IP (tos 0x0, ttl 63, id 1179, offset 0, flags [DF], proto UDP (17), length 71)
    192.168.65.7.53 > 77e71dbd5167.59054: [bad udp cksum 0xae0c -> 0x501a!] 18503 NXDomain q: PTR? 7.65.168.192.in-addr.arpa. 0/0/0 (43)
09:01:05.890694 IP (tos 0x0, ttl 64, id 49861, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.45057 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xa8d6!]  20 RRQ "testfile" netascii
09:01:05.890735 IP (tos 0xc0, ttl 64, id 55649, offset 0, flags [none], proto ICMP (1), length 76)
    77e71dbd5167 > 172.22.0.1: ICMP 77e71dbd5167 udp port 69 unreachable, length 56
        IP (tos 0x0, ttl 64, id 49861, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.45057 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xa8d6!]  20 RRQ "testfile" netascii
09:01:07.895175 IP (tos 0x0, ttl 64, id 38962, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.35623 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xcdb0!]  20 RRQ "testfile" netascii
09:01:07.895214 IP (tos 0xc0, ttl 64, id 55726, offset 0, flags [none], proto ICMP (1), length 76)
    77e71dbd5167 > 172.22.0.1: ICMP 77e71dbd5167 udp port 69 unreachable, length 56
        IP (tos 0x0, ttl 64, id 38962, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.35623 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0xcdb0!]  20 RRQ "testfile" netascii
09:01:09.954317 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 172.22.0.1 tell 77e71dbd5167, length 28
09:01:09.954348 ARP, Ethernet (len 6), IPv4 (len 4), Reply 172.22.0.1 is-at 02:42:1b:60:5d:3d (oui Unknown), length 28
09:01:11.902952 IP (tos 0x0, ttl 64, id 21821, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.47451 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0x9f7c!]  20 RRQ "testfile" netascii
09:01:11.902994 IP (tos 0xc0, ttl 64, id 55744, offset 0, flags [none], proto ICMP (1), length 76)
    77e71dbd5167 > 172.22.0.1: ICMP 77e71dbd5167 udp port 69 unreachable, length 56
        IP (tos 0x0, ttl 64, id 21821, offset 0, flags [DF], proto UDP (17), length 48)
    172.22.0.1.47451 > 77e71dbd5167.69: [bad udp cksum 0x585d -> 0x9f7c!]  20 RRQ "testfile" netascii

I expect the host machine to receive TFTP requests. When testing with tftpboot and busybox_tftp_client, I can successfully download the file using: tftp -g -l /tmp/testfile -r testfile tftpbootHowever, it fails when running on the host machine.

Upvotes: 0

Views: 18

Answers (0)

Related Questions