podman icon indicating copy to clipboard operation
podman copied to clipboard

ping 8.8.8.8 fails when using bridge network

Open s1n7ax opened this issue 1 year ago • 15 comments

Issue Description

I'm using NixOS to create wireguard client. I'm using lscr.io/linuxserver/wireguard:latest image. I noticed that I can't connect to the wireguard hub correctly at times. Upon running podman exec wireguard ping 8.8.8.8 it pings and getting the response one time and after that it hangs forever.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create a bridge network
podman network create \
  --driver bridge \
  --subnet 10.89.0.0/24 \
  --gateway 10.89.0.1 \
  my-custom-net

podman run -d \
  --name wireguard2 \
  --cap-add NET_ADMIN \
  --cap-add SYS_MODULE \
  --cap-add NET_RAW \
  --network my-custom-net \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
  --restart=unless-stopped \
  lscr.io/linuxserver/wireguard:latest && 

Describe the results you received

podman run -d \
        --name wireguard2 \
        --cap-add NET_ADMIN \
        --cap-add SYS_MODULE \
        --cap-add NET_RAW \
        --network my-custom-net \
        -e PUID=1000 \
        -e PGID=1000 \
        -e TZ=Etc/UTC \
        -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
        --restart=unless-stopped \
        lscr.io/linuxserver/wireguard:latest && 
      podman exec wireguard2 ping 8.8.8.8



9909efac909be9c2084c186ffbbc4c559abae6a9fecf6d458add77d13604cbe7
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=254 time=59.4 ms

After the first response (64 bytes from 8.8.8.8: icmp_seq=1 ttl=254 time=59.4 ms) the command hangs forever.

However, when I switch the network to host, I can ping fine.

podman run -d \
    --name wireguard2 \
    --cap-add NET_ADMIN \
    --cap-add SYS_MODULE \
    --cap-add NET_RAW \
    --network host \
    -e PUID=1000 \
    -e PGID=1000 \
    -e TZ=Etc/UTC \
    -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
    --restart=unless-stopped \
    lscr.io/linuxserver/wireguard:latest && 
podman exec wireguard2 ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=59.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=58.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=54.9 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=44.1 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=116 time=52.8 ms

Describe the results you expected

ping should work fine without any issue

podman info output

