iocage, vnet0, and bridge0

j0hnby

Explorer
Joined
Apr 22, 2017
Messages
68
I just upgraded to 11.1-U6 to fix this issue, but it's still persisting. Anybody else having the same problem or am I doing something wrong?
Don't think it's fixed in U6, but it is in the betas.
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Used to do it via the command line, but since B2 have used the web interface - it's much more slick. Still prefer to create a blank jail then add my own packages in manually, that's just me liking to know how things go together though.

what your command line for jail creation in terms of networking.
 

j0hnby

Explorer
Joined
Apr 22, 2017
Messages
68
what your command line for jail creation in terms of networking.

This is what I used, update to whichever release you want to use.

iocage create -n "jailname" -r 11.1-RELEASE ip4_addr="vnet0|192.168.0.16/24" defaultrouter="192.168.0.1" vnet="on" allow_raw_sockets="1" boot="on"

I also had the following RC tunables added to make sure my NIC went into the bridge too (these are removed since beta 2 as it is working now)
Variable: cloned_interfaces
Value: bridge0
Variable: ifconfig_bridge0
Value addm mlxen0 up
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Yes, that's exactly how I do it too. I assume when you use the gui you just choose vnet, ip default gateway vnet on. But nothing in the advanced section
 

j0hnby

Explorer
Joined
Apr 22, 2017
Messages
68
Yes, that's exactly how I do it too. I assume when you use the gui you just choose vnet, IP default gateway vnet on. But nothing in the advanced section

Yeah, just been following the basic wizard. Name, release, VNET (vnet0 selected for interface), IP, subnet, route. Seems to be happy enough.
 

rostrum81

Cadet
Joined
Sep 20, 2015
Messages
3
I tried to apply the same fixes in U6 (didn't try U5), but just cannot get it working at all. I had to revert back to U4 release.

Seems like I'll wait for stable 11.2 release.
 

Visseroth

Guru
Joined
Nov 4, 2011
Messages
546
Hello,

i had the same problem but after a few research i have added 2 tunable in the rc.conf :
Code:
Variable : cloned_interfaces ; Value : bridge0
Variable : ifconfig_bridge0 ; Value : addm igb0 up

11.2, Found to have the exact same problem. Fixed with the above information and a reboot.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
11.2, Found to have the exact same problem. Fixed with the above information and a reboot.
This should no longer be required to my knowledge.

Are you sure you had to do this??
 

Visseroth

Guru
Joined
Nov 4, 2011
Messages
546
Yes. I was getting a network bridge error prior to adding the variables to rc.conf and then rebooting. After the reboot my jails had "None" selected for the interface even though previously they were set to bridge. Setting the variables and re-selecting the interface allowed the jails to run (all 6) without error.
I reported it here...
https://redmine.ixsystems.com/issues/72507

Edit: I should also add that I was having problems installing the NextCloud plugin and posted here... https://forums.freenas.org/index.php?threads/nextcloud-nginx-welcome-solved.73289/
His thought was something was wrong with the bridge interface so I removed the plugin (Deleted NextCloud), restarted, tried to start my jails and was getting the error. I set the rc.conf variables, restarted again and the jails were able to start. Once all jails were confirmed working I then installed NextCloud without a hitch.
 
Joined
Nov 11, 2016
Messages
1
Weirdly enough, hadn't had these issues before with 11.2-U1 (or in the past).

However, after the release of 11.2-U2 I now need these tunables in order for my bridge0 to have networking correctly (vnet0 in the iocage jail), but the good news is that they fix the problem!
 
Joined
Mar 6, 2014
Messages
686
I finally got it to work propery via GUI only and without tunables. I have 2 physical interfaces, igb0 and igb1 and two jails that i want to have on a separate interface each. So jail 1 connects to igb0 and jail 2 connects to igb1.

For jail 1, settings in GUI:
  • In the basic properties screen, select VNET and choose VNET0 as the ipv4 interface and fill in the IP, subnet and gateway (of course in the network you are connecting to).
  • In the network properties, under interfaces, type: VNET0:bridge0 (if it's not already there)
  • Also in the network properties, set the vnet default interface to igb0
For jail 2, settings in GUI:
  • In the basic properties screen, select VNET and choose VNET0 as the ipv4 interface and fill in the IP, subnet and gateway (of course in the network you are connecting to).
  • In the network properties, under interfaces, type: VNET0:bridge1
  • Also in the network properties, set the vnet default interface to igb1
  • Also in the network properties, under resolver, type: nameserver <your dns ip>;nameserver <your dns ip> (and other options you want in the resolv.conf file of the jail). You can leave it empty/default if you vant to use the same as the host's file (The Freenas file itself) <--I did not need this for jail 1, since that one is on the same network as the nas itself, so it uses the same dns settings, but it i did need that for jail 2, since there i use a different dns server.
So for me the 2nd and 3rd bullet were (mainly) the culprit and with these settings everything is working perfectly :)

EDIT: forgot the 3rd bullet :oops:
 
Last edited:

bmp

Cadet
Joined
Feb 22, 2019
Messages
8
I finally got it to work propery via GUI only and without tunables. I have 2 physical interfaces, igb0 and igb1 and two jails that i want to have on a separate interface each. So jail 1 connects to igb0 and jail 2 connects to igb1.

For jail 1, settings in GUI:
  • In the basic properties screen, select VNET and choose VNET0 as the ipv4 interface and fill in the IP, subnet and gateway (of course in the network you are connecting to).
  • In the network properties, under interfaces, type: VNET0:bridge0 (if it's not already there)
  • Also in the network properties, set the vnet default interface to igb0
For jail 2, settings in GUI:
  • In the basic properties screen, select VNET and choose VNET0 as the ipv4 interface and fill in the IP, subnet and gateway (of course in the network you are connecting to).
  • In the network properties, under interfaces, type: VNET0:bridge1
  • Also in the network properties, set the vnet default interface to igb1
  • Also in the network properties, under resolver, type: nameserver <your dns IP>;nameserver <your dns IP> (and other options you want in the resolv.conf file of the jail). You can leave it empty/default if you vant to use the same as the host's file (The Freenas file itself) <--I did not need this for jail 1, since that one is on the same network as the nas itself, so it uses the same dns settings, but it i did need that for jail 2, since there i use a different dns server.
So for me the 2nd and 3rd bullet were (mainly) the culprit and with these settings everything is working perfectly :)

EDIT: forgot the 3rd bullet :oops:
Awesome Sauce! Thank you So much I have been screwing with this for a while and have been running into wall after wall. Separate Networks is a must for a bunch of my jails and this worked every time thanks so much!. Also just an FYI it worked without a Jail 1 ;) I don't have any jails on my primary network for the NAS. The bridge0 exists but nothing is assigned to it!
 
Top