Subnet, DHCP and DNS Config

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

Subnet, DHCP and DNS Config

Postby cyberbuck » Thu Jan 07, 2021 4:51 pm

Hello everybody,

after a long break i returned to Amahi, but i have a few problems with Amahi's networking.

I recon that Amahi understands itself as your all-in-one home server solution including DHCP and DNS, but that makes it impossible for me to integrate it with my network it seems. Maybe someone has an advice how to solve my situation:



My Home Network:
10.0.0.0/20
Subnet: 255.255.240.0

I am using that IP Range for different reasons and it is not an option to change this. I have a lot of IOT stuff going on and my whole family with a bunch of different devices each as well as a bunch of connected stuff like TVs, Radios and whatnot.

I have a router that acts as my gateway (10.0.1.8) and a standalone DHCP/DNS Server (10.0.2.4). It is no option to have another device as DHCP/DNS.

The Server i want to run Amahi on is a PC that will get 10.0.2.10 from my DHCP and "DS10.familydomain.local" as DNS, but I would not mind the server going hardwired/static to this very IP - the DNS will lead there anyway.



What I did until my problem started:
1:
I installed Fedora 31 after trouble with the Installation of 27. The trouble was not a 27 problem, but i kept 31 after i solved my issue. Fedora was up and running smoothly, including my network config. I would consider to go back to Fedora 27, but i do not see a problem with the version so far.
2:
I installed Amahi as the step by step guide recommended. That is where the fun began: the online tool that creates my config code did not allow me to set my IP config right, but it promised Amahi will figure it out by itself if something is not right. The installation ended ok, i rebooted and...


My Problem:
...my server virtualy vanished. that means it is unreachable by IP and DNS. No SSH, no https, nothing. The reason was easily found: Amahi changed the network config to the useless stuff i could enter into the online tool and guessed the subnet to be 255.255.255.0



What I did to try to solve that:
logged in localy and changed the network settings manual using fedora nmcli. after all settings were good, i rebooted. but nothing changed. Amahi has reset my network config again to the useless config it is guessing.

"Ok" I thought and searched the wiki and forum for a way to tell Amahi the correct settings and to disable Amahi's DHCP and DNS. What I learned is that i shall use the Webgui to do so - ha ha nice joke. i cannot reach the webgui. I also found a thread in the forum that goes back to 2014 that told me that the subnet is not optional for Amahi (really?). I found documentations for CLI tools that will allow me to change the IP but not the subnet.





is that so? is Amahi unable to let go of the servers network config? Or is there a way that i just have not found yet? all i would need right now is:
-disable DHCP service from Amahi
-setup the right IP and Subnet for networking, preferably as DHCP Client, but static, if necessary, is ok too.
-disable DNS service from Amahi, but keeping it enabled is ok as it seems that Amahi needs it's own DNS for whatever reason.



Thanks for reading guys :) Maybe someone can help or tell me that this is a lost case.

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Thu Jan 07, 2021 5:33 pm

1:
I installed Fedora 31 after trouble with the Installation of 27. The trouble was not a 27 problem, but i kept 31 after i solved my issue. Fedora was up and running smoothly, including my network config. I would consider to go back to Fedora 27, but i do not see a problem with the version so far.
Amahi does not support Fedora 31. Currently it’s Fedora 27 ONLY.

We cannot provide any support if you do not use the correct OS version. Amahi 11 is only designed for Fedora 27.

Recommend you start over using the correct OS and install instructions from Amahi Docs. Once you do that, we can address the issues you have with your network.

Also, see the Amahi FAQ which may answer som of your network questions. You may find Amahi will not work for you.
ßî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 » Thu Jan 07, 2021 6:40 pm

Thanks for your reply!

I actually did go back to 27 in the meantime and installed Amahi again. As before i used the instructions from Amahi docs. The issue however is unchanged. Amahi will overwrite manual changes to networking and force the mashine to use wrong IP and subnet. Any ideas?

best regards

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Thu Jan 07, 2021 6:59 pm

Ok, that’s good.

Yes Amahi controls the network and that file cannot be changed.

However, you can program a fixed IP address and subnet in the /etc/sysconfig/network-scripts/ifcfg-INTERFACENAME. This should fix your issue with the wrong network address.

The following will display the interface name:

Code: Select all

ip address
It’s usually something like ensp0.

