jail not working with DHCP

Status
Not open for further replies.

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
I have installed a fresh copy of FreeNAS 9.10 and the 9.10 nightlies to try and correct my problem. I tried to add a new new jail (test) and the dhcp will not grab an IP address. I have it set to autoconfigure and I have tried deleting the jail root and allow it to reinstall and I still can't get it to work.
 

Attachments

  • Screenshot 2016-03-26 01.20.34.png
    Screenshot 2016-03-26 01.20.34.png
    204.4 KB · Views: 939
  • Screenshot 2016-03-26 01.20.51.png
    Screenshot 2016-03-26 01.20.51.png
    199 KB · Views: 951
Last edited by a moderator:
D

dlavigne

Guest
Do you get an errors if you go into the jail and run dhclient interface_name (replace interface_name with actual name such as em0)? If so, paste the exact command and error messages.
 

swbartley

Explorer
Joined
Mar 17, 2014
Messages
58
Do you get an errors if you go into the jail and run dhclient interface_name (replace interface_name with actual name such as em0)? If so, paste the exact command and error messages.

This is the strangest thing. I had a couple test jails that grabbed an IP address when I restarted the computer but when I deleted them and tried to start over it went back to the original problem of not getting an IP address. I have a intel 4-port nic and 2 built in on the motherboard with em0 and em3 plugged in on the 4-port.
 

Attachments

  • Screenshot 2016-03-26 11.39.53.png
    Screenshot 2016-03-26 11.39.53.png
    309.6 KB · Views: 866
  • Screenshot 2016-03-26 11.40.05.png
    Screenshot 2016-03-26 11.40.05.png
    210.2 KB · Views: 764
  • Screenshot 2016-03-26 12.04.27.png
    Screenshot 2016-03-26 12.04.27.png
    225.3 KB · Views: 802

zZz

Cadet
Joined
Mar 26, 2016
Messages
2
I upgraded to 9.10, deleted all my jails and the jails dataset, and started fresh. My jails won't grab a DHCP address automatically, either. I have two jails. Here's an excerpt from messages when I start my "handbrake" jail:

Code:
Mar 27 21:51:10 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs list -H -o name '/mnt/pool-10HD/jails/.warden-template-standard'
Mar 27 21:51:10 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs get -H origin '/mnt/pool-10HD/jails/handbrake'
Mar 27 21:51:10 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs get -H origin '/mnt/pool-10HD/jails/plexmediaserver_1'
Mar 27 21:51:11 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs list -H -o name '/mnt/pool-10HD/jails/.warden-template-standard'
Mar 27 21:51:11 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs get -H origin '/mnt/pool-10HD/jails/handbrake'
Mar 27 21:51:11 NAStv manage.py: [common.pipesubr:61] Popen()ing: /sbin/zfs get -H origin '/mnt/pool-10HD/jails/plexmediaserver_1'
Mar 27 21:51:18 NAStv manage.py: [freeadmin.navtree:621] An error occurred while unserializing from http://10.0.1.203/plugins/plexmediaserver/1/_s/treemenu: No JSON object could be decoded
Mar 27 21:51:22 NAStv notifier: Performing sanity check on nginx configuration:
Mar 27 21:51:22 NAStv notifier: nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
Mar 27 21:51:22 NAStv notifier: nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Mar 28 01:51:22 NAStv devd: Executing '/etc/pccard_ether epair1a start'
Mar 27 21:51:22 NAStv epair1a: Ethernet address: 02:ff:20:00:06:0a
Mar 27 21:51:22 NAStv epair1b: Ethernet address: 02:ff:70:00:07:0b
Mar 27 21:51:22 NAStv kernel: epair1a: link state changed to UP
Mar 27 21:51:22 NAStv kernel: epair1a: link state changed to UP
Mar 27 21:51:22 NAStv kernel: epair1b: link state changed to UP
Mar 27 21:51:22 NAStv kernel: epair1b: link state changed to UP
Mar 27 21:51:22 NAStv kernel: epair1a: promiscuous mode enabled
Mar 28 01:51:22 NAStv devd: Executing '/etc/pccard_ether epair1b start'
Mar 28 01:51:22 NAStv devd: Executing '/etc/rc.d/dhclient quietstart epair1a'
Mar 27 21:51:22 NAStv kernel: ng_ether_ifnet_arrival_event: can't re-name node epair1b
Mar 27 21:51:22 NAStv kernel: ng_ether_ifnet_arrival_event: can't re-name node epair1b


