Jails with non-persistent network settings

Status
Not open for further replies.

Egil Opstad

Cadet
Joined
Oct 7, 2016
Messages
2
First post! :)

So! I've been struggling for a while with jails and networks. I have two NICs in the server connected to two separate physical routers.

router 1 - 10.0.1.0/24, DHCP enabled - connected to ra0
router 2 - 10.0.2.0/24, DHCP enabled - connected to em0
server default gateway: 10.0.1.1
gateway for 10.0.2.0/24 is 10.0.2.1

The issue I am encountering is the following:
  • Set up jail, choose nic em0
  • Enable DHCP (causes em0 to get greyed out)
  • Disable VIMAGE (causes em0 to be active again)
  • boot
This configuration results in the jail getting an ip in the 10.0.2.0/24 range, which is what I want. And all is good until I restart FreeNAS, or the jail itself, which switches the jail over to getting an IP address from 10.0.1.0/24 instead. I can't for the life of me get it back on the 10.0.2.0/24 range ever again for some reason either. If I try changing back, it breaks the DHCP settings for 10.0.1.0/24 as well, forcing me to use static IPs.

I tried setting static IP's in the 10.0.2.0/24 segment and set the gateway for 10.0.2.1, but it is unclear to me if it works, but it seems to just leave me with network, but no internet. I tried changing resolv.conf when having a static IP to use the DNS server off of the 10.0.2.0/24 router, and felt it got me a bit closer as I got to ping an url and having it resolve to an ip but never getting an answer. This though, leads me to believe that the traffic from the jail to the site works, but the replies never reach the jail.
When changing the config of a particular jail to use the 10.0.1.0/24 NIC and a static IP, everything works instantly.

Am I onto something here (as in I need to set up something along the line of static routes) or am I just fumbling in the dark? Any tips?
 

Egil Opstad

Cadet
Joined
Oct 7, 2016
Messages
2
Were you able to figure this out?
Sadly no. I'm considering joining the two physical networks into one on one single router, set up two dhcp servers on it and punch holes with static routing between the segments. This is a last resort though. I really don't want to do it as it will create a lot of new issues and cost a lot in terms of time spent and a new router on top of that.

But, just to be sure, I'm not trying to do magic here, right? This should be possible?
 
Status
Not open for further replies.
Top