cli: a subinterface prompts (config-subif)#, its parent port (config-if)# #1755

Closed
jaylouisw wants to merge 1 commit from rev/1116-2330 into main
Owner

A subinterface is its own configuration mode on an IOS box, and says so in the prompt. This console printed (config-if)# inside a Gi0/0.10, so a router-on-a-stick transcript pasted into it came back wearing a prompt no box produces.

Router(config)#interface GigabitEthernet0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)#interface GigabitEthernet0/1
Router(config-if)# no ip address

The rule is asked of the interface object the mode was entered on (type === 'subinterface'), not of the typed name, so the prompt follows the object: subif to subif stays subif, subif to a physical port is (config-if)#, and re-entering an existing subinterface does not create a second one.

Evidence (all captured lines, not prose about the mode):

research/subinterface-prompt.md records what is known, what is inferred, and two open points: this rests on published captures rather than a box in hand, and a refused interface <name> from inside an interface mode still drops the session to (config)# (a box reports the error and leaves you where you were) — noted there as its own question, not fixed here.

test/subinterface-prompt.test.js holds seven checks: both prompts, the hostname in the prompt, subif→subif, subif→physical port, re-entry without duplicating the object, the mode still working under the new prompt, and the whole prompt ladder. docs/CLI.md gains the mode row and the config-mode row.

Full suite: 297 suites, 10489 assertions, 0 failures; scripts/syntax-check.js clean (368 files).

A subinterface is its own configuration mode on an IOS box, and says so in the prompt. This console printed `(config-if)#` inside a `Gi0/0.10`, so a router-on-a-stick transcript pasted into it came back wearing a prompt no box produces. ``` Router(config)#interface GigabitEthernet0/0.10 Router(config-subif)# encapsulation dot1Q 10 Router(config-subif)#interface GigabitEthernet0/1 Router(config-if)# no ip address ``` The rule is asked of the interface object the mode was entered on (`type === 'subinterface'`), not of the typed name, so the prompt follows the object: subif to subif stays subif, subif to a physical port is `(config-if)#`, and re-entering an existing subinterface does not create a second one. Evidence (all captured lines, not prose about the mode): * IOS XE, *Access Node Control Protocol* — https://www.cisco.com/c/en/us/td/docs/routers/ios-xe/security-vpn/security-vpn/m_ancp-xe.html * IOS, *IEEE 802.1Q-in-Q VLAN Tag Termination* — https://www.cisco.com/en/US/docs/ios/lanswitch/configuration/guide/lsw_ieee_802.1q.html * IOS XE 16.11, *PPPoE QinQ Support* — https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/bbdsl/configuration/xe-16-11/bba-xe-16-11-book/bba-pppoe-qinq-xe.html * ASA, *Configuring Ethernet Settings and Subinterfaces* — https://www.cisco.com/c/en/us/td/docs/security/asa/asa72/configuration/guide/conf_gd/intrface.html * TAC transcript walking the boundary both ways — https://community.cisco.com/t5/networking-knowledge-base/configuring-ip-helper-address-to-issue-ip-address-from-dhcp/tac-p/5286519 `research/subinterface-prompt.md` records what is known, what is inferred, and two open points: this rests on published captures rather than a box in hand, and a **refused** `interface <name>` from inside an interface mode still drops the session to `(config)#` (a box reports the error and leaves you where you were) — noted there as its own question, not fixed here. `test/subinterface-prompt.test.js` holds seven checks: both prompts, the hostname in the prompt, subif→subif, subif→physical port, re-entry without duplicating the object, the mode still working under the new prompt, and the whole prompt ladder. `docs/CLI.md` gains the mode row and the config-mode row. Full suite: **297 suites, 10489 assertions, 0 failures**; `scripts/syntax-check.js` clean (368 files).
cli: a second primary address in a subnet this box already holds is refused
All checks were successful
CI / Classify the change (pull_request) Successful in 12s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 27s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m5s
CI / Docker build (pull_request) Successful in 29s
CI / Test (Node 22) (pull_request) Successful in 1m5s
CI / Arm auto-merge (pull_request) Successful in 3s
b7ea1df4c5
A router keeps one connected route per subnet, so two of its ports cannot
hold addresses in the same subnet. IOS refuses the command with one line
and applies nothing:

    R4(config-if)#ip address 192.168.254.32 255.255.255.192
    % 192.168.254.0 overlaps with FastEthernet0/0

Three public transcripts print that sentence with the network of the
address being typed under the mask being typed, name the port that got
there first, and show the refused port still `unassigned` afterwards
(one of them is a subinterface colliding with its own parent):

  https://learningnetwork.cisco.com/s/question/0D53i00000Kt12sCAB/can-one-subnet-be-on-opposite-sides-of-a-router
  https://learningnetwork.cisco.com/s/question/0D53i00000Ksv3lCAB/two-interfaces-on-the-same-subnet
  https://learningnetwork.cisco.com/s/question/0D53i00000KsxMfCAJ/subinterfaces

This console took the address and wrote it down, so a lab could hold two
ports in one subnet and print two connected routes for a network the box
has one wire for.

The check compares the two address *ranges*, so 10.1.1.1/16 and
10.1.2.1/24 collide in either order where "same subnet" would miss them;
it runs before anything is stored, so the port keeps its previous address,
mask and DHCP flag and `show running-config` never carries the line.

Two consequences are left unmodelled and recorded instead of guessed: an
incumbent port that is administratively down (one contributor says IOS
accepts the overlap then; no vendor page or capture confirms it) and an
address a DHCP client holds at run time.

docs/CLI.md states the rule; research/ip-address-overlap.md holds the
evidence, the two open questions and what would settle them;
test/ip-address-overlap.test.js adds 14 checks.
jaylouisw changed title from cli: a second primary address in a subnet this box already holds is refused to cli: a subinterface prompts (config-subif)#, its parent port (config-if)# 2026-11-17 00:29:10 +00:00
jaylouisw closed this pull request 2026-11-17 00:29:19 +00:00
All checks were successful
CI / Classify the change (pull_request) Successful in 12s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 27s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 18) (pull_request) Successful in 1m5s
CI / Docker build (pull_request) Successful in 29s
CI / Test (Node 22) (pull_request) Successful in 1m5s
CI / Arm auto-merge (pull_request) Successful in 3s

Pull request closed

Sign in to join this conversation.
No reviewers
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!1755
No description provided.