TrueNAS Core with Debian VM for Docker - Networking/DNS

involut

Dabbler
Joined
Feb 27, 2020
Messages
23
Hi,

I am looking for some advice in regards to my current network configuration with TrueNAS and its VM.

The bare metal server for TrueNAS-13.0-U1.1 is connected through a single network interface to the network.
Hostname: saturn
(Additional) Domain: local
DNS Server: 192.168.2.10
Gateway: 192.168.2.1
igb0 (static): 192.168.2.5

On top of that I have recently added a Debian (5.10.0-15-amd64) VM to act as a server to Docker.
Hostname: titan
sudo cat /etc/network/interfaces

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# allow-hotplug enp0s3
# iface enp0s3 inet dhcp
# This is an autoconfigured IPv6 interface
iface enp0s3 inet6 auto

# Static IP
auto enp0s3
iface enp0s3 inet static
address 192.168.2.10
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameservers 192.168.2.10 8.8.8.8

sudo cat /etc/resolv.conf
domain local
search local
nameserver 192.168.2.10
nameserver 8.8.8.8

On titan, I am running Pi-Hole as a DNS and DHCP server. It does well at giving away DHCP leases for the IP range I have configured. In Pi-Hole, I have set the domain name to local under the DHCP settings.

Now, when I am on my MacBook (DHCP) and try to ping any other device by its hostname that Pi-Hole handles via DHCP, it works flawlessly. However, when I try to ping any devices where I have set a static IP, I get an 'cannot resolve titan: Unknown host' error. Except for saturn, when I add .local to it. But only for this host.
➜ ~ ping callisto (DHCP device)
PING callisto (192.168.2.108): 56 data bytes
64 bytes from 192.168.2.108: icmp_seq=0 ttl=64 time=24.190 ms
64 bytes from 192.168.2.108: icmp_seq=1 ttl=64 time=1.949 ms

➜ ~ ping titan
ping: cannot resolve titan: Unknown host

➜ ~ ping saturn
ping: cannot resolve saturn: Unknown host

➜ ~ ping saturn.local
PING saturn.local (192.168.2.5): 56 data bytes
64 bytes from 192.168.2.5: icmp_seq=0 ttl=64 time=25.950 ms
64 bytes from 192.168.2.5: icmp_seq=1 ttl=64 time=1.810 ms

➜ ~ ping titan.local
ping: cannot resolve titan.local: Unknown host

In addition, when I try to ping pi.hole (which should be possible anytime), I get an 'sendto: Socket is not connected' error.
➜ ~ ping pi.hole
PING pi.hole (0.0.0.0): 56 data bytes
ping: sendto: Socket is not connected
Request timeout for icmp_seq 0
ping: sendto: Socket is not connected
Request timeout for icmp_seq 1

I am beyond confused at this point... ^^
It would be extremely helpful to understand whether the Debian VM is configured correctly from a networking perspective.

Any help or feedback is appreciated.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It may be as simple as setting up a bridge to do the broadcast properly...

Physical NIC --> VLAN (if you have one) --> Bridge (IP address of TrueNAS goes here)

Then you assign the VM NIC to the Bridge also and it will be able to do broadcast properly (which I suspect it can't right now)... (many good posts from @Patrick M. Hausen explanining that it's a requirement that bridge members don't have an IP)

Anyway. Computer naming is a many-headed beast and you have all sorts of things going on there... dns, mdns, netbios, broadcast, static, DHCP, search suffixes... etc. blocking broadcast with the wrong config is possibly all you need to fix, but it may also be a lot more.
 

involut

Dabbler
Joined
Feb 27, 2020
Messages
23
Hi @sretalla,

Thank you for your input. I kind of get your idea behind broadcasting and that something is off - sounds like a good thing to look at.

However, I don't understand how a network bridge would help. Maybe because of my understanding. But In fact, I don't have two separate LANs where I would need a bridge that connects both. All my machines run in the same 192.168.2.x space. Whether it is a physical machine or a virtual machine or container.

Would you mind elaborating this thought a bit?

And in my example, I understand that in TrueNAS I Add an Bridge Interface, connect igb0 to the Bridge Members? Which IP Address would I state then? And where/ how to connect the VM NIC to the Bridge? ^^
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The precise procedure is listed here:

that thread explains it in at least a few of the posts.

Please note that although that thread refers to SCALE, the same is true for CORE and the only difference is that bridges are long.named in CORE (like bridge0) rather than the short version in SCALE (like br0)

The address you would use is the one that you will remove from your NIC (the address of the TrueNAS). (if you were using DHCP, maybe time to consider static assignment).

The VM can be assigned to the bridge via the NIC device... set the "NIC to atach" to the bridge.
 
Top