-
I wasn't originally sure if this'd be a podman question or not, since the majority of podman-network-create(1)'s options are implemented by the network backend (netavark), but the referenced documentation is in podman and netavark's "discussions" seem a little shallower than here. So... to start out (in case my whole process is busted), I have a container that needs its address to be managed externally. This implies that I can use the However, I have another container that needs to be bound to multiple network interfaces and (similarly) the only requirement is that its mac-address is predictable/settable on each of those interfaces so that the dhcp on each of its networks can manage it. The software also cannot be run concurrently in separate containers, due to the way it maintains its state. Anyways, the last line in the following snippet from the documentation (other lines included for context) is the one in question. podman/docs/source/markdown/options/mac-address.md Lines 5 to 15 in 0904c19 I tried fiddling around with podman-network-create(1), and couldn't for the life of me figure out what options to specify. Netavark doesn't seem to be documented that well, so I went spelunking through the source code to figure out what options the "macvlan" driver has. Although I'm terrible at rustlang, it reads as if there are no options other than "mtu", "parent", "vrf", "bclim", "metric", and "no_default_route" (https://github.com/containers/netavark/blob/29ad799acf1195726a8e040f965ff93041443a99/src/network/vlan.rs#L18-L20). This prevents me from specifying the hwaddr each of the ethernet interaces within the container. I re-read the documentation, and then realized that maybe I could specify the mac address as an option to the network via podman-container-run, but I get errno 99 from what appears to be netavark.
Anyways, I'm pretty sure that the referenced documentation is only referring to the "bridge" driver with regards to the "mac" option, and that none of the other drivers are relevant. Is that safe to assume? And if that's the case, is there some other way to have a container request dhcp leases for each of its associated networks with a non-random mac address? (edited) Apparently this already works as per containers/netavark#728, and was closed as "not planned". But I'm still not sure what I'm missing and how to modify my container/network units to accomplish this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
So in short the the second hex digit should never be odd. If you use |
Beta Was this translation helpful? Give feedback.
--network=systemd-interface-private:mac=21:21:21:32:32:32
is the correct syntax, the reason it fails because you specify an invalid mac address.The 7 and 8 bit have a special meaning, you cannot ever set the 8 bit to 1 because that means it is a multicast mac, see https://en.wikipedia.org/wiki/MAC_address#Address_details
So in short the the second hex digit should never be odd. If you use
20:21:21:32:32:32
it will work.