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

Static mac address doesn't work with macvlan network #365

Closed
0xF4CED opened this issue Aug 2, 2022 · 2 comments
Closed

Static mac address doesn't work with macvlan network #365

0xF4CED opened this issue Aug 2, 2022 · 2 comments
Labels

Comments

@0xF4CED
Copy link

0xF4CED commented Aug 2, 2022

/kind bug

Description

When specifying a static mac address for a macvlan interface in a container, the specified mac address does not get assigned in the container. Instead, a random mac address is assigned.

I suspect this to be somewhat related to #302.

Steps to reproduce the issue:

  1. Create macvlan network
sudo podman network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 --ip-range=192.168.0.240/28 \
  -o parent=eth0 lan
  1. Run container with macvlan and mac options
sudo podman run --rm \
  --network lan:mac=AA:AA:AA:BB:BB:BB \
  alpine cat /sys/class/net/eth0/address

Describe the results you received:
The resulting Mac address is not the one specified, but a random address each time.

Describe the results you expected:
The resulting Mac address is expected to be "AA:AA:AA:BB:BB:BB" as specified.

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

Output of podman version:

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.4
Built:        Fri Jul 22 21:06:49 2022
OS/Arch:      linux/arm64

Output of podman info --debug:

Output:
host:
  arch: arm64
  buildahVersion: 1.26.1
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - pids
  - misc
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 97.24
    systemPercent: 1.37
    userPercent: 1.39
  cpus: 4
  distribution:
    distribution: fedora
    variant: iot
    version: "36"
  eventLogger: journald
  hostname: stratum
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.18.13-200.fc36.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 257880064
  memTotal: 970309632
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.5-1.fc36.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.5
      commit: 54ebb8ca8bf7e6ddae2eb919f5b82d1d96863dea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.aarch64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 969928704
  swapTotal: 969928704
  uptime: 3h 3m 14.76s (Approximately 0.12 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 1
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 29777752064
  graphRootUsed: 3070681088
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
  runRoot: /run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 4.1.1
  Built: 1658516809
  BuiltTime: Fri Jul 22 21:06:49 2022
  GitCommit: ""
  GoVersion: go1.18.4
  Os: linux
  OsArch: linux/arm64
  Version: 4.1.1

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

podman-4.1.1-3.fc36.aarch64
netavark-1.0.3-3.fc36.aarch64
@openshift-ci openshift-ci bot added the kind/bug label Aug 2, 2022
@Luap99
Copy link
Member

Luap99 commented Aug 2, 2022

A fix is already in #360

@0xF4CED
Copy link
Author

0xF4CED commented Aug 2, 2022

Oh okay, awesome! I wasn't able to catch that.
Thank you very much.

@0xF4CED 0xF4CED closed this as completed Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants