Page MenuHomeVyOS Platform

container: podman container static ip broken
Open, NormalPublicBUG

Description

container command relies on docker's --net and --ip.
podman has different syntax [1] for setting static ip in bridged networks.

Error: --ip can only be set when the network mode is bridge: invalid argument

configuring static ip updates vyos-container-{name}.service and reverting the static address (revert, delete container name ... network ... address ...) in the VyOS config doesn't update the service.

[1] https://docs.podman.io/en/latest/markdown/podman-run.1.html#network-mode-net

Details

Version
2025.05.06-0019-rolling
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav triaged this task as Normal priority.Fri, May 9, 10:32 AM
Viacheslav subscribed.

@covalente Add a simple set of commands to reproduce, thanks!

After further debugging, it's the network name that causes the issue with CNI creation (pod-*) and static ip.
Podman overlaps "podman" default network and the user-defined "default" network.
containers get assigned to "podman" default network and CNIs ignored, so causing this primary issue.

Commands to reproduce:

add container image alpine:3.21.3
set container name alpine image 'alpine:3.21.3'
set container name alpine network default
set container network default prefix '10.89.0.0/16'

Despite this, when doing delete container name alpine network default prefix the systemd service isn't templated again causing commit error.

@covalente, should we disable the name default? Or do you have another idea?

@Viacheslav,
default must have the same ipv4 subnet of "podman" default network, if changed, Podman doesn't detect it (via conf-mode commands).

set container network name default prefix 10.89.0.0/24 <-- replaced by podman0 (no cni pod-* interface) = 10.88.0.0/24
set container network name test    prefix 10.88.0.0/24

As VyOS doesn't come with defaults, ideally disabling this network name (along with "podman" default network name) is what needs to be done.
Due to the nature of the service, having it set but disabled and not editable is preferred.