AndreBL/ip6neigh

Bogus hostname 14.LL created when dhcp config has multiple MAC addresses

Opened this issue · 5 comments

I have some dhcp configs with multiple mac addresses, and it results in a bogus hostname record of 14.LL.home (where home) is the configured domain.

From /etc/config/dhcp:

config host
        option dns '1'
        option name 'server10g'
        option ip '192.168.1.51'
        option mac '<mac1> <mac2>'

In /tmp/ip6neigh.cache, I see this: <mac1> <mac2> 14 server10g
So, 14 is picked up as the name.

This does appear to be a parsing error by ip6neigh.

But I am curious, what is the use case for a host having 2 MAC addresses, but only 1 IP address? I would think this would thrash your ARP cache, or at a minimum set you up for a duplicate IP address on your network.

In my use case, I was using it when I have several NICs (two 1G ports and two 10G ports) on a machine, and I want to be able to troubleshoot things by moving the cable around. I have one name + ip for the 1G pair, and a different name + ip for the 10G pair.

I found another case where I end up having to have two MAC address entries on one host:
option mac 'e4:5f:01:f7:6f:34 id:01:e4:5f:01:f7:6f:34'

I found another case where I end up having to have two MAC address entries on one host: option mac 'e4:5f:01:f7:6f:34 id:01:e4:5f:01:f7:6f:34'

Isn't this the same use case, or are both the MACs active at the same time?

That's actually the same machine and same NIC twice… it seems like depending on OS, sometimes it sends a dhcp-client-id (the id:01:…) and sometimes doesn't (the plain MAC address). So, I need both to reserve it properly.

I have a couple of hosts where I've done that to make sure the reservation works.

It seems like ip6neigh stops adding a bogus hostname record if I swap the order so the id: is first.