Once the dashboard (http://hda or http://IP ADDRESS) is available, you can set the Gateway last digit and disable DHCP. DNS server cannot be disabled, but can point it to a different DNS server if you choose.

Keep in mind you will lose functionality by not using the HDA as your DHCP server. The FAQ I listed in the last post will provide details. Apps will not work is the biggest one.

Hope that helps.
ßî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 » Fri Jan 08, 2021 1:56 am

Thank you very much! I will try this out asap.

Yes, the possible problems with Apps after turning DHCP off was stated pretty clear in the docs, but that is something I will either find a workaround for or live with.

What exactly does DHCP do for those Apps? Maybe I can build a band aid for that in my own DHCP Server. I would at least give it a try. Does Amahi use own functionality or maybe dnsmasq for DHCP? If so I think I could easily build a sync to my central DHCP which is based on dnsmasq.

Thank you and best regards!

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Fri Jan 08, 2021 6:49 pm

What exactly does DHCP do for those Apps?
I am not sure how it affects apps. I think it's more the DNS that is needed for apps to work.
Does Amahi use own functionality or maybe dnsmasq for DHCP?
Amahi used dnsmasq for DHCP and DNS.

I would think that if the DHCP server was using Amahi for DNS, apps would work. Seems logical as I cannot understand how DHCP could be the connection.

If you come up with a solution, please let us know. Might be something we can document in the wiki. I am sure there are many who would rather use their own DHCP server, but wouldn't mind letting Amahi control the DNS. Especially since you can point Amahi to any DNS server.
ßî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 » Sat Jan 09, 2021 4:04 pm

As far as I can tell from playing around a bit, the DHCP of Amahi does nothing vital for other functions of Amahi. The DNS part on the other side is vital for Amahis handling of app containers and webapps. Amahi uses an apache webserver with virtual hosts for each app. Each virtual host is bound to a certain DNS name. The target here seems to be to gain a maximum ease of use for users.

For example the app "monitorix": once you install that app, it is installed as an apache webapp with it's own virtual host that is bound to the DNS name "monitorix". The result is, that a user can open a browser, type "http://monitorix" and will see the monitorix app on the hda.

For apps that come in a container (docker) apache reverse proxies to the port of that container, depending on the DNS used to call the hda on port 80.

Thereby all apps can be served via port 80 on the mashine and the user does not need to struggle with different ports or long URLs. Seems to be a good way to give users easy access to different apps as long as there is only one server in the network, which usualy is the case for your average home network and the target scenario of Amahi as far as i understand.

My first ideas to integrate this with my existing scenario are:

1.) build a sync service that will make sure all the Amahi DNS names will be known by my DNS server
2.) telling my DNS to use Amahi as it's first DNS source before contacting online DNS, so requests my DNS can't answer will be answered by Amahi DNS first. (my favorite so far)
3.) bypass the DNS bindings in the Apache conf and replace it with URL based bindings or adding URL bindings on top for a certain DNS, maybe "hda" (that one would come with the most struggle and would need some testing when it comes to URL/path genreation inside of each app and possible interference with Amahi keeping those entries up to date like i experienced with the IP/Subnet situation. so maybe this one is a dead end, but i will give it a try.)

whatever i will come up with in the end, i will let you know and be glad to provide you with informations, if they are of interest for you or other users.

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Sat Jan 09, 2021 5:16 pm

Yes you are correct. I know a lot about Amahi inner workings as I am the App Manager, but was not sure how DHCP affected things.

We’d definitely be interested in your solution as we might be able to package it as an app that would give users the option to use their own DHCP and DNS server versus turning it over to the Amahi platform.

The one thing that Amahi DHCP provides is for the Amahi PXE server but I have a solution that will allow users to use their own DHCP server and still have PXE server with Amahi. Not that this feature is used by many anyway lol

Hopefully your solution will be easily integrated with the Amahi platform. I look forward to hearing the results.
ßî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 » Sat Jan 09, 2021 6:29 pm

I just stumbled into another problem with the IP/Subnet config. Changes in /etc/sysconfig/network-scripts/ifcfg-[interface] only survive reboots, but will be overwritten after shutdowns. Is there something else i need to do in order to have my IP settings persistant without being overwritten at ocasions by Amahi?

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

Re: Subnet, DHCP and DNS Config

Postby bigfoot65 » Sat Jan 09, 2021 6:49 pm

All settings are recorded in the Mariadb database.

You may be able to change them there.

Look for the hda_production database. Can’t remember what tables, but shouldn’t be too hard to find.

I believe making the changes there will prevent files being overwritten. Don’t recall, but I think the files might be generated using those settings.

Worth a shot.
ßî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 3 guests