I have to go into the jail and manually run dhclient:
Code:
root@handbrake:/ # ifconfig                                                   
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384             
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>                 
        inet6 ::1 prefixlen 128                                               
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1                            
        inet 127.0.0.1 netmask 0xff000000                                     
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>                             
epair1b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 
        options=8<VLAN_MTU>                                                   
        ether 02:ff:70:00:07:0b                                               
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255             
        nd6 options=9<PERFORMNUD,IFDISABLED>                                  
        media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)                   
        status: active                                                        
root@handbrake:/ # dhclient epair1b                                           
DHCPREQUEST on epair1b to 255.255.255.255 port 67                             
DHCPACK from 10.0.1.1                                                         
bound to 10.0.1.22 -- renewal in 43200 seconds.                               
root@handbrake:/ #                                 


Sorry if I missed another thread that referenced this. Otherwise, my upgrade to 9.10 has been quite smooth, so thanks for that. I am curious why I'm getting the "No JSON object could be decoded" complaints for my plex jail, but that doesn't seem to be a pressing issue.
 

Madic

Cadet
Joined
Mar 29, 2016
Messages
1
Hey, I'm having the same problem since 9.10. It occurred during the 9.10 nightlies and is still present in the stable release.
I also completely reinstalled FreeNAS, with complete wipe of the system partition and jails dataset and without restoring from backup.
Created clean jails and no jail gets an IP address unless I run the dhclient

During jail start I get the following messages in the debug.log:
Code:
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = Mounting user-supplied file-systems
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = jail -c path=/mnt/vol_raidz1/jails/emby_1 name=emby_1 host.hostname=emby_1 allow.raw_sockets=true persist vnet=new
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = Getting IPv4 address from DHCP
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = cannot intuit interface index and type for 0.0.0.0
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = inet6_enable: YES -> YES
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = ip6addrctl_enable: YES -> YES
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = add net default: gateway 192.168.1.1 fib 0: Network is unreachable
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = Starting jail with: /etc/rc
Mar 29 21:16:04 nas01 manage.py: [common.cmd:209] cmd_pipe.__init__: out = jexec 3 /usr/pbi/emby-amd64/control start DHCP 12346
Mar 29 21:16:04 nas01 manage.py: [common.cmd:211] cmd_pipe.__init__: err = chroot
Mar 29 21:16:04 nas01 manage.py: [common.cmd:211] cmd_pipe.__init__: err = exiting.
Mar 29 21:16:04 nas01 manage.py: [common.cmd:211] cmd_pipe.__init__: err = route: writing to routing socket: Network is unreachable
Mar 29 21:16:04 nas01 manage.py: [common.cmd:220] cmd_pipe.__init__: leave


