interfaces: a shortened type opens the same port (g1/0/1 -> Gi1/0/1), expanded against this device's own types #1841
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1841
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rev/1117-1200"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Question
An operator types
interface g1/0/1,interface f0/1,interface s0/0/0. Does a real IOS-like box accept a shortened interface TYPE, and which prefixes does it accept? This console accepted only the documentedgi/faspellings, so the spelling people actually type was refused with% Interface not found.Evidence
Router(config)# interface g 0/1/0and "use the show run interface g0/1/0, show interface g0/1/0 ... commands to verify" - Cisco Embedded Service 6300 Series Software Configuration Guide, Configuring Ethernet Switch Ports. https://cisco.com/c/en/us/td/docs/IIOT/routers/embedded/6300/software/config/b_ESR6300_config/b_ESR6300_config_chapter_01111.htmlSwitch(config)# interface g0/12on a Catalyst 6500 - Cisco support community, Port-Security for mobile devices as laptops. https://community.cisco.com/t5/physical-security/port-security-for-mobile-devices-as-laptops/td-p/3774460gi,gig,gigabit) follows on the same rule.What changed
engine/iface-name.jsgainsexpandTypePrefix()anddeviceTypeSet();resolvePortName()retries the key lookup on the expanded name. The prefix is expanded against the types this device actually carries, so the answer is uniqueness, not a table:g1/0/1->Gi1/0/1on a 2960-X;f0/1->Fa0/1ands0/0/0->Se0/0/0on a 2811;interface g 1/0/2) and subinterfaces (interface g1/0/24.10) work the same;portKey(): that key is device-free (saved labs are folded with it before any device exists) and a prefix rule there would reach names the table never knew - a UniFiPort 1must not bep1. Only a type already inTYPE_SPELLINGScan be reached, and only through a device.A spelling that folds onto two ports is still refused rather than rescued into one of them (
matchKeynow distinguishes "absent" from "ambiguous").Tests
test/iface-type-prefix.test.js- 8 assertions (one-letter and longer prefixes, the space form, per-device types, subinterface, ambiguity, no-such-type,Port 1guard, view word).test/iface-type-spelling.test.jsno longer asserts thatGig1/0/1is refused (10 pass).node scripts/syntax-check.js: 386 files, all OK.check-doc-citations: 349 citations, exit 0.check-control-bytes: clean.npm test: 314 suites, 10,954 assertions, 0 failed.Docs
research/interface-type-spellings.md: the "Partial spellings" item it left unresolved is now settled, with the sources above and the rule as implemented.docs/CLI.mdsays the same in the interface-naming section.Still unresolved
Types the table does not carry (
TFGigabitEthernet,XGigabitEthernet/xge,mge, PON/DSL) still need their vendor's own abbreviation before they can be added, and whethershow running-configshould print the long name is a separate question.g1/0/1->Gi1/0/1), expanded against this device's own types9dfba46947da59f4c990