Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman network does not match atr create command #25358

Closed
moutasem1989 opened this issue Feb 19, 2025 · 4 comments
Closed

Podman network does not match atr create command #25358

moutasem1989 opened this issue Feb 19, 2025 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. network Networking related issue or feature

Comments

@moutasem1989
Copy link

Issue Description

On a fresh install on Ubuntu Server, I am trying to create a dual stack networks with IPv4 and IPv6 subnets predefined. Creating the network always successful but when inspecting the created network, the subnet does not match the one defined in the create command.

Steps to reproduce the issue

Steps to reproduce the issue

  1. create a network as defined in the documentations.
    Running this create command creats a network with only IPv6 subnet / no IPv4 subnet:
    podman network create --subnet 172.26.0.0/16 --gateway 172.26.0.1 --subnet 2001:db8:26::/64 --gateway 2001:db8:26::1 db-network
    Inspecting the network gives:
{
   "cniVersion": "0.4.0",
   "name": "db-network",
   "plugins": [
      {
         "type": "bridge",
         "bridge": "cni-podman1",
         "isGateway": true,
         "ipMasq": true,
         "hairpinMode": true,
         "ipam": {
            "type": "host-local",
            "routes": [
               {
                  "dst": "::/0"
               }
            ],
            "ranges": [
               [
                  {
                     "subnet": "2001:db8:26::/64",
                     "gateway": "2001:db8:26::1"
                  }
               ]
            ]
         }
      },
      {
         "type": "portmap",
         "capabilities": {
            "portMappings": true
         }
      },
      {
         "type": "firewall",
         "backend": ""
      },
      {
         "type": "tuning"
      },
      {
         "type": "dnsname",
         "domainName": "dns.podman",
         "capabilities": {
            "aliases": true
         }
      }
   ]
}

Running this create command creats a network with both IPv4 and IPv6 subnets. IPv4 subnet does not match the one in command:
podman network create --subnet 172.26.0.0/16 --gateway 172.26.0.1 --subnet 2001:db8:26::/64 --gateway 2001:db8:26::1 --ipv6 db-network
Inspecting the network gives:

{
   "cniVersion": "0.4.0",
   "name": "db-network",
   "plugins": [
      {
         "type": "bridge",
         "bridge": "cni-podman1",
         "isGateway": true,
         "ipMasq": true,
         "hairpinMode": true,
         "ipam": {
            "type": "host-local",
            "routes": [
               {
                  "dst": "::/0"
               },
               {
                  "dst": "0.0.0.0/0"
               }
            ],
            "ranges": [
               [
                  {
                     "subnet": "2001:db8:26::/64",
                     "gateway": "2001:db8:26::1"
                  }
               ],
               [
                  {
                     "subnet": "10.89.0.0/24",
                     "gateway": "10.89.0.1"
                  }
               ]
            ]
         }
      },
      {
         "type": "portmap",
         "capabilities": {
            "portMappings": true
         }
      },
      {
         "type": "firewall",
         "backend": ""
      },
      {
         "type": "tuning"
      },
      {
         "type": "dnsname",
         "domainName": "dns.podman",
         "capabilities": {
            "aliases": true
         }
      }
   ]
}

Describe the results you received

Results do not match the Create command.

Describe the results you expected

Describe the results you expected

podman info output

pie@homeserver:~$ podman info
host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers:
  - cpu
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.1.2, commit: '
  cpus: 12
  distribution:
    codename: noble
    distribution: ubuntu
    version: "24.04"
  eventLogger: journald
  hostname: homeserver
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      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.8.0-53-generic
  linkmode: dynamic
  logDriver: journald
  memFree: 40572366848
  memTotal: 67177725952
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: ea1fe3938eefa14eb707f1d22adff4db670645d6
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  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: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 9h 23m 31.61s (Approximately 0.38 days)
plugins:
  log:
  - k8s-file
  - none
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/pie/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/pie/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 0
  runRoot: /run/user/1000/containers
  volumePath: /home/pie/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.2
  Built: 0
  BuiltTime: Thu Jan  1 00:00:00 1970
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 3.4.2

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

@moutasem1989 moutasem1989 added the kind/bug Categorizes issue or PR as related to a bug. label Feb 19, 2025
@sbrivio-rh sbrivio-rh added the network Networking related issue or feature label Feb 19, 2025
@sbrivio-rh
Copy link
Collaborator

You appear to be using Podman 3.4.2, and we only support the latest upstream version (or significantly close) here.

Any chance you can try this on somewhat more recent? See also #25219, #17362, #25324 (reply in thread), on the subject.

@Luap99
Copy link
Member

Luap99 commented Feb 19, 2025

Yes this version is outdated and the network parts have been completely rewritten, this works fine on newer versions

@Luap99 Luap99 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2025
@moutasem1989
Copy link
Author

This is the latest version installed as described in the documentation . either update documentation or update the package.

@sbrivio-rh
Copy link
Collaborator

This is the latest version installed as described in the documentation. either update documentation or update the package.

The package is updated. The version you get depends on the version of Ubuntu you use. If you want newer features or bugfixes on versions of Ubuntu shipping older Podman versions, you'll need to backport them, or ask Canonical if you have a support agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. network Networking related issue or feature
Projects
None yet
Development

No branches or pull requests

3 participants