Re: Subnet, DHCP and DNS Config
Posted: 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.
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.