host:
  arch: amd64
  buildahVersion: 1.40.1
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: Unknown
    path: /nix/store/lbi1f3j5zccg54580w119qp0508yhpgj-podman-helper-binary-wrapper/bin/conmon
    version: 'conmon version 2.1.13, commit: '
  cpuUtilization:
    idlePercent: 99.31
    systemPercent: 0.27
    userPercent: 0.43
  cpus: 4
  databaseBackend: sqlite
  distribution:
    codename: xantusia
    distribution: nixos
    version: "25.11"
  eventLogger: journald
  freeLocks: 2046
  hostname: s1n7ax
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 992
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.12.33
  linkmode: dynamic
  logDriver: journald
  memFree: 14696976384
  memTotal: 16536002560
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: Unknown
      path: /nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/libexec/podman/aardvark-dns
      version: aardvark-dns 1.15.0
    package: Unknown
    path: /nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/libexec/podman/netavark
    version: netavark 1.15.2
  ociRuntime:
    name: crun
    package: Unknown
    path: /nix/store/lbi1f3j5zccg54580w119qp0508yhpgj-podman-helper-binary-wrapper/bin/crun
    version: |-
      crun version 1.21
      commit: 1.21
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  pasta:
    executable: /nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/libexec/podman/pasta
    package: Unknown
    version: ""
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: ""
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 18191855616
  swapTotal: 18191855616
  uptime: 1h 7m 37.00s (Approximately 0.04 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /home/s1n7ax/.config/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 2
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/s1n7ax/.local/share/containers/storage
  graphRootAllocated: 226557915136
  graphRootUsed: 137641480192
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 48
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/s1n7ax/.local/share/containers/storage/volumes
version:
  APIVersion: 5.5.1
  Built: 315532800
  BuiltTime: Tue Jan  1 05:30:00 1980
  GitCommit: ""
  GoVersion: go1.24.3
  Os: linux
  OsArch: linux/amd64
  Version: 5.5.1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

ping does not work after restart consistently. However, I also used home-manager options to create the container as well. It uses podman quadlet in the background and when systemd service is restarted it sometimes ping works. I already have created an issue in linuxserver repository but by the look of it, this is not an issue in the image. https://github.com/linuxserver/docker-wireguard/issues/388

[
     {
          "name": "my-custom-net",
          "id": "9b1141ee19705f61073ffc7f61e151ccb065302d12b268d67338927b58559331",
          "driver": "bridge",
          "network_interface": "podman1",
          "created": "2025-06-16T04:05:34.867122954+05:30",
          "subnets": [
               {
                    "subnet": "10.89.0.0/24",
                    "gateway": "10.89.0.1"
               }
          ],
          "ipv6_enabled": false,
          "internal": false,
          "dns_enabled": true,
          "ipam_options": {
               "driver": "host-local"
          },
          "containers": {
               "82d5ff315aa9f48ccb7069a5e9889d32546de3eb835e7d22c0c20f563d3d9864": {
                    "name": "wireguard2",
                    "interfaces": {
                         "eth0": {
                              "subnets": [
                                   {
                                        "ipnet": "10.89.0.5/24",
                                        "gateway": "10.89.0.1"
                                   }
                              ],
                              "mac_address": "f6:4e:1a:2d:1b:3e"
                         }
                    }
               }
          }
     }
]

s1n7ax avatar Jun 15 '25 23:06 s1n7ax

Does it work with --network pasta? How does the wireguard config look like? Can you trace the packages with something like tcpdump and see where they get dropped, something likepodman unshare --rootless-netns tcpdump -nn -i any might be useful.

Luap99 avatar Jun 16 '25 09:06 Luap99

  1. Adding --network pasta hangs similar to any other custom bridge network.

  2. My wireguard config is this (I'm using home-manager to create the files with secrets safely). But for this I created a conf file by replacing all the placeholders with actual data.

  sops.templates."wg0.conf" = {
    content = ''
      [Interface]
      Address = 10.0.0.2/32
      PrivateKey = ${private_key}
      ListenPort = 51820
      DNS = 10.0.0.1
  
      [Peer]
      PublicKey = hOe6V7o6CThIGDjqsAppjH54xT/koxUDPTi+5NC89E4=
      PresharedKey = ${preshared_key}
      Endpoint = ${ip}:${port}
      AllowedIPs = 0.0.0.0/0
      PersistentKeepalive = 25
    '';
  }
  1. I don't really understand networking but I guess I'm supposed to run podman unshare --rootless-netns tcpdump -nn -i any and run the previous command to ping 8.8.8.8 in the podman container?

Terminal 1: No tcp packets sent

podman unshare --rootless-netns tcpdump -nn -i any
tcpdump: WARNING: any: That device doesn't support promiscuous mode
(Promiscuous mode not supported on the "any" device)
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes

Terminal 2: As usual this hangs

podman run -d \
            --name wireguard2 \
            --cap-add NET_ADMIN \
            --cap-add SYS_MODULE \
            --cap-add NET_RAW \
            --network pasta \
            -e PUID=1000 \
            -e PGID=1000 \
            -e TZ=Etc/UTC \
            -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
            --restart=unless-stopped \
            lscr.io/linuxserver/wireguard:latest && 
      podman exec wireguard2 ping 8.8.8.8

6f58180d4f5704e9e133a466b21b8d4cc72c36d464c0969e8e5b45dc0b21d018
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

Even if I do --network host and ping works, tcpdump prints nothing. May be it's unrelated because it's running as host?

s1n7ax avatar Jun 17 '25 07:06 s1n7ax

podman unshare --rootless-netns tcpdump -nn -i any only runs inside the rootless netns which is only used when using a custom network like in your original report. Then it should definitely show packages.

Also note SYS_MODULE cannot do anything as rootless as loading kernel modules is obviously a privileged operation, so the wireguard kernel module must already be loaded on the host.

Does it work with --network slirp4netns, if it does it is likely a pasta issue. For pasta you could run with --network pasta:--pcap,/tmp/packets.pcap to create a pcap file which show the packages going through pasta and that might be good enough for the pasta maitnainers to figure out what is going wrong.

Also what is the Endpoint ip here? An actual remote host and not the the container host? BEcause the host ip will not be reachable by default from within the container see https://blog.podman.io/2024/10/podman-5-3-changes-for-improved-networking-experience-with-pasta/

Luap99 avatar Jun 17 '25 09:06 Luap99

  1. Noted! I loaded the wireguard kernel module in host.
❯ lsmod | rg wireguard
wireguard             122880  0
curve25519_x86_64      36864  1 wireguard
libchacha20poly1305    20480  1 wireguard
libcurve25519_generic    45056  2 curve25519_x86_64,wireguard
ip6_udp_tunnel         16384  1 wireguard
udp_tunnel             36864  1 wireguard

Then I installed slirp4netns and ran,

podman stop wireguard2 &&
podman rm wireguard2 &&
podman run -d \
  --name wireguard2 \
  --cap-add NET_ADMIN \
  --cap-add NET_RAW \
  --network slirp4netns \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
  --restart=unless-stopped \
  lscr.io/linuxserver/wireguard:latest && 
podman exec wireguard2 ping 8.8.8.8

wireguard2
wireguard2
6f9adcc8e34a5f0c724af18e798669f3b46ca97ce2a3e8d18e49a8b89e892ad0
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=255 time=118 ms

This still hangs.


Following is the result with pasta with data dump

❯ podman stop wireguard2 &&
podman rm wireguard2 &&
podman run -d \
  --name wireguard2 \
  --cap-add NET_ADMIN \
  --cap-add NET_RAW \
  --network pasta:--pcap,/tmp/packets.pcap \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -v ./wg0.conf:/config/wg_confs/wg0.conf:Z \
  --restart=unless-stopped \
  lscr.io/linuxserver/wireguard:latest && 
podman exec wireguard2 ping 8.8.8.8

wireguard2
wireguard2
c43f795819c52207d3f662a97ad7479fd6b9731133994453d5a2a51893e87695
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=255 time=84.5 ms
❯ tcpdump -nn -r /tmp/packets.pcap
reading from file /tmp/packets.pcap, link-type EN10MB (Ethernet), snapshot length 65535
17:04:33.082385 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16
17:04:33.082406 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 3 group record(s), length 68
17:04:33.291333 ARP, Request who-has 192.168.1.1 tell 192.168.1.110, length 28
17:04:33.291375 ARP, Reply 192.168.1.1 is-at 9a:55:9a:55:9a:55, length 28
17:04:33.291445 IP 192.168.1.110 > 8.8.8.8: ICMP echo request, id 38, seq 1, length 64
17:04:33.336512 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 3 group record(s), length 68
17:04:33.375754 IP 8.8.8.8 > 192.168.1.110: ICMP echo reply, id 38, seq 1, length 64
17:04:33.417456 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 3 group record(s), length 68
17:04:33.621830 IP 192.168.1.110.51820 > 64.225.84.64.51820: UDP, length 148
17:04:33.673453 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 4 group record(s), length 88
17:04:33.673470 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16
17:04:33.676503 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28
17:04:33.960801 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 4 group record(s), length 88
17:04:33.992850 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28
17:04:37.384699 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16
17:04:44.744564 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16
17:04:59.592504 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16
17:05:29.800666 IP6 fe80::7440:d4ff:fe48:3900 > ff02::2: ICMP6, router solicitation, length 16

s1n7ax avatar Jun 17 '25 11:06 s1n7ax

@sbrivio-rh PTAL, are you aware of any udp/wireguard problems in pasta?

Luap99 avatar Jun 17 '25 11:06 Luap99

@sbrivio-rh PTAL, are you aware of any udp/wireguard problems in pasta?

No, not really, I'm aware of a number of users but no known issue like this one. I still have to look into it.

sbrivio-rh avatar Jun 17 '25 12:06 sbrivio-rh

17:04:33.291445 IP 192.168.1.110 > 8.8.8.8: ICMP echo request, id 38, seq 1, length 64
17:04:33.336512 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 3 group record(s), length 68
17:04:33.375754 IP 8.8.8.8 > 192.168.1.110: ICMP echo reply, id 38, seq 1, length 64
17:04:33.417456 IP6 fe80::7440:d4ff:fe48:3900 > ff02::16: HBH ICMP6, multicast listener report v2, 3 group record(s), length 68
17:04:33.621830 IP 192.168.1.110.51820 > 64.225.84.64.51820: UDP, length 148

AFAIK the reason the first ping appears to work is because most likely the wireguard tunnel wasn't setup and it just directly talks to 8.8.8.8 which should not be the case on a working wg0 (assuming you setup the routing right). My guess is that is because you run with -d and didn't wait for the container process to fully configure the interface/routing. Afterwards it seems to send a udp package to the vpm endpoint but there is never any reply logged. So I would guess the wg handshake fails for some reason.

Luap99 avatar Jun 17 '25 13:06 Luap99

At this point I have no freaking clue what works and what does not. When it works every combination works when it does not nothing works and it's totally random.

This is me using the same configuration but restarting the wireguard service. I have 50 seconds before pinging the host 10.0.0.1. One time it works, then it does not. Host is working consistently and I've been using the same host for more than a year on Ubuntu-rockchip with Docker. Never had any issues.

https://github.com/user-attachments/assets/6a441a9d-32d3-45ea-a1f3-4a74c8194552

I feel like this occurs when I add a network to the container. Following is the generated systemd service file.

cat --plain --pager=none ~/.config/systemd/user/podman-wireguard.service

# Automatically generated by /nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/lib/systemd/user-generators/podman-user-generator
# 
# Automatically generated by home-manager podman container configuration
# DO NOT EDIT THIS FILE DIRECTLY
#
# wireguard.container
[X-Container]
AddCapability=NET_ADMIN
AddCapability=NET_RAW
ContainerName=wireguard
Environment=PGID=1000
Environment=PUID=1000
Environment=TZ=Etc/UTC
Image=lscr.io/linuxserver/wireguard:latest
Label=nix.home-manager.managed=true
Network=wireguard-network
PodmanArgs=--sysctl=net.ipv4.conf.all.src_valid_mark=1
PublishPort=51820:51820/udp
Volume=/home/s1n7ax/.config/sops-nix/secrets/rendered/wg0.conf:/config/wg_confs/wg0.conf

[Install]
WantedBy=default.target
WantedBy=multi-user.target

[Service]
Environment=PATH=/run/wrappers/bin:/run/current-system/sw/bin:/home/s1n7ax/.nix-profile/bin:/nix/store/if9z6wmzmb07j63c02mvfkhn1mw1w5p4-systemd-257.5/bin
Restart=always
TimeoutStopSec=30
Environment=PODMAN_SYSTEMD_UNIT=%n
KillMode=mixed
ExecStop=/nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/bin/podman rm -v -f -i --cidfile=%t/%N.cid
Delegate=yes
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
ExecStart=/nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/bin/podman run --name wireguard --cidfile=%t/%N.cid --replace --rm --cgroups=split --network wireguard-network --sdnotify=conmon -d --cap-add net_admin --cap-add net_raw -v /home/s1n7ax/.config/sops-nix/secrets/rendered/wg0.conf:/config/wg_confs/wg0.conf --publish 51820:51820/udp --env PGID=1000 --env PUID=1000 --env TZ=Etc/UTC --label nix.home-manager.managed=true --sysctl=net.ipv4.conf.all.src_valid_mark=1 lscr.io/linuxserver/wireguard:latest

[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
Description=Service for container wireguard
SourcePath=/nix/store/akmj92p9jvhvf447srcz14hxh60r2xav-home-container-podman-wireguard/quadlets/podman-wireguard.container
RequiresMountsFor=%t/containers
RequiresMountsFor=/home/s1n7ax/.config/sops-nix/secrets/rendered/wg0.conf

cat --plain --pager=none ~/.config/systemd/user/podman-wireguard-network-network.service

# Automatically generated by /nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/lib/systemd/user-generators/podman-user-generator
# 
# Automatically generated by home-manager for podman network configuration
# DO NOT EDIT THIS FILE DIRECTLY
#
# wireguard-network.network
[Install]
WantedBy=default.target
WantedBy=multi-user.target

[X-Network]
Driver=bridge
Label=nix.home-manager.managed=true
NetworkName=wireguard-network

[Service]
Environment=PATH=/run/wrappers/bin:/usr/bin:/bin:/usr/sbin:/sbin:/nix/store/4hjw4c56ml09jbac2mzz38qc958d3fb2-shadow-4.17.4-su/bin:/nix/store/87fck6hm17chxjq7badb11mq036zbyv9-coreutils-9.7/bin
ExecStartPre=/nix/store/yqwlx04agzkszbikl31jsc51il9m05nv-await-podman-unshare
RemainAfterExit=yes
TimeoutStartSec=15
ExecStart=/nix/store/qx3km84lrvcb5ln0cw7bj37vyvvnyaa3-podman-5.5.1/bin/podman network create --ignore --driver bridge --label nix.home-manager.managed=true wireguard-network
SyslogIdentifier=%N
Type=oneshot

[Unit]
Wants=podman-user-wait-network-online.service
After=podman-user-wait-network-online.service
After=network.target
Description=Service for network wireguard-network
SourcePath=/nix/store/vfli3dagf9v947gyjz3d1wcc1idgjh7b-home-network-podman-wireguard-network/quadlets/podman-wireguard-network.network
RequiresMountsFor=%t/containers

s1n7ax avatar Jun 19 '25 16:06 s1n7ax

Since home-manager do not allow rootful, I installed quadlet-nix and used the same configuration in rootless mode and rootful mode (two different ports). Rootful container can hit 10.0.0.1 consistently while rootless has the same issue.

Rootful:

❯ sudo podman exec -it wireguard ping -c 5 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=375 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=395 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=273 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=147 ms
64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=419 ms

--- 10.0.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 146.724/321.840/419.327/100.648 ms

Rootless:

❯ podman exec -it wireguard ping -c 5 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.

--- 10.0.0.1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4093ms

s1n7ax avatar Jun 19 '25 19:06 s1n7ax

In pasta's packet capture, you have:

17:04:33.621830 IP 192.168.1.110.51820 > 64.225.84.64.51820: UDP, length 148

which is probably the first packet of the WireGuard handshake, but no reply is ever seen. I wonder if that packet gets out of the host at all. Could you take captures on the host (you can select just UDP on port 51820) at the same time, with the custom bridged network first, and with --network=host later, and compare them?

Is that packet going out? Does it get a reply?

sbrivio-rh avatar Jun 20 '25 10:06 sbrivio-rh

I'm kinda hitting the same issue and I'm not even sure when this started. See Container can't connect to VPN if I don't use Network=pasta:[OPTIONS] #26499.

I tried podman system reset and the container starts just fine. After a while it restarts on his own and VPN connection via WireGuard does not work anymore.

As mentioned in the thread I opened, it seems container runs fine if I pass the settings to pasta so that it emulates slirp4netns (Network=pasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,-m,1500,--no-ndp,--no-dhcpv6,--no-dhcp). However, the VPN connection does not longer work if I join a custom podman network.

I've been using podman with pasta for quite some time now and has been working fine. This started recently.

@sbrivio-rh have you found anything?

dozenposture avatar Jun 24 '25 19:06 dozenposture

As a workaround, I've been using rootful wireguard and used host.containers.internal to reverse proxy to rootless containers. It's been working good so far.

s1n7ax avatar Jun 26 '25 08:06 s1n7ax

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Jul 27 '25 00:07 github-actions[bot]

@s1n7ax Could you describe your host.containers.internal setup a little more? I'm interested in the routing for this kind of handover.

almereyda avatar Sep 14 '25 20:09 almereyda

As mentioned in the thread I opened, it seems container runs fine if I pass the settings to pasta so that it emulates slirp4netns (Network=pasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,-m,1500,--no-ndp,--no-dhcpv6,--no-dhcp). However, the VPN connection does not longer work if I join a custom podman network.

I've been using podman with pasta for quite some time now and has been working fine. This started recently.

@sbrivio-rh have you found anything?

No, I'm still waiting for answers to my questions (on the original setup or on a similar one):

I wonder if that packet gets out of the host at all. Could you take captures on the host (you can select just UDP on port 51820) at the same time, with the custom bridged network first, and with --network=host later, and compare them?

Is that packet going out? Does it get a reply?

@almereyda,

@s1n7ax Could you describe your host.containers.internal setup a little more? I'm interested in the routing for this kind of handover.

If you are hitting the same issue, I'd be grateful if you could try out what I suggested earlier on. I can't reproduce the issue and I would need some help with debugging / concretely defining the issue.

sbrivio-rh avatar Sep 14 '25 21:09 sbrivio-rh