[Freedombox-discuss] dnsmasq and dhcp-hosts

A. F. Cano afc54 at comcast.net
Fri Sep 29 22:25:54 BST 2023

Having found this:


and noticing that FreedomBox already runs dnsmasq to provide the DHCP service
to the internal networks:

$ ps aux | grep dns
nobody      4638  0.0  0.1  12188  4736 ?        S    15:55   0:00 /usr/sbin/dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address= --dhcp-range=,,60m --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-enp2s0.leases --pid-file=/run/nm-dnsmasq-enp2s0.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d
nobody      4699  0.0  0.1  12188  4608 ?        S    15:55   0:00 /usr/sbin/dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address= --dhcp-range=,,60m --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-enp3s0.leases --pid-file=/run/nm-dnsmasq-enp3s0.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d

The last option:  --conf-dir=/etc/NetworkManager/dnsmasq-shared.d  seems to
give the possibility of adding some additional configuration there.  I created
a file in that directory called dnsmasq.conf, that contained this:


and then added this hosts file that contained the names of the 2 computers
connected to this testing FreedomBox; just the names, no IP addresses or other
options, one on each internal interface.  Upon reboot these two processes had
not started, making the FreedomBox inaccessible.

After manually configuring the interface on one of the computers, logging in
via ssh and removing the 2 files, the processes eventually started.

Is this the expected behavior?

Additionally, just turning on the BIND app in System -> BIND page has the
same result.  No DHCP processes and thus no access from the internal networks.

Is this also expected?  This is before I put those 2 files in dnsmasq-shared.d.

Ideally, it would make sense that, since DHCP gets the information of connected
computers, dnsmasq would save the names of all the computers it knows about on
the internal networks and make them available, so that any commands that
require name resolution from internal networks would receive that information.

Thus, from any computer on any internal network, ssh <name of any other
computer on any internal network> would work.

Second best situation: the static hosts file as described above.  But that
doesn't work either.  Am I misreading how this works or is supposed to work?

Of course there's also the bridging between internal interfaces issue that I've
already described that, without it, doesn't allow ssh from one subnet to the
other even when using numerical IP addresses.

One final, unrelated point.  It appears that the APU2 has an additional issue
with rebooting.  I've described previously how it won't boot from the internal
SD card slot, even after upgrading the BIOS to the latest available.  Now it
seems that rebooting without going to a full shutdown and pulling the plug,
such as when selecting "Restart" from the FreedomBox menu, gets it into a
reboot loop that never finishes.  After a minute or so, all 3 lights go on,
again and again, as happens when power is first applied.  I have tried to
register to the PC Engines development forum (https://forum.pcengines.dev/)
to post there, but I never get the email code to complete the registration:
"Your user account is not activated yet.  You must complete the activation
process first".


More information about the Freedombox-discuss mailing list