-
Notifications
You must be signed in to change notification settings - Fork 759
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
DHCP server dynamic IP allocation with Host Name and Description fields from Static info #2946
Comments
|
I am in the same boat and would also appreciate some feedback from an expert. I've set up several static DHCP mappings and they show as 'active' when in use under Leases; but no IP address is being populated for each entry row. |
|
I was looking for the same. In my old Asus router I could just type in a new hostname and I'm guessing it tied it to the MAC. It's really nice to have for devices that you can't set a hostname on (ie IoT). Further it seems that setting a static entry without defining an IP address leaves you unable to edit the entry afterwards. No edit button or thrascan to remove it. OPNsense 19.1.1 |
|
Here's some more formal BUG report for the issue. Brief description:What I want to achieve is to translate MAC address to hostname without caring about IP address assigned to the host. OPNSense: 19.1.6Steps to reproduce
Results
Expected results
Screenshot:The picture shows the current state and the arrows show where the IP leases should go to. Additional info:https://forum.opnsense.org/index.php?topic=12369.0 |
|
@teklabania it can't do what you think it does, but might require better explanation in the help text (ideas are welcome). When the marker is set, it will write out all dns entries which come with a valid ip address. core/src/etc/inc/plugins.inc.d/unbound.inc Lines 642 to 665 in 31a81c5
Since leases change over time, this specific feature would require unbound to restart after every given lease, to load the file again (which for obvious reasons doesn't happen). The duplication of entries as shown in the last screenshot seem to happen on my end as well, which should hopefully be easy to fix. I'll prepare a fix and close the issue, feel free to suggest changes in a new ticket to better explain the unbound registration feature. It might be an option to check |
|
In theory it would be possible to add logic in https://github.com/opnsense/core/blob/master/src/opnsense/scripts/dns/unbound_dhcpd.py to use the configured hostname, but you easily end up in a race condition there, since a change doesn't trigger a new lease. It looks like |
(cherry picked from commit 839ec35)
|
Hi @AdSchellevis . I see you closed the issue I originally logged. I was not available to react due to spring holiday at the time you closed the issue and afterward forgot about it, so please forgive me resurrecting this thread. I did not log a formal template for this issue, so it is good that @teklabania did put in the effort. My case was actually more simple than @teklabania wrote, but had almost the same goal. Although I do not care about the Unbound part of his problem description. Brief description: OPNSense: 19.1.7 Steps to reproduce Expected results As Unbound is left out of this equation, this would not result in a race condition? It is unclear which 'glitch' you refer to with 839ec35, but applying the mentioned patch did not result in desired outcome as indicated with the screenshot. |
|
OK, applied opnsense-patch 839ec35 which indeed combines information. Only issue I see is that Interface name now has gone missing.... |
|
@Northguy can you create new issue for the missing interface in this case? I'll try to look at it when I have a bit of time available. |
|
@AdSchellevis, thank you for taking care of this issue with duplicated mac addresses. It's a pitty we cannot get the feature of getting hostname being assigned to MAC and being resolved by DNS. So putting additional info under hostname form could be good idea. Currently under:
Maybe something like this would do:
|
|
@teklabania sounds like a good idea indeed to better explain the feature, would this be something you might be willing to create a pull request for? |
@AdSchellevis see #3488 |




I configured OPNsense as DHCP server and would like to identify my devices in the DHCP leases table a bit more easily, based on a description. Most devices only show generic manufacturer info under the MAC address, but do not provide a Hostname or a more verbose description.
I tried creating a static mapping for the MAC address but am not necessarily looking for a static IP lease. Therefore I did not fill in the IP address in the edit box. According to the help it says "If no IPv4 address is given, one will be dynamically allocated from the pool", but if I follow this way, the MAC address is shown as ' static' in the leases table without an IP. i.e.: I have created a static lease without a visible dynamic IP?
Is this a bug, or is there another way to create an easily identifiable indicator for the MAC addresses that have obtained a dynamic lease?
Issue seems (not entirely) related to #1465
The text was updated successfully, but these errors were encountered: