Jails - assigning separate NIC

listhor

Contributor
Joined
Mar 2, 2020
Messages
133
Hello,

I've been struggling for a couple of days to assign NIC to a jail using GUI (11.3). I know that using:
Code:
sudo iocage create -r 11.3-RELEASE ip4_addr="igb2|172.16.1.3/26" defaultrouter="172.16.1.1" -n test2

I'll create jail having igb2 assigned to it; but once I just save its settings in GUI, connectivity it's lost.
FreeNAS works under ESXi with AHCI controller and selected NICs (3 out of 8) passthrough enabled. Following is a list of my interfaces:
Zrzut ekranu 2020-03-3 o 09.51.56.png

igb1 is host's main interface, I'm trying to use igb2 for jail assignment and later on - igb0. So far, I've figured out that in order to use interface in jail, interface itself can not have an IP assigned (in Network -> Interfaces).
I also have been trying vlans (connected to clan aware switch - unifi) but no joy at all.
Ofcourse I did my research but can't find something really relevant; and I would like to avoid as much as possible tweaking in Tunables because over a time it may introduce some some maintenance headache, unless I'm wrong?

So, is it possible to assign NIC to jail in GUI or use vlans??
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
In the jail definition, you can change the vnet default interface to your preferred NIC.

1592740821121.png
 

mikegleasonjr

Dabbler
Joined
Sep 14, 2020
Messages
10
Sorry to raise this thing from the dead... but I have a problem using this configuration. Traffic still goes through em0 even when I choose another nic in vnet_default_interface.

I have 3 interfaces (no bridges configured):
  1. em0 - main for TrueNAS (connected to switch 1 port 1)
  2. em1 - used for jails (connected to switch 1 port 2)
  3. em2 - unused
When I create a Jail, I use DHCP, VNET and BPF. Then choose em1 in vnet_default_interface. Network works fine but the switch tells me there is traffic on em0. What's odd, is that there is also traffic on em1 and it's always the double the amount of em0.

For example let's say I download at 25mbps from the jail, I will see 25mbps on em0 (port 1) and 50mbps on em1 (port 2) on the switch.
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
I'm not pro network pro but here is what I did. Create bridge0 & bridge1 for em0 & em1.
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You must first create a bridge interface with your physical as member manually and then set:
  • vnet_default_interface: none
  • interfaces: vnet0:<your-bridge>
in the jail properties.

If there is an IP address for the NAS on the physical interface, you MUST move that to the bridge instead. Bridge member interfaces MUST NOT have IP addresses assigned in FreeBSD.
 
Top