Subnet, DHCP and DNS Config

cyberbuck
Posts: 7
Joined: Thu Jan 07, 2021 4:02 pm

Re: Subnet, DHCP and DNS Config

Postby cyberbuck » Sun Jan 10, 2021 12:18 pm

Thanks again! And respect for the fast and friendly support!

I found the config params in the database. The IP is stored in 2 parts there and that is a little problem. it stores the first 3 bytes (in my case "10.0.1") in one entry that is used for both hda IP and gateway IP. the last byte of each of these IPs is stored in one more entry for each ("8" and "10" in my case). The problem with that is, that my hda is supposed to use 10.0.2.10 while my gateway has 10.0.1.8. similar scenarios are pretty common for a lot of class A,B and C home networks.it would be wiser to just store the 2 IPs completely in one entry each and have them not being dependent on each other.

however this problem was solved quite easily, since amahi seems to just join both IP part entries with a ".". i changed "10.0.1" to "10.0" and then used "1.8" for my gateway and "2.10" for my hda. save, restart, shutdown, boot. it works. so far so good.

but there is another problem. the same table that stores the IPs also stores the subnet as "255.255.255.0". however changing that to "255.255.240.0" does not affect the update of the network settings during or after a shutdown. the subnet itself is not part of fedoras network config it seems. fedora just saves the prefix/network portion. that is 24 bit for "255.255.255.0" or in my case 20 bit for "255.255.240.0". since this value is obviously not extracted from the subnet in the settings table, i looked further and found that /usr/bin/hda-change-network is used to setup fedora's network settings. this ruby script has the prefix 24 hardwired in it. changing it to 20 works just fine. so far so good.

but there is another but that i was not able to solve yet. that is the 2 DNS servers that Amahi insists to use. they seem to be hardwired in whatever it is that calls hda-change-network. changing them in the database settings table does affect this. that is a problem, because amahi is not able to reach the rest of my network via DNS. it is supposed to just use my own DNS which talks to the internet if necessary, i could of course hardwire them in hda-change-network, but that does not seem to be a good end solution.



to be honest, the easiest solution would be to just give Amahi the option to be a DHCP Client instead of hardwiring static IP config into fedora. I have tried this by bypassing Amahi's efforts and it works like a charm. transfering the DNS entries from Amahi's database to my DNS also makes the DNS based app system work. Is there any chance for this to make it into Amahi?

I am not sure if it is a good idea to have Amahi running with a bunch of workarounds that potentialy need to be upgraded or repeated with every Amahi update.

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Sun Jan 10, 2021 1:49 pm

to be honest, the easiest solution would be to just give Amahi the option to be a DHCP Client instead of hardwiring static IP config into fedora. I have tried this by bypassing Amahi's efforts and it works like a charm. transfering the DNS entries from Amahi's database to my DNS also makes the DNS based app system work. Is there any chance for this to make it into Amahi?
You can suggest changes to Amahi. Best way is to check out the code and make the changes you did as a patch. Also you could try to catch the developer in the IRC chat and discuss there as well. It would be a nice alternative to have the capability for users to choose between their DHCP/DNS server and Amahi without losing the functionality of apps. That is something that drives many to use the Amahi DHCP/DNS. They want to use apps mostly.
I am not sure if it is a good idea to have Amahi running with a bunch of workarounds that potentialy need to be upgraded or repeated with every Amahi update.
I agree if there is a better more efficient way to make it work. Unfortunately, Amahi updates are not done often with a specific OS. Typically they come when a new Fedora OS platform is launched. Sadly, we cannot seem to move quick enough to get it done without skipping multiple Fedora versions. This is largely due to the fact we have such a small team, one developer and me most of the time.

Is this something you could write up a tutorial and put it in the wiki? I would be happy to assist, but it might also help the developer understand the solution. Then we might be able to implement some of this in the next platform release.
ßîgƒσστ65
Applications Manager

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

cyberbuck
Posts: 7
Joined: Thu Jan 07, 2021 4:02 pm

Re: Subnet, DHCP and DNS Config

Postby cyberbuck » Sun Jan 10, 2021 5:37 pm

i took a closer look to the network settings and the sources of them. my dns server problem is now gone since amahi sets the dns server acording the chosen vendor. in my case i needed to choose "custom" and now amahi does what i want regarding the dns settings.

i also think i can code some changes to give amahi an dhcp client option. i will give it a try once i am done integrating amahi as it is into my network. as soon as i have a usable result, i will contact you. if you find it usefull, i will be glad to contribute it.

for the moment i did a rather harsh workaround for my networking issues: i replaced the ruby script that sets up network settings in fedora with a dummy script. so for the moment amahi simplay can't interfere with my manual settings. this will be obsolete once i coded those changes.

anyway: thanks for your support. i really start to like this project.

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Sun Jan 10, 2021 8:39 pm

Glad things have worked out for you. Nice that you have Amahi working as you needed.
i also think i can code some changes to give amahi an dhcp client option. i will give it a try once i am done integrating amahi as it is into my network. as soon as i have a usable result, i will contact you. if you find it usefull, i will be glad to contribute it.
I believe it would be a nice option for Amahi if you can make it work without users needing to do much to their network. That's our goal, keep home networking simple :)

Thanks for the info and hopefully we can get this added to the next release. Amahi 12 will be on Fedora 33, which is the latest Fedora OS.
ßî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 9 guests