On Sun, Feb 16, 2020 at 06:35:10AM +0100, Theo Buehler wrote: > I don't think this patch is correct. > > The vmctl part contradicts the "LOCAL INTERFACES" section, which > explains how the addresses are calculated and also states: > > Multiple -L options can be provided to the 'vmctl start' command, > if more than one interface is desired. > > # rcctl -f start vmd > vmd(ok) > # vmctl start -b /bsd.rd -c -L -L test > [...] > Welcome to the OpenBSD/amd64 6.6 installation program. > (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? s > # dhclient vio0 > vio0: 100.64.1.3 lease accepted from 100.64.1.2 (fe:e1:bb:d1:bc:46) > # dhclient vio1 > vio1: 100.64.1.5 lease accepted from 100.64.1.4 (fe:e1:bb:d2:3a:8e) > > In vm.conf, the 'local' keyword applies per interface. It's perfectly > valid to have several 'local interface' lines for the same VM in vm.conf > and the corresponding vio interfaces will get leases from the built-in > dhcp server. Oh, you are correct.
I completely missed that part from vmctl.5's "LOCAL INTERFACES" section. Reading `-L's description itself and the fact that it functions as a boolean switch contrary to how `-i' expects a number, I made the wrong assumption that it can only work for the first interface. -L Add a local network interface. vmd(8) will auto- generate an IPv4 subnet for the interface, configure a gateway address on the VM host side, and run a simple DHCP/BOOTP server for the VM. See LOCAL INTERFACES "a local network interface" and "for the interface" supported my false believes, so I dismissed the referenced section which goes into all the details about most but apparently not all details I already know. My second mistake was to imply analogue behaviour for the configuration. Now that you stated the obvious about `local' being per `interface' line, it makes absoloutely no sense to above mentioned behaviour for static VM definitions. I will revert my change and think about whether the vmctl(8) bits can be improved, vm.conf(5) is totally clear. Thank you Theo and sorry for such sloppiness.