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 create network macvlan does not create expected configuration #9167

Closed
knumskull opened this issue Jan 31, 2021 · 6 comments · Fixed by #9204
Closed

podman create network macvlan does not create expected configuration #9167

knumskull opened this issue Jan 31, 2021 · 6 comments · Fixed by #9204
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@knumskull
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Creating a network using the command line tools, will not create the expected result.

Steps to reproduce the issue:

  1. podman network create --subnet 192.168.1.0/24 --gateway 192.168.1.254 --macvlan eth0 --opt vlan=10,mtu=1500 example-network

Describe the results you received:

{
   "cniVersion": "0.4.0",
   "name": "example-network",
   "plugins": [
      {
         "type": "macvlan",
         "master": "eth0",
         "ipam": {
            "type": "dhcp"
         }
      }
   ]
}

Describe the results you expected:

{
   "cniVersion": "0.4.0",
   "name": "example-network",
   "plugins": [
      {
         "type": "macvlan",
         "master": "eth0",
         "ipam": {
            "type": "host-local",
            "ranges": [
              [{
                "subnet": "192.168.1.0/24",
                "gateway": "192.168.1.254"
              }]
            ],
            "routes": [
              {"dst": "0.0.0.0/0"}
            ]
         },
         "vlan": 10,
         "mtu": 1500
      }
   ]
}

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

podman version 3.0.0-dev

Output of podman info --debug:

host:
  arch: arm64
  buildahVersion: 1.19.2
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.21-3.fc33.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21, commit: 66d50d2f6c81e28bacd99ee8e8d222f028eef63f'
  cpus: 4
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: rpi4.crazy.lab
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.9.16-200.fc33.aarch64
  linkmode: dynamic
  memFree: 4446306304
  memTotal: 8173101056
  ociRuntime:
    name: crun
    package: crun-0.16-3.fc33.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 0.16
      commit: eb0145e5ad4d8207e84a327248af76663d4e50dd
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/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: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 4086296576
  swapTotal: 4086296576
  uptime: 116h 43m 16.11s (Approximately 4.83 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 10
    paused: 0
    running: 1
    stopped: 9
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 11
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1611830045
  BuiltTime: Thu Jan 28 11:34:05 2021
  GitCommit: ""
  GoVersion: go1.16beta1
  OsArch: linux/arm64
  Version: 3.0.0-dev

Package info (e.g. output of rpm -q podman or apt list podman):

podman-3.0.0-0.184.dev.gitfb653c4.fc34.aarch64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):
Raspberry Pi 4 - 8GB Model with Fedora 33 and podman-3.0.0 from rawhide

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2021
@knumskull
Copy link
Author

Creating the same network, without specifying macvlan, it works as expected.

# podman network create --subnet 192.168.1.0/24 --gateway 192.168.1.254 --opt vlan=10 --opt mtu=1400 --macvlan eth0 example-network

{
   "cniVersion": "0.4.0",
   "name": "example-network",
   "plugins": [
      {
         "type": "bridge",
         "bridge": "cni-podman2",
         "isGateway": true,
         "ipMasq": true,
         "mtu": 1400,
         "hairpinMode": true,
         "vlan": 10,
         "ipam": {
            "type": "host-local",
            "routes": [
               {
                  "dst": "0.0.0.0/0"
               }
            ],
            "ranges": [
               [
                  {
                     "subnet": "192.168.1.0/24",
                     "gateway": "192.168.1.254"
                  }
               ]
            ]
         }
      },
      {
         "type": "portmap",
         "capabilities": {
            "portMappings": true
         }
      },
      {
         "type": "firewall",
         "backend": ""
      },
      {
         "type": "tuning"
      },
      {
         "type": "dnsname",
         "domainName": "dns.podman",
         "capabilities": {
            "aliases": true
         }
      }
   ]

@afbjorklund
Copy link
Contributor

Those options are only implemented for createBridge, not createMacVLAN...

They should probably move to some shared section then, not bridge-specific ?

@mheon
Copy link
Member

mheon commented Jan 31, 2021

@baude PTAL - should these options be exclusive of macvlan networking, or can we implement them?

@baude
Copy link
Member

baude commented Feb 1, 2021

@knumskull , the first part of this is #9189. Because we are about to release Podman 3.0, we decided to get the framework a little cleaned up and then once that is in, I will do the rest of it targeting 3.1. thanks for your report.

@knumskull
Copy link
Author

@baude that sounds really cool. Do you have an eta for the 3.1 version?

baude added a commit to baude/podman that referenced this issue Feb 2, 2021
when creating a macvlan network, we should honor gateway, subnet, and
mtu as provided by the user.

Fixes: containers#9167

Signed-off-by: baude <[email protected]>
@baude
Copy link
Member

baude commented Feb 2, 2021

not really, but you can see i made a PR today. please pull it and give feedback if you know how to!

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants