Possible workaround for container not having outbound connectivity on Debian 13
My rootless containers were losing outbound connectivity after reboots. Restarting the containers or the services did not solve the issue. It seems the issue is unique to older Podman or Passta version in Debian/Ubuntu, I found workarounds in the repo and just thought I'd keep a record.
As I understand it, the issue stem from a race condition. Pasta and the containers are started before proper routes on host. The workaround is to ensure IPV4 connectivity in the wait-online service. My implementation is based on those mentioned on Github:
On Debian, the wait service is located under /usr/lib/systemd/user/podman-user-wait-network-online.service, but we can set overrides to it
mkdir .config/systemd/user/podman-user-wait-network-online.service.d
touch .config/systemd/user/podman-user-wait-network-online.service.d/override.conf
Put something like this in there:
[Service]
TimeoutStartSec=180s
ExecStart=
ExecStart=/bin/sh -c 'until systemctl is-active --quiet network-online.target && /usr/bin/curl -4 --fail --silent --output /dev/null --connect-timeout 3 --max-time 5 https://www.google.com/generate_204; do sleep 0.5; done'
Reload and restart
systemctl --user daemon-reload
systemctl --user start podman-user-wait-network-online.service
https://github.com/podman-container-tools/podman/issues/25656#issuecomment-2802298212
https://github.com/podman-container-tools/podman/issues/25656
https://github.com/podman-container-tools/podman/issues/25859