VM gets no IP

I am using 25.10 on a HP Proliant DL380 and I want to migrate all my KVM/Qemu VMs to this system.

I need DHCP on Truenas and the VMs, I have a DHCP and DNS in my network.

I created a Network bridge, but my VM gets no IP. I followed the official documentation and watched some YT videos and all tell me to give a static IP to my bridge. But I don’t want that. There will be more than one VM in the network and all should use the brige AND get an IP adress from my DHCP.

I am also wondering where the “Use default network settings” is, I can’t find it in my GUI.

Thanks!

The IP address of the bridge interface and the IP address of the VMs are completely separate.

Is the physical interface in that bridge the one you use to connect to TrueNAS or are you using two different ones - one for TrueNAS and one for VMs?

The IP address of the bridge interface and the IP address of the VMs are completely separate.

I know, I would expect the bridge has no ip at all. The VMs using this bridge get the IP addresses …

Is the physical interface in that bridge the one you use to connect to TrueNAS or are you using two different ones - one for TrueNAS and one for VMs?

Right now I am using one physical interface. The machine has 4 ethernet ports and later I want some of the machines use a specific interface exclusively.

If you use a single port you must move the IP address configuration from the physical port to the bridge interface. I don’t know if DHCP works, I’d recommend static.

Better yet in your case: configure the bridge on a free port without an address on either port or bridge and connect the VMs to that. This way it’s just a layer 2 connection and you can keep DHCP on your primary port.

1 Like

Tom from lawrence systems just released a nice video showcasing and explaining bridges, maybe it’ll help you

DHCP does work on bridges. Vridges in truenas scale are just middleware configurators for linux bridges. Since a bridge becomes the logical entry point to the host when used in Linux, that’s where addresses should be assigned just as was stated.

Thanks everybody for the input!

I watched the video, it is exactly how I configured the network bridge. I just rechecked …
Unfortunately my VM still does not get an IP adress :frowning:

I did not yet try to use two different nics - no physical access …

My acutal setup is a ubunutu server with KVM/Qemu where all our services (Cloud, PBX, ERP, Wiki, Development VMs) are running and my job is to find out if can migrate all our VMs to a TrueNAS system. I copied one of the qcow2 images to my TrueNas test setup, converted it with qemu-img convert and use this converted image for my VM. The VM starts and AFAIK everything is working beside the IP.

In this actual setup I created one bride with virt-manager and all machines are using this bridge successfully - so it should be possible in Truenas - right?

And you did move the host IP address configuration from the physical member interface to the bridge interface itself? AFAIK this is necessary for VMs to function across the same bridge.

In FreeBSD (TrueNAS CORE) it definitely was. If Linux bridges behave similarly, then …

Should be ok, right?

Looks good. Can you perform a tcpdump on the br0 interface while a VM is booting?

tcpdump -n -i br0 port bootpc
truenas_admin@truenas[~]$ sudo tcpdump -n -i br0 port bootpc
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on br0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
17:07:09.491295 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 68:b5:99:ad:29:87, length 300

OK, now do the same on the hardware interface - eno1 I assume.

truenas_admin@truenas[~]$ sudo tcpdump -n -i eno1 port bootpc
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eno1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
18:35:18.410876 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 68:b5:99:ad:29:87, length 300

The request does make it out to the “wire” as far as TrueNAS is concerned.

Now investigate why you are not getting a reply back.

What kind of system is your DHCP server? Consumer router or something a bit more capable? Can you do a packet trace there? Can you check a log file of the DHCP server?

We run a pfsense in our network, which does DHCP and DNS.

Can you do a packet trace there?

This is a little beyond my everyday knowledge, but it is feasible for me, just give me a little time. :wink:

You can do a packet trace from the web UI, probably. You can in OPNsense, I’d be surprised if you could not in pfSense.

I did and I don’t see any relevant entries. Thats the log file before and after boot of the VM:

Feb 12 14:56:22 pfsense kea2unbound[35584]: Include updated: /var/unbound/leases/leases4.conf (cf4fe6a7df9dcdb1)
Feb 12 14:56:22 pfsense kea2unbound[35584]: Unbound reloaded: /var/unbound/unbound.conf

I do need some advice with packet trace: do you mean Traceroute:

… or Packet Capture:

Could you explain in more detail what exactly the background is and how I can configure this in my case?

Thanks a Lot!