Change DHCP settings on the HDA

jonathankonrad
Posts: 136
Joined: Sat Jul 25, 2009 1:42 pm

Change DHCP settings on the HDA

Postby jonathankonrad » Wed Jul 20, 2011 7:57 am

I posted part of this question on a related thread here: http://forums.amahi.org/viewtopic.php?f=8&t=2743

However, I would love to simply be able to change some of the settings of the DHCP server on the HDA. How do I do that? I would like to have it server out more DNS entries than just the one - the HDA itself. That way if the HDA is done, clients can still resolve Internet IPs and surf.

So where is the settings or how can I specify some of that? Thanks for any help.

apastor
Posts: 175
Joined: Fri Jan 14, 2011 6:58 am

Re: Change DHCP settings on the HDA

Postby apastor » Fri Jul 22, 2011 4:42 am

Log into your HDA and go to Settings > Server
Then disable DNS and DHCP.

But I heard things do not function as well when this is disabled. (Apps if i remember correctly)

For long time using Amahi as my DNS/DHCP was my only quirk as for the same reasons you have. But my ahami box has been solid so I havent had any concerns or issues.

But I do wish they did make it so you can have a full fuctioning HDA without using Amahi's DNS/DHCP services.
Proxmox Server: Currently Not Running Amahi
CPU: AMD FX 6100 Six Core
RAM: 8GB DDR3
HDD: 4x1TB RAID10 (Adaptec)

jonathankonrad
Posts: 136
Joined: Sat Jul 25, 2009 1:42 pm

Re: Change DHCP settings on the HDA

Postby jonathankonrad » Sat Aug 20, 2011 11:10 am

I do know how to turn them off. However, the DHCP function is working. I only wish to add some settings. Is there a text file I can edit?

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Change DHCP settings on the HDA

Postby bigfoot65 » Sat Aug 20, 2011 2:31 pm

Nope...not unless its something that Amahi does not control. What are you trying to do?
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

jonathankonrad
Posts: 136
Joined: Sat Jul 25, 2009 1:42 pm

Re: Change DHCP settings on the HDA

Postby jonathankonrad » Sat Aug 20, 2011 4:16 pm

I noticed that when clients on the network get an IP address that only get the HDA as available DNS. I was hoping they could get a different secondary or tertiary DNS server too.

User avatar
nalleju
Posts: 26
Joined: Mon Sep 12, 2011 1:18 am
Location: Esbo, Finland, EU
Contact:

Re: Change DHCP settings on the HDA

Postby nalleju » Mon Sep 12, 2011 5:31 am

:geek: You need to add some functions to the Amahi deamon:

Login with Putty or somthing or use Webmin

Code: Select all

nano /usr/bin/hdactl
1 add ,$DNS2 to lin 25: our ($DEVICE, $NETMASK_SIZE, $NET_START, $DYN_LO, $DYN_HI, $USE_OPENDNS_SECONDARY) shall end with , $DNS2)

Code: Select all

our ($DEVICE, $NETMASK_SIZE, $NET_START, $DYN_LO, $DYN_HI, $USE_OPENDNS_SECONDARY, $DNS2)
2 add line after my $use_opendns_secondary = 0;

Code: Select all

my $dns2 = $DNS2;
3 change line 716 from:
printf $dhcpd "\toption domain-name-servers %s, %s;\n", $dns1, $dns2;
to this (not dns1 dns1 but dns1 dns2...

Code: Select all

printf $dhcpd "\toption domain-name-servers %s, %s;\n", $dns1, $dns2;
Now set this into the conf and add add sme featurs if you want:
- range of DHCP to be 100-149
- OpenDNS as secondary

Code: Select all

nano /etc/hdactl.conf

Code: Select all

$DYN_LO = "100"; $DYN_HI = "149"; $DNS2 = "192.168.33.1"; $USE_OPENDNS_SECONDARY = 1
Take the new settings into Amahi by restarting the deamon:

Code: Select all

/etc/init.d/hdactl restart
:D Have fun

jonathankonrad
Posts: 136
Joined: Sat Jul 25, 2009 1:42 pm

Re: Change DHCP settings on the HDA

Postby jonathankonrad » Mon Sep 12, 2011 6:54 pm

I tried all of this and my windows clients still only show DNS servers;

192.168.28.10
192.168.28.10

which is the internal IP of my Amahi server. Also, there was no /etc/hdactl.conf file until I created it, but there was an /usr/bin/dhactl file which I edited as you indicated. I also changed the "192.168.33.1" to "192.168.28.10". You did not say, but I assumed this address is the address for the hda server?

Any more tips?

User avatar
nalleju
Posts: 26
Joined: Mon Sep 12, 2011 1:18 am
Location: Esbo, Finland, EU
Contact:

Re: Change DHCP settings on the HDA

Postby nalleju » Wed Sep 14, 2011 4:56 pm

You need to add yhe things I described to the file /usr/bin/hdactl in the places indicated. You are writing a program with a programming language with strict syntax. All characters do meen something.

Yes the file will be written when you edit it.

1. See that you add the variable $DNS2, if not nothing will work, you see error messges

2. this is wher it reads the valus from the file /etc/hdactl.conf
(I guess $USE_OPENDNS_SECONDARY = 0 is better for you)

3. this is where it writes the file that is to be used bu the system
(you could write the second dns address in numbers too. "192.168.28.1").

4. Restart

Use short time when testing but put back to normal otherwise you will have problems wit popping music, web apges not opening due to timeout... (I test with 144, and run 14400)

If you need to run with fixed ip's 150-254 and use the GUI yuo should put the "100" and "149" in the /usr/bin/hdactl.
If not GUI tells you they are not open for static use.

I just reboted my machine yesterday (by misstake) and its still giving the 3 local DNS addresses we have.

jonathankonrad
Posts: 136
Joined: Sat Jul 25, 2009 1:42 pm

Re: Change DHCP settings on the HDA

Postby jonathankonrad » Tue Sep 20, 2011 2:48 pm

Sorry. You lost me on this one. I did all the edits exactly as you mentioned. I understand programming syntax and how careful one must be. My comment about creating the file was not that edits would be written to a file on exit. Rather, there was no /etc/hdactl.conf to edit so I had to create the file. That had me concerned.

Anyway, the good news is I have no error messages and the box is still serving out DHCP and acting as DNS. It's also more stable so I'm not as worried about this.

I would still feel better if clients pulled more than one DNS address, but hey ... it's working.

Thanks for the tips, I just must be missing something.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: Change DHCP settings on the HDA

Postby bigfoot65 » Wed Sep 21, 2011 7:06 pm

nalleju,

This could be useful for other Amahi users. Are you willing to submit a patch to the platform to include this functionality? I think it would be a welcome addition for many.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 15 guests