Fixed IP address for vmd dedicated VMs from dhcpd every boot/reboot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fixed IP address for vmd dedicated VMs from dhcpd every boot/reboot

Martin Got
Hi,

Sometimes dedicated VMs need fixed (the same) IP address assigned by dhcpd every run. I don't know how to achieve this by dhcpd configured. Every VM reboot it gets different IP. OpenBSD guests changes their IPs even without reboot, right in runtime.

For instance I need to assign these IP addresses to VMs every run to dedicated VMs by dhcpd:

OpenBSD obsd0.qcow2 10.0.1.12
OpenBSD obsd1.qcow2 10.0.1.13
OpenBSD obsd2.qcow2 10.0.1.14

Linux lin0.qcow2 10.0.1.22
Linux lin1.qcow2 10.0.1.23

It looks like MAC of guests changed every boot, so dhcpd assigned different IP address from the pool every boot/reboot.

Please advice any way how to fix it.

Thank you for answer in advance.

Martin

Reply | Threaded
Open this post in threaded view
|

Re: Fixed IP address for vmd dedicated VMs from dhcpd every boot/reboot

Kapetanakis Giannis
On 25/07/2020 11:28, Martin wrote:

> Hi,
>
> Sometimes dedicated VMs need fixed (the same) IP address assigned by dhcpd every run. I don't know how to achieve this by dhcpd configured. Every VM reboot it gets different IP. OpenBSD guests changes their IPs even without reboot, right in runtime.
>
> For instance I need to assign these IP addresses to VMs every run to dedicated VMs by dhcpd:
>
> OpenBSD obsd0.qcow2 10.0.1.12
> OpenBSD obsd1.qcow2 10.0.1.13
> OpenBSD obsd2.qcow2 10.0.1.14
>
> Linux lin0.qcow2 10.0.1.22
> Linux lin1.qcow2 10.0.1.23
>
> It looks like MAC of guests changed every boot, so dhcpd assigned different IP address from the pool every boot/reboot.
>
> Please advice any way how to fix it.
>
> Thank you for answer in advance.
>
> Martin


Not familiar at all with VMM but vm.conf(5) says:

             [locked] lladdr [etheraddr]
                      Change the link layer address (MAC address) of the
                      interface on the VM guest side.  If not specified, a
                      randomized address will be assigned by vmd(8).  If the
                      locked keyword is specified, vmd(8) will drop packets
                      from the VM with altered source addresses.

dhcpd.conf(5) also has examples on how to assign same IP per host MAC

G


Reply | Threaded
Open this post in threaded view
|

Re: Fixed IP address for vmd dedicated VMs from dhcpd every boot/reboot

Martin Got
Thanks guys, this helps!

Martin

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, July 25, 2020 8:41 AM, Kapetanakis Giannis <[hidden email]> wrote:

> On 25/07/2020 11:28, Martin wrote:
>
> > Hi,
> > Sometimes dedicated VMs need fixed (the same) IP address assigned by dhcpd every run. I don't know how to achieve this by dhcpd configured. Every VM reboot it gets different IP. OpenBSD guests changes their IPs even without reboot, right in runtime.
> > For instance I need to assign these IP addresses to VMs every run to dedicated VMs by dhcpd:
> > OpenBSD obsd0.qcow2 10.0.1.12
> > OpenBSD obsd1.qcow2 10.0.1.13
> > OpenBSD obsd2.qcow2 10.0.1.14
> > Linux lin0.qcow2 10.0.1.22
> > Linux lin1.qcow2 10.0.1.23
> > It looks like MAC of guests changed every boot, so dhcpd assigned different IP address from the pool every boot/reboot.
> > Please advice any way how to fix it.
> > Thank you for answer in advance.
> > Martin
>
> Not familiar at all with VMM but vm.conf(5) says:
>
> [locked] lladdr [etheraddr]
> Change the link layer address (MAC address) of the
> interface on the VM guest side. If not specified, a
> randomized address will be assigned by vmd(8). If the
> locked keyword is specified, vmd(8) will drop packets
> from the VM with altered source addresses.
>
> dhcpd.conf(5) also has examples on how to assign same IP per host MAC
>
> G