And the following messages in the FreeNAS webui:
Code:
Mar 29 21:16:00 nas01 bridge0: Ethernet address: 02:45:f8:7b:fd:00
Mar 29 21:16:00 nas01 kernel: bridge0: link state changed to UP
Mar 29 21:16:00 nas01 kernel: bridge0: link state changed to UP
Mar 29 21:16:00 nas01 kernel: vmx0: promiscuous mode enabled
Mar 29 21:16:00 nas01 epair0a: Ethernet address: 02:ff:20:00:05:0a
Mar 29 21:16:00 nas01 epair0b: Ethernet address: 02:ff:70:00:06:0b
Mar 29 21:16:00 nas01 kernel: epair0a: link state changed to UP
Mar 29 21:16:00 nas01 kernel: epair0a: link state changed to UP
Mar 29 21:16:00 nas01 kernel: epair0b: link state changed to UP
Mar 29 21:16:00 nas01 kernel: epair0b: link state changed to UP
Mar 29 21:16:00 nas01 kernel: epair0a: promiscuous mode enabled
Mar 29 19:16:00 nas01 devd: Executi.ng '/etc/pccard_ether epair0a start'
Mar 29 19:16:00 nas01 devd: Executing '/etc/pccard_ether epair0b start'
Mar 29 19:16:00 nas01 devd: Executing '/etc/rc.d/dhclient quietstart epair0a'
Mar 29 21:16:00 nas01 kernel: ng_ether_ifnet_arrival_event: can't re-name node epair0b
Mar 29 21:16:00 nas01 kernel: ng_ether_ifnet_arrival_event: can't re-name node epair0b


As mentioned in 9.3 everything worked, promiscuous mode is also available
 
Last edited by a moderator:

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
I am also having this problem with my jails after upgrading to 9.10 STABLE. I didn't recreate my jails so they're still on the older template. Something is going wrong with IP assignment but I can't work it out, and I can't start the crashplan plugin (3.6.3_1).

In the following output, I've replaced the MAC of the FreeNAS system with ***mac3***. FreeNAS has the IP 192.168.1.206.

***mac1*** and ***mac2*** are two other MAC addresses that appear in the logs, which I don't recognise; they're not assigned to any of my other jails.

The MAC address assigned to the crashplan jail does not appear in this output. It should have the IP address 192.168.1.208 (correctly assigned by dhclient, see below).

Here is an example of the output in /var/log/messages when I restart my crashplan jail:

Code:
Mar 30 00:26:44 nas epair0a: Ethernet address: ***mac1***
Mar 30 00:26:44 nas epair0b: Ethernet address: ***mac2***
Mar 30 00:26:44 nas kernel: epair0a: link state changed to UP
Mar 30 00:26:44 nas kernel: epair0a: link state changed to UP
Mar 30 00:26:44 nas kernel: epair0b: link state changed to UP
Mar 30 00:26:44 nas kernel: epair0b: link state changed to UP
Mar 30 00:26:44 nas kernel: epair0a: promiscuous mode enabled
Mar 29 22:26:44 nas devd: Executing '/etc/pccard_ether epair0b start'
Mar 29 22:26:44 nas devd: Executing '/etc/rc.d/dhclient quietstart epair0a'
Mar 30 00:26:44 nas kernel: ng_ether_ifnet_arrival_event: can't re-name node epair0b
Mar 30 00:26:44 nas kernel: ng_ether_ifnet_arrival_event: can't re-name node epair0b
Mar 30 00:26:56 nas manage.py: [freeadmin.navtree:621] An error occurred while unserializing from http://192.168.1.206/plugins/crashplan/1/_s/treemenu: No JSON object could be decoded


Entering the crashplan jail and running dhclient epair0b gives me the correct IP for the jail:

Code:
DHCPREQUEST on epair0b to 255.255.255.255 port 67
DHCPACK from 192.168.1.100
bound to 192.168.1.208 -- renewal in 21600 seconds.


When I try to start the plugin I get the following output in /var/log/messages:

Code:
Mar 30 00:31:47 nas kernel: arp: 192.168.1.206 moved from ***mac1*** to ***mac3*** on epair4b
Mar 30 00:31:47 nas manage.py: [freeadmin.navtree:621] An error occurred while unserializing from http://192.168.1.206/plugins/crashplan/1/_s/treemenu: No JSON object could be decoded
Mar 30 00:31:59 nas manage.py: [plugins.utils:91] Couldn't retrieve http://192.168.1.206/plugins/crashplan/1/_s/status: No JSON object could be decoded


I'd appreciate any suggestions, because my backups are not running since I can't start crashplan :S
 

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
Thanks for the reply.

I didn't have these problems in 9.3.1 and I haven't changed my network configuration.

