host refuses the dotted MAC that show mac address-table prints, and show ip dhcp binding <mac> answers a MAC lookup as an address #1861

Closed
opened 2026-11-17 15:16:27 +00:00 by jaylouisw · 0 comments
Owner

Three answers to one question: what is a hardware address?

show mac address-table, show arp, show interfaces <port> and show vrrp print a MAC dotted - 0200.0000.0001. The DHCP engine accepts that spelling too: dhcp.normalizePool() canonicalises AABB.CC00.0005 onto aa:bb:cc:00:00:05 (test/dhcp.test.js pins it). The DHCP console does not. It decides what a MAC is with three private shapes of its own - a colon-only regex in host (engine/cli.js), a /:/.test(...) in no host, and a third copy in the show ip dhcp binding filter - so the address the box prints is refused, and a MAC lookup is answered as an address lookup.

Reproduction (origin/main, ISR 4331)

r1(config)#ip dhcp pool lan
r1(dhcp-config)#host 192.168.10.105 0200.0000.0001
% Not a reservation: give an address and a MAC, in either order (host 192.168.10.105 0200.0000.0001 is neither). A MAC is six hex pairs, like aa:bb:cc:00:00:99.

It is a MAC: six hex pairs, in the notation the console prints on every table it shows. host 192.168.10.105 aa:bb:cc:00:00:99 is accepted; the same 48 bits, dotted, are refused and the refusal says the token is neither an address nor a MAC.

The same defect at the other site - a lease held by 02:00:00:00:00:0a:

r1#show ip dhcp binding 0200.0000.000a
% No binding for 0200.0000.000a (no lease holds that address)

There is no address 0200.0000.000a; the token was a MAC, the lease is held by exactly that MAC, and the message answers a question that was not asked.

no host carries the third copy, so a reservation would be addable in one spelling and unfindable in another.

Expected

One rule - net.macToInt(), the engine's own - should answer "is this token a hardware address?", so the colon, hyphen and dotted spellings all work in host, no host and show ip dhcp binding <mac>, the reservation is stored once under the canonical form, and a miss echoes the token that was typed.

Out of scope, and worth its own note: show ip dhcp binding prints its MACs colon-separated while the rest of the console prints them dotted. That is a display question (the colon form is also what host echoes back), so this issue is about accepting every spelling, not about changing what the table prints.

**Three answers to one question: what is a hardware address?** `show mac address-table`, `show arp`, `show interfaces <port>` and `show vrrp` print a MAC dotted - `0200.0000.0001`. The DHCP engine accepts that spelling too: `dhcp.normalizePool()` canonicalises `AABB.CC00.0005` onto `aa:bb:cc:00:00:05` (`test/dhcp.test.js` pins it). The DHCP console does not. It decides what a MAC is with three private shapes of its own - a colon-only regex in `host` (`engine/cli.js`), a `/:/.test(...)` in `no host`, and a third copy in the `show ip dhcp binding` filter - so the address the box prints is refused, and a MAC lookup is answered as an address lookup. **Reproduction (origin/main, `ISR 4331`)** ``` r1(config)#ip dhcp pool lan r1(dhcp-config)#host 192.168.10.105 0200.0000.0001 % Not a reservation: give an address and a MAC, in either order (host 192.168.10.105 0200.0000.0001 is neither). A MAC is six hex pairs, like aa:bb:cc:00:00:99. ``` It is a MAC: six hex pairs, in the notation the console prints on every table it shows. `host 192.168.10.105 aa:bb:cc:00:00:99` is accepted; the same 48 bits, dotted, are refused and the refusal says the token is *neither* an address nor a MAC. The same defect at the other site - a lease held by `02:00:00:00:00:0a`: ``` r1#show ip dhcp binding 0200.0000.000a % No binding for 0200.0000.000a (no lease holds that address) ``` There is no address `0200.0000.000a`; the token was a MAC, the lease is held by exactly that MAC, and the message answers a question that was not asked. `no host` carries the third copy, so a reservation would be addable in one spelling and unfindable in another. **Expected** One rule - `net.macToInt()`, the engine's own - should answer "is this token a hardware address?", so the colon, hyphen and dotted spellings all work in `host`, `no host` and `show ip dhcp binding <mac>`, the reservation is stored once under the canonical form, and a miss echoes the token that was typed. **Out of scope, and worth its own note:** `show ip dhcp binding` prints its MACs colon-separated while the rest of the console prints them dotted. That is a display question (the colon form is also what `host` echoes back), so this issue is about accepting every spelling, not about changing what the table prints.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1861
No description provided.