Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4716

Advanced users • Multiple ip addresses with dnsmasq (edited for clarity)

$
0
0
Some background.

I have dnsmasq running on a Pi as a DNS/DHCP server (obviously, that Pi has a static address configured).
I have some machines that only connect wirelessly, and some that only connect wired to the network, so no issues there, I have dhcp-host lines for each of them with a 'reserved' IP4 address so none of them move around the network.

However, I now want to connect a Pi5 both wired and wirelessly.
If I have two dhcp-host lines in there, one for the wired and one for the wireless interface, I can see that the pi gets both addresses as expected, both in ip addr show and hostname -I output.

From other machines, I only seem to be able to get one host address for that hostname, and if I use nslookup against the dnsmasq machine for that host, it only shows me one address, not two as I would expect.

Am I missing something obvious?
I am setting the addresses by using dhcp-host lines, as in:

Code:

dhcp-host=2c:cf:67:27:06:a3,192.9.200.132dhcp-host=2c:cf:67:27:06:a5,192.9.200.133
You may wonder why it matters?
Two reasons. Some of my software deals with multiple IP addresses, and will attempt connections on the addresses in turn until either it runs out of options, or succeeds in connecting. Can't do this if I only have one address!
Secondly, the address returned from dnsmasq is usually the WiFi address, not the wired address.
My guess is because the WiFi has to start up, find an AP and then negotiate the lease, it takes longer that the wired connection, so it is always the second to finish, and overwrites the previous host entry, but without digging through the source....

Since I have gigabit cabling/switches etc, but not gigabit WiFi, this makes a difference to performance when I am shifting large volumes of data between the machines. Obviously NOT an issue when only machines with WiFi connect to it, but it does mean the WiFi is busier generally.

So in essence, can dnsmasq handle the fact that the same host can ask for multiple leases?
If so, how do I correctly configure that, and if not, what are my alternatives?

I run local DNS/DHCP services because the firmware on my ISP's router really isn't up to supporting our "home" environment (which I grant, is a little unusual, having in excess of 100 networked devices), as it tends to randomly disconnect devices when the internal limits to number of clients gets exceeded.

Thanks for any guidance.

Statistics: Posted by SteveSpencer — Sun Jun 09, 2024 9:36 pm — Replies 0 — Views 38



Viewing all articles
Browse latest Browse all 4716

Trending Articles