Networking FreeNAS 11.0 + VM

Status
Not open for further replies.

Finnless

Dabbler
Joined
Apr 1, 2016
Messages
29
I'm replacing an aging Windows Home Server (v1) that has been chugging along as both a media back end (running SageTV) and storage/backup system with a new FreeNAS system. After going down the Corral dead end on my first attempt, I have set up a FN 11.0 system. It is up and running and I've added a VM running Ubuntu Server 16.04 LTS for the SageTV service. I've made heavy use of the forum searches and docs to get this far (never would have got past the EFI boot bug without it) but I'm getting a lot of irrelevant Corral pages in search results about VMs.

So while all appears to be more or less functioning at this point, I am not sure about the "proper" networking setup for the VM. I am new to much of this. The old Windows Home Server was pretty much 'plug-and-play'. Not sure if this is a FreeNAS networking question, a VM question, an Ubuntu question, or some combination of these things...

I have given the FreeNAS system a fixed IP address via my router, which uses the FreeNAS MAC address to assign it an IP.

I need the Ubuntu VM to also have a fixed IP address on the local network. Obviously a different one.

I tried doing this at first by modifying /etc/network/interfaces within the Ubuntu VM to provide the interface (usually eth0, but called enp0s3 in the Ubuntu VM) with a static address. This gave me local network connectivity but no connection to the internet.

Next I switched back to DHCP within the Ubuntu VM, noted the MAC address of the 'virtual' enp0s3 network interface, and set my router to assign a static IP to that MAC address. This is giving both local and internet connectivity, but I'm not sure this is a good way to proceed since the MAC address isn't for a physical device. Might it change at some point after a reboot?

The server motherboard in the FreeNAS system actually has 4 physical LAN ports, with only 1 being used currently. Is it possible, or would it even make sense, to tie a 2nd physical LAN port to the VM? I poked around at the Network->Interfaces page of the FreeNAS GUI but I only know enough to be dangerous at this point.

Is there something under "VMs" in the FreeNAS web interface when setting up a VM that facilitates a VM having a fixed IP address?
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
MAC address in FreeNAS is currently associated with the VM name. As long as you don't change the VM name it should stick.

FreeNAS can't control which IP a given interface in VM has, it either receives a (possibly static) ip from a dhcp server via MAC lookup or is assigned a static IP in the vm.

When You had network connectivity issues in the vm when assigning a static, you probably messed up the network/gateway/DNs settings.
 

Finnless

Dabbler
Joined
Apr 1, 2016
Messages
29
MAC address in FreeNAS is currently associated with the VM name. As long as you don't change the VM name it should stick.

Thanks, that’s a very useful piece of information. For testing the configuration of the software in the VM I have been making multiple copies of its drive so I can test and revert to the original when needed. (In more detail: stop the VM, snapshot the zvol it uses, clone the snapshot to a new zvol, then use the new zvol for testing).

Sometimes I have attached the cloned zvol to a new VM, sometimes I have used the original VM and switched the zvol it points to. I gather the former will result in a new MAC address since it is a new VM with a different name, but the latter keeps the MAC address the same since I’ve only changed the disk and kept the same VM. That explains why I was sometimes seeing different MAC addresses.

When You had network connectivity issues in the vm when assigning a static, you probably messed up the network/gateway/DNs settings.

Yeah, that’s what I assumed, but it’s such a straight forward thing and I couldn’t see where I made a mistake. Doesn’t matter now that I understand the MAC address behaviour and can continue to assign an IP address to the VM that way.
 

Finnless

Dabbler
Joined
Apr 1, 2016
Messages
29
Update: it looks like the behaviour regarding MAC address assignment has changed in FN 11.1. Every time the VM is restarted a new (different) MAC address is being created now.

I have gone back to assigning a static IP address within the VM itself since I can't rely on the MAC address to stay the same for the router DHCP to catch.
 

joebad1

Explorer
Joined
Nov 21, 2015
Messages
58
Update: it looks like the behaviour regarding MAC address assignment has changed in FN 11.1. Every time the VM is restarted a new (different) MAC address is being created now.

I have gone back to assigning a static IP address within the VM itself since I can't rely on the MAC address to stay the same for the router DHCP to catch.

I had the same problem editing the interfaces file and lost internet connectivity. Would you mind posting the output of your interfaces file here so I can see what you did to fix it?
 

Finnless

Dabbler
Joined
Apr 1, 2016
Messages
29
I had the same problem editing the interfaces file and lost internet connectivity. Would you mind posting the output of your interfaces file here so I can see what you did to fix it?

I followed the instructions for Static IP Address Assignment on the Ubuntu help pages

Code:
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1


to assign the address and gateway, then one more line for Name Resolution

Code:
dns-nameservers 192.168.3.45 192.168.8.10


changing the address, gateway, dns address in the examples to match my own network, and the interface name from 'eth0' to the actual 'enp0s3' name it has in the VM. The problems I had earlier (mentioned above) were simply from messing up the DNS name server entry.
 
Joined
Mar 24, 2016
Messages
6
Hallo Finnless,
i have noticed that with freeNAS 11.1-U4 installed on my server i have to implement some "infos" to make it works on a VM
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1

my /etc/network/interfaces looks like:
Code:
allow-hotplug enp0s3
iface enp0s3 inet static
address 10.0.0.100
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1



Ciao
Andrea
 
Status
Not open for further replies.
Top