Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DanaGoyette opened this issue Aug 16, 2021 · 5 comments

Comments

@DanaGoyette
Copy link

DanaGoyette commented Aug 16, 2021

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.

@cvmiller
Copy link
Collaborator

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.

@DanaGoyette
Copy link
Author

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.

@DanaGoyette
Copy link
Author

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'

@cvmiller
Copy link
Collaborator

cvmiller commented Dec 6, 2023

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?

@DanaGoyette
Copy link
Author

DanaGoyette commented Dec 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants