VM's created inside TrueNAS Core can't reach internet

brennoflavio

Cadet
Joined
May 22, 2022
Messages
5
So, I've been researching this issue for many hours now without any conclusions. VM's created inside TrueNAS Core can't reach network. They can't ping the host, other private IP's in the network, or the internet.

I'm fairly new to TrueNAS, so I don't exactly know how to debug this. I tried to create a bridge network without success. Is there any guides or general tips on how to setup and debug this kind of issue?
 

Attachments

  • 2022-05-22_21-23_1.png
    2022-05-22_21-23_1.png
    81.7 KB · Views: 389
  • 2022-05-22_21-23.png
    2022-05-22_21-23.png
    15.4 KB · Views: 412

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Hmmm.... you're answering a question about CORE with a link to the SCALE doc.

I agree the solution is likely very similar, but isn't in the "FM" in this case.
 

brennoflavio

Cadet
Joined
May 22, 2022
Messages
5
Hey, thanks for the responses. I haven't tried that because it was inside the Scale docs, so I assumed that will not be the correct one for my use case.

I've tried many Network configurations, combining Bridge, Physical and VLAN interfaces, and in none of them seems to work. Notice that TrueNAS itself and its services (Jails for example) can reach internet, its just the VM's that can't connect.

In the attachments I'm uploading my current configuration. As I said, FreeBSD is new to me (I've been working with Linux systems for many years now but first time with TrueNAS), and I could not find in the docs how the Network configuration should look like to allow networking in VM's.

Thanks!
 

Attachments

  • 2022-05-23_13-03.png
    2022-05-23_13-03.png
    20.2 KB · Views: 350
  • 2022-05-23_13-02.png
    2022-05-23_13-02.png
    200.4 KB · Views: 248
  • 2022-05-23_13-01.png
    2022-05-23_13-01.png
    507.3 KB · Views: 350

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Are all of these Linux VMs? Did you install them from scratch using a bootable ISO image? Did you remove the virtual CD device after installation?

If the answer to all questions is yes, you probably have a Linux and not an TrueNAS problem. With the current device naming in Linux the name of the network interface changes when you remove the CD device, because it is built from PCIe slot/address/whatever - I don't know the precise specifics, but the name definitely changes.

So the interface might have been "enp0s5" during installation but is now "enp0s4". And so the config - generated at install time - does not match anymore.

Check with ifconfig -a what the name of the interface is, then change to the directory /etc/netplan (if it exists) and edit the yaml file you find in there to have the correct interface name. Then reboot.
 

brennoflavio

Cadet
Joined
May 22, 2022
Messages
5
That was exactly the issue. During my debugging I didn't pay attention that the interface name changed. Fixing the /etc/netplan/*.yml by changing the interface name, and specifing the ip, gateway and dns server made it work as expected.

Thanks!

Are all of these Linux VMs? Did you install them from scratch using a bootable ISO image? Did you remove the virtual CD device after installation?

If the answer to all questions is yes, you probably have a Linux and not an TrueNAS problem. With the current device naming in Linux the name of the network interface changes when you remove the CD device, because it is built from PCIe slot/address/whatever - I don't know the precise specifics, but the name definitely changes.

So the interface might have been "enp0s5" during installation but is now "enp0s4". And so the config - generated at install time - does not match anymore.

Check with ifconfig -a what the name of the interface is, then change to the directory /etc/netplan (if it exists) and edit the yaml file you find in there to have the correct interface name. Then reboot.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
My Palantir again. "M." is for Mithrandir :wink:

You are most welcome. Glad I guessed correctly.
 
Top