Re: [GXemul-devel] MAC address for emulated hosts
Status: Alpha
Brought to you by:
gavare
From: Jan-Benedict G. <jb...@lu...> - 2023-03-27 20:49:44
|
Hi! On Sat, 2023-03-25 20:39:37 +0100, Jan-Benedict Glaw <jb...@lu...> wrote: > I just tried to find a way to configure specific MAC addresses for an > emulated machine. Couldn't find something in the docs and a quick look > at the sources seems to indicate that, for all emulated NICs, > net_generate_unique_mac() is called to calculate a MAC address. It > seems that for two "VMs" run as separate processes, the same MAC would > be used? [...] > @Anders: Do you already have private patches to allow for > configurable MAC addresses? Or maybe I'd cook up something? I had a closer look. One quite simple way to have configurable MAC addresses could be to add a command line option (as well as a "mac()" option in the config file) to supply a list of comma-separated MAC addresses to be stored in struct machine. A helper function could be used to to parse that string and return (if available) the n'th MAC address (or an error.) This could be called by net_generate_unique_mac() to either pick a configured MAC address or place one (as before.) @Anders: Would you accept a patch like that? Or have a different idea for supplying / parsing MAC addresses? MfG, JBG -- |