9.3 Jail DHCP MAC trouble

Status
Not open for further replies.

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
I am testing out 9.3 and DHCP jails. excited by the possibility of using DHCP/DNS on my network to connect to my jails rather than setting a static ip in FreeNAS and then setting a separate static entry in the DNS server and then relying on humans to make sure they stay in sync.

A step by step breakdown of what I have tried, what I expected and what I got.

1. install fresh FreeNAS 9.3
installed from ISO as expected

2. Under Jails > Configuration set Jail root and checked IPv4 DHCP
settings saved without error

3. Installed plexmediaserver plugin
plugin installed and IPv4 field in Jails tab shows DHCP:192.168.0.100 as expected

4. from external machine ping plexmediaserver_1
plexmediaserver_1 resolves to and is able to ping 192.168.0.100 as expected

5. from shell on plexmediaserver_1 edit /etc/rc.conf to change hostname="plexmediaserver_1" to hostname="USZVideo_1", then exit-restart jail-reopen shell
hostname now shows USZVideo_1 in jail

6 from external machine ping USZVideo_1
cannot resolve USZVideo_1 Expected to resolve and ping 192.168.0.100

7 from external machine flush dns cache and ping plexmediaserver_1

plexmediaserver_1 resolves and pings 192.168.0.100 Expected name to not resolve

8 Suspecting networking gear is caching mac info causing the error I stop the jail and change the MAC

No error, but IPv4 field is now blank. Expected to show DHCP like an unmodified stopped DHCP jail

9. start jail and run ifconfig from the jail shell

outputs all interfaces (freenas physical interfaces, epaira interfaces) as though run from a FreeNAS shell Expected to see only lo and epair1b

9 Edit Jail properties again

MAC field is blank. Expected MAC to be saved

10 stop jail, enter new MAC and save again and reopen edit box
MAC field is now populated as expected

11. restart Jail and run ifconfig from the jail shell

ouputs lo and epair1b but no IP address expected lo epair1b and a DHCP address

12 run dhclient epair1b from jail shell
jail gets DHCP address as expected

13 from external machine flush dns cache and ping plexmediaserver_1 and USZVideo_1

neither name resolves expected USZVideo_1 to resolve to jail IP and ping

Am I doing something boneheaded?
I can provide more detail or try other things.
Can anyone else reproduce? Should I put in tickets for and/all :

1. DHCP behaves as disabled after modifying MAC (DHCP is still checked)
2. MAC field is blank after modifying and saving
3. Starting jail with empty MAC returns FreeNAS interfaces (VIMAGE is still checked)
4. Changing hostname in jail /etc/rc.conf does not change the hostname used by dhclient.

?

Many thanks!
 

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
I've been retrying this and I have found that after changing the MAC in step 8 if I check the .plexmediaserver_1.meta folder that the vnet file is missing and the ipv4 file has changed from DHCP to /24 Also the new MAC is in the mac file

when I restored the vnet file and changed the ipv4 file back to DHCP the machine was able to boot DHCP as expected once again.
entered ticket https://bugs.freenas.org/issues/7187 for this issue



Still does not use the hostname entry in the jail's /etc/rc.conf for DHCP
Any ideas?
 
Last edited:

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
Through wild googling and flailing I have found that I can set
send host-name "USZVideo_1";
in /etc/dhclient.conf and get USZVideo_1 to resolve to the DHCP address.
Good as a new feature request or make it a note on https://bugs.freenas.org/issues/4195 ?
 

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
Seems we should be able to use dhclient-script to set the hostname in dhclient.conf but my flailing is falling short. Anyone have expertise with dhclient-script ?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Not to hijack your thread, but why would you want to do this? Why not just use a static IP and be done with it?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Why didn't you just name the Jail what you wanted from the beginning. I think the mucking around in the CLI is a disaster waiting to happen. And finally, have you looked at your DHCP and DNS servers to see if they are getting updated requests and hostnames?
 

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
@pshatz100 on my network gear static IPs means three separate lists that need to be maintained by hand, the MAC to static IP filter list, the hostname to IP DNS list and the IP to Jail list in FreeNAS. In my experience having multiple lists that depend on people to keep them in sync and not mess them up is asking for trouble. With DHCP there are no lists that need manual intervention to keep syncronized.

@dpasseg When I do plain Jails I do, but this was a plugin. And after setting the send host-name option in the plugin, the DHCP server was getting the hostname in the request and registering it with DNS.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I don't know how you have your network set up, but:

1) With static IP's you don't need to use hostnames - just use the IP address. If it is in a link or browser bookmark then it won't matter at all. For a Plex client, this is very simple to do, and 2) Not certain what you mean by a MAC to static IP filter list. With static IP's you won't be filtering MAC addresses

I have a fairly sophisticated network and use DHCP for computers and phones that come and go. Servers and jails use static IP's and everything just works. Set it up once, and it's done (I don't change the server IP's very often.) I have not bothered with all that complicated jail configuration such as you described. I like to keep my life simple.
 

mstinaff

Dabbler
Joined
Jan 21, 2014
Messages
34
I do have everything set up with static IPs right now and it does work, but I have some things like an nginx reverse proxy set up and a few other services that need to reference other servers. In my experience using hostnames instead of IPs makes the config files more readable and less prone to error.

On my network the security appliance lets systems connect out only if:
1 it is a DHCP address that it has assigned to a MAC or
2 it is a static IP that has been hand paired with a MAC in the appliance.

For my setup a line or two of changes per plugin makes configuration of everything else so much less complicated. A good trade off for me (even better if the Jail info box had a Hostname field ;) )
 

AngeleToR

Dabbler
Joined
Dec 9, 2014
Messages
22
I can only agree with you mstinaff... I'm hitting my head against a wall trying to make DHCP to work with plugins. I¡ve found as you that it works well with jails alone, but plugins get screwed. You've get much further than my troubleshooting it, I'll try your workarounds until DHCP gets fixed in the plugins systems.

Regarding the question: Why don't you use just static IPs and forget about troubles??? you're being asked, I agree with you that maintaining ONE MAC->IP list in the router is the easiest way to go. AND, if the interface gives you the option to use DHCP and MACs and it fails, it should be fixed or the option removed, as it's not working as intended.

Anyway, being new to freeNAS coming from Ubuntu I'm more than happy with the performance and stability it offers, these are just minor (but annoying) problems.

I will follow your thread and bug report closely ;-)
 

AngeleToR

Dabbler
Joined
Dec 9, 2014
Messages
22
Man, you're the best!!!! Just followed your steps as described in the bug report and voila!!!! Everything working as intended!!! I just need to be careful not to use the web gui for anything network related with the plugins until developers fix the issue and my system will work as expected.

I can't thank you enough for your help!!!

Best Regards, Angel
 
Status
Not open for further replies.
Top