[BUG]tftp not works with ipv6 only ipv4 with bridge mode

docker run -d \
  --name tftp_server1 \
  --restart unless-stopped \
  -p 69:69/udp \
  -v ${PWD}/dhv/tftp:/data \
  --network=my-ipv6-networktesttftp \
  mcchae/tftp-server   in.tftpd -L -vvv -u root --secure --create -a 0.0.0.0:69 -a [::]:69 /data
oot@mohamed:/home/roote/docker-tftp-server# docker inspect 4fdec26bdd5a
[
    {
        "Id": "4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d",
        "Created": "2024-02-14T08:31:52.521885623Z",
        "Path": "in.tftpd",
        "Args": [
            "-L",
            "-vvv",
            "-u",
            "root",
            "--secure",
            "--create",
            "-a",
            "0.0.0.0:69",
            "-a",
            "[::]:69",
            "/data"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 189481,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2024-02-14T08:31:53.379596385Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:8d5994eaf723e7b52e8df205f7e07c87586a2c623415b02fef5554d41949a22d",
        "ResolvConfPath": "/var/snap/docker/common/var-lib-docker/containers/4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d/resolv.conf",
        "HostnamePath": "/var/snap/docker/common/var-lib-docker/containers/4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d/hostname",
        "HostsPath": "/var/snap/docker/common/var-lib-docker/containers/4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d/hosts",
        "LogPath": "/var/snap/docker/common/var-lib-docker/containers/4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d/4fdec26bdd5ac367cca9db2c723ee1cee03bd0ecbd4b6a90c150b340548a841d-json.log",
        "Name": "/tftp_server1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/home/roote/docker-tftp-server/dhv/tftp:/data"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "my-ipv6-networktesttftp",
            "PortBindings": {
                "69/udp": [
                    {
                        "HostIp": "",
                        "HostPort": "69"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "unless-stopped",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "ConsoleSize": [
                47,
                181
            ],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": [],
            "BlkioDeviceWriteBps": [],
            "BlkioDeviceReadIOps": [],
            "BlkioDeviceWriteIOps": [],
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/snap/docker/common/var-lib-docker/overlay2/2fffebb95e1a191f9e38a89c1f019f10dafb5f4473aed6c238a2885ae1983d1a-init/diff:/var/snap/docker/common/var-lib-docker/overlay2/cfa4e80486591c668023cc379f9cf35571ae5fffb230ba4a711363feff063004/diff:/var/snap/docker/common/var-lib-docker/overlay2/1ab19feebb31692bc2e697b99b014182f18f0be3e41b105e5ec261291bb40eca/diff",
                "MergedDir": "/var/snap/docker/common/var-lib-docker/overlay2/2fffebb95e1a191f9e38a89c1f019f10dafb5f4473aed6c238a2885ae1983d1a/merged",
                "UpperDir": "/var/snap/docker/common/var-lib-docker/overlay2/2fffebb95e1a191f9e38a89c1f019f10dafb5f4473aed6c238a2885ae1983d1a/diff",
                "WorkDir": "/var/snap/docker/common/var-lib-docker/overlay2/2fffebb95e1a191f9e38a89c1f019f10dafb5f4473aed6c238a2885ae1983d1a/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/roote/docker-tftp-server/dhv/tftp",
                "Destination": "/data",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "4fdec26bdd5a",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "69/udp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "in.tftpd",
                "-L",
                "-vvv",
                "-u",
                "root",
                "--secure",
                "--create",
                "-a",
                "0.0.0.0:69",
                "-a",
                "[::]:69",
                "/data"
            ],
            "Image": "mcchae/tftp-server",
            "Volumes": {
                "/data": {}
            },
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "1aff0bbf380c1645348da962f5c028d389198f59ea344d58591da1680124e96c",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "69/udp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "69"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "69"
                    }
                ]
            },
            "SandboxKey": "/run/snap.docker/netns/1aff0bbf380c",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "my-ipv6-networktesttftp": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "4fdec26bdd5a"
                    ],
                    "NetworkID": "63411640649c06ce8632847a23f5775a3d55525d093a3a3ee601540a0a61c97d",
                    "EndpointID": "693adab5dffd584dada77f528219f02dff8dc0ab337613c449edd08bc110aef9",
                    "Gateway": "192.168.176.1",
                    "IPAddress": "192.168.176.2",
                    "IPPrefixLen": 20,
                    "IPv6Gateway": "fd00:cafe:face:feea::1",
                    "GlobalIPv6Address": "fd00:cafe:face:feea::2",
                    "GlobalIPv6PrefixLen": 64,
                    "MacAddress": "02:42:c0:a8:b0:02",
                    "DriverOpts": null
                }
            }
        }
    }
]```
Reproduce

```docker run -d \
  --name tftp_server1 \
  --restart unless-stopped \
  -p 69:69/udp \
  -v ${PWD}/dhv/tftp:/data \
  --network=my-ipv6-networktesttftp \
  mcchae/tftp-server   in.tftpd -L -vvv -u root --secure --create -a 0.0.0.0:69 -a [::]:69 /data
after make this configuration i see my server only send and recieve on ipv4 address not ipv6 in bridge mode changing the network to host work with ipv6/ipv4 any possible bugs ?

tcpdump port 69 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 08:38:48.632633 IP 192.168.1.12.43681 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 08:38:55.963123 IP6 mohamed.local.52760 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 08:39:01.967434 IP6 mohamed.local.52760 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 08:39:07.972401 IP6 mohamed.local.52760 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 08:39:13.975605 IP6 mohamed.local.52760 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 08:39:19.980811 IP6 mohamed.local.52760 > 4fdec26bdd5a.69:  49 RRQ
 "hello.txt" octet tsize 0 blksize 1468 timeout 5 

Expected behavior
tftp should respond to ipv6 and ipv4 packets in bridge mode

docker version
Client: Docker Engine - Community
 Cloud integration: v1.0.28
 Version:           24.0.0
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        98fdcd7
 Built:             Mon May 15 18:49:22 2023
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          24.0.5
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.8
  Git commit:       a61e2b4
  Built:            Sat Oct  7 00:14:30 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0   ```
docker info
Client: Docker Engine - Community
 Version:    24.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.7.0
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.8
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.17.0
    Path:     /usr/lib/docker/cli-plugins/docker-scan

Server:
 Containers: 17
  Running: 3
  Paused: 0
  Stopped: 14
 Images: 30
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: 
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.0-17-generic
 Operating System: Ubuntu Core 22
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.78GiB
 Name: mohamed.com
 ID: 66227d64-325b-4678-8246-ef2d65e4e81e
 Docker Root Dir: /var/snap/docker/common/var-lib-docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.

Example code block:

```
echo "I am a code."
echo "An athletic one, and I wanna run."
```

hello @rimelek done
thnks

Try forwarding IPv6 IPs as well. The same way as you defined IPv4 and IPv6 for tftp inside the container.

-p [::]:69:69/udp

But according to the documentation, it would not be necessary:

Quote:

 docker run --rm -p 80:80 traefik/whoami

This publishes port 80 on both IPv6 and IPv4.

How do you know if the application supports IPv6 by itself, there is already another issue, and the repository is not maintained for 5 years. Is this really a Docker issue?

1 Like

hello @bluepuma77 yes it supported i try with the host mode its working the issue with bridging network and for the isssue me who was create it already to docker engine but no response until now