Page 1 of 1

DHCP Server Settings....specifically ip range

Posted: Thu Apr 19, 2012 7:18 pm
by iamwally
Is there anyway to set the ip distribution range of the Amahi DHCP server?

Thanks,

John

Re: DHCP Server Settings....specifically ip range

Posted: Fri Apr 20, 2012 4:41 am
by bigfoot65
Not at this time. All static IPs are restricted to less than 100. DHCP provides leased for IP range of 100-255. There is a feature request established, but it may be a while before we get to it.

What are you trying to do? If it's to control what IPs your machines receive, set them as static. That will ensure they get the same one every time.

Re: DHCP Server Settings....specifically ip range

Posted: Fri Jan 30, 2015 6:20 am
by PatrickDickey
Out of curiosity, has this been worked on since the thread was started?

Also what controls the range? If it's something that's set in the hda-ctl script (or another script), I'd like to take a shot at customizing it. My reasons are that I may want to set up a backup dhcp server, in case amahi crashes. Right now, I have another computer handling the dhcp and dns for my network, but I'd like to add some redundancy. Plus there's no reason to have a range of 154 computers (as .255 is typically a broadcast address), if you only have 20 devices on the network.

Have a great day.:)
Patrick.

P.S. Yes, I realize this isn't a supported option--I'm willing to assume the risks, and fix my own mistakes down the road.

Re: DHCP Server Settings....specifically ip range

Posted: Fri Jan 30, 2015 8:09 am
by bigfoot65
Not sure, but I think this may be coded in the Fedora DHCP server configuration. I do not have access to my HDA currently to poke at it.

This would be something good to add to the wiki once sorted out.

Re: DHCP Server Settings....specifically ip range

Posted: Sat Jan 31, 2015 8:21 am
by PatrickDickey
Not sure, but I think this may be coded in the Fedora DHCP server configuration. I do not have access to my HDA currently to poke at it.

This would be something good to add to the wiki once sorted out.
In Amahi 7, you were using dnsmasq, correct? So something tells dnsmasq to configure dhcp to use this range. That's what I'm looking for. That way I can change the range, as necessary. I know it's stored in dnsmasq.conf or in amahi-dhcp.conf inside of the dnsmasq.d directory. But is it hda-ctl that sets it up?

Have a great day, and thanks for the reply. :)
Patrick.

Re: DHCP Server Settings....specifically ip range

Posted: Sat Jan 31, 2015 8:51 am
by bigfoot65
Ok looks like there is some capability in hda-ctl to manually configure the DHCP range settings.
# NOTE: You can change default settings by creating /etc/hda-ctl.conf
# and putting perl variable assignments there, like for example:
#
# $DEVICE = "eth0";
# $NETMASK_SIZE = "24";
# $NET_START = "0";
# $DYN_LO = "100";
# $DYN_HI = "254";
# $DHCP_LEASE = "14400";
# $use_opendns_secondary = 0;
# $use_dnsmasq_dns = 0;
# $use_dnsmasq_dhcp = 0;
# $dnsmasq_resolve_catch_all = 0;
#
# the file is interpreted as perl, so do not break it!
# note that if these settings are in the database, those always take priority when the program starts
These variables are set in hda-ctl as noted, so creating hda-ctl.conf and changing them should allow you to change the range at which DHCP starts.

Many of these variables are in the database, so changing them would require updating the "settings" table in hda_production. However, I do not see the DHCP range there, so making the change in the file should override the default setting.

Re: DHCP Server Settings....specifically ip range

Posted: Sat Jan 31, 2015 1:27 pm
by PatrickDickey
Ok looks like there is some capability in hda-ctl to manually configure the DHCP range settings.
# NOTE: You can change default settings by creating /etc/hda-ctl.conf
# and putting perl variable assignments there, like for example:
#
# $DEVICE = "eth0";
# $NETMASK_SIZE = "24";
# $NET_START = "0";
# $DYN_LO = "100";
# $DYN_HI = "254";
# $DHCP_LEASE = "14400";
# $use_opendns_secondary = 0;
# $use_dnsmasq_dns = 0;
# $use_dnsmasq_dhcp = 0;
# $dnsmasq_resolve_catch_all = 0;
#
# the file is interpreted as perl, so do not break it!
# note that if these settings are in the database, those always take priority when the program starts
These variables are set in hda-ctl as noted, so creating hda-ctl.conf and changing them should allow you to change the range at which DHCP starts.

Many of these variables are in the database, so changing them would require updating the "settings" table in hda_production. However, I do not see the DHCP range there, so making the change in the file should override the default setting.
So does hda-ctl run automatically, or do I need to re-run it after making the conf file? Also I'm assuming that I need to uncomment and change to "1" the use_dnsmasq_dns and use_dnsmasq_dhcp options?

Thanks, again for all of your help with this. :) Have a great day.
Patrick.

Re: DHCP Server Settings....specifically ip range

Posted: Sat Jan 31, 2015 1:33 pm
by bigfoot65
So does hda-ctl run automatically, or do I need to re-run it after making the conf file?
I would recommend restarting hda-ctl.

Code: Select all

systemctl restart hda-ctl
Also I'm assuming that I need to uncomment and change to "1" the use_dnsmasq_dns and use_dnsmasq_dhcp options?
Those need to be set via the Dashboard under Network, Settings. Pretty much any setting in the Dashboard is also in the hda_production database.

Happy to help. This might be something we should add to the wiki as well. If you have time, could you do so? We would greatly appreciate it.