lxc icon indicating copy to clipboard operation
lxc copied to clipboard

hwaddr of host side veth pair interface

Open mphilipps opened this issue 6 years ago • 3 comments

hi, I have noticed that even with a fixed name for the host interface ( lxc.net.0.veth.pair ) the mac addr of the interface appears to be random. I would like to set a fixed hwaddr so that the link local ipv6 address is predictable. I have found no documentation on how to achieve this, trying the logical lxc.net.0.veth.pair.hwaddr = 52:54:00:04:32:02 fails because 52:54:00:04:32:02 is not a valid interface name.

I can't use lxc.net.[i].ipv6.gateway because the interface is configured in the container.

Required information

  • Distribution: Debian
  • Distribution version: 10
  • The output of
    • lxc-start --version: 3.0.3
    • lxc-checkconfig everything enabled,
    • uname -a: 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

Information to attach

Unprivileged container started by root.

lxc.include = /usr/share/lxc/config/common.conf
lxc.include = /usr/share/lxc/config/userns.conf
lxc.arch = amd64
lxc.uts.name = foo

lxc.idmap = u 0 1869472 65536
lxc.idmap = g 0 1869472 65536
lxc.rootfs.path = dir:/vmroots/foo-container/rootfs
lxc.rootfs.path = lvm:/dev/vg0/foo-container

lxc.cap.drop = audit_read
lxc.start.auto = 1
lxc.net.0.type = veth
lxc.net.0.link = foo
lxc.net.0.name = eth0
lxc.net.0.hwaddr = 52:54:00:08:32:02
lxc.net.0.veth.pair = h_foo
lxc.cgroup.memory.limit_in_bytes = 4294967296
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1

mphilipps avatar Dec 16 '19 09:12 mphilipps

@tomponline you may be interested in this one.

stgraber avatar Mar 21 '20 02:03 stgraber

@stgraber taking a look now

tomponline avatar Mar 23 '20 11:03 tomponline

@stgraber ah just read this more closely and its a feature request for controlling the host-side MAC address, will leave for now until prioritised.

tomponline avatar Mar 23 '20 11:03 tomponline