My jails get the correct IPs from DHCP when FreeNAS is rebooted, but not when the jail is [re]started from the FreeNAS GUI. I'm not sure if that is consistent with network misconfiguration...?

I can ping google.com and my router from the jail CLI after rebooting FreeNAS.
 

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
Hmm OK, I looked in Network -> Network Summary and I saw that "Default route" was blank ("Nameserver" is present & correct).

I configured IPv4 Default Gateway in Network -> Global Configuration and it my jails now get the correct IP when restarted from the FreeNAS GUI.

Is there a reason FreeNAS doesn't use the default gateway assigned by DHCP? Has this behaviour changed since FreeNAS 9.3.1?
 
D

dlavigne

Guest
Has this behaviour changed since FreeNAS 9.3.1?

That is possible, if there were changes in dhclient between FreeBSD 9.x and 10.x.
 

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
OK. I'll wait and see if anything changes in the next update (there is already a bug report including "other network issues") and report it as a bug otherwise.

Thanks for the help and sorry about the thread hijack... don't know if the missing default gateway relates to the problem the other posters were having.
 

riktam

Dabbler
Joined
Dec 16, 2012
Messages
15
Hi,
I have the same problem, In my case seems to be connected with having 2 NICs and only having a cable on the second NIC.
Look at this log entry :Executing '/etc/rc.d/dhclient quietstart epair0a'
Sometimes the jail is trying to call dhclient on a wrong or unexisting epair interface.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Is there a reason FreeNAS doesn't use the default gateway assigned by DHCP? Has this behaviour changed since FreeNAS 9.3.1?
For the record, ever since day one for me in FreeNAS, I always thought there was something a bit odd about how the DHCP information on the nameservers and gateway were captured and parsed and inserted into the configuration. I don't remember specifically what incident caused me to think that, but, I do this, and have never had such a problem since:

  • Static lease my FreeNAS box on some fixed IP address in the router's DHCP table
  • Tell the FreeNAS box that his gateway is that router, in network->global
  • Tell the FreeNAS box that his nameservers are specific ones I desire, in network->global
  • Then, set FreeNAS to DHCP its network information
Because of step 1, it always gets the same LAN IP assignment from the router. Because of the remaining steps, it doesn't try to set its gateway or DNS from the DHCP reply it gets from the router.

And, I don't use DHCP on my jails; I reserve a chunk of IP address space in the subnet away from the router, and I manually set fixed IP addresses in that range for the jails.

And I've never had a problem.
 

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
Yeah, I can see how that is a more robust setup. I'm lazy so I like to have my static IPs and DNS configured in one place (openwrt on my router) and let DHCP do its thing, and that was definitely working prior to 9.10.
 

twk95

Dabbler
Joined
Oct 27, 2015
Messages
15
I can confirm 9.10 does not play well with DHCP and jails. Works fine on 9.3 and when I upgrade to 9.10, any existing jails work fine but if I add a new jail, they don't get an IP from my router right away unless i run dhclient epairxx within the jail. Hope it gets fixed soon!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Has anyone put in a bug ticket on this issue? Seems to be something that could be fixed very easily.
 

Tom_

Explorer
Joined
Jan 4, 2015
Messages
62
I'll report it and post the issue number here if it's not fixed in the next update.
 

zuzuzzzip

Dabbler
Joined
Apr 4, 2016
Messages
28
I'm having this issue on a clean install, with new jails and even no DHCP...
I cannot start the plugin from the interface, nor the cli.

I can access my network from within the jail, though.
Only thing that's not what's supposed to be is that the hostnmae of my NAS is not resolveable.

edit: Apparently there are some issues with lagg and jails, I think I'm running into this issue.
 
Last edited:

ICANSEEYOU7687

Dabbler
Joined
Nov 25, 2011
Messages
10
It looks like this thread is getting plenty of attention, but I just wanted to add my info for some more weight.

I am having an identical issue, but running dhclient epairXX after jexec'ing into the jails clears it up for me. I just manually have to do it if I make any network changes.
 
Status
Not open for further replies.
Top