Four config commands are one-way doors, and no vlan reports work it did not do #1277

Closed
opened 2026-11-09 21:31:46 +00:00 by jaylouisw · 0 comments
Owner

Four config commands can be typed, are printed by show running-config, and cannot be taken back from the
console. no vlan is the mirror image: it reports success whether or not it did anything.

r1(config)#hostname ripper
r1(config)#no hostname
% Unrecognized config command: no hostname ripper

r1(config)#ip dhcp pool P1
r1(config-dhcp)#network 10.5.0.0 255.255.255.0
r1(config)#no ip dhcp pool P1
% E_DHCP_BAD_RANGE: DHCP pool P1: both rangeStart and rangeEnd ...     <- the `no` was parsed as pool body

r1(config)#dns zone test.example
r1(config)#no dns zone test.example
% Unrecognized config command: no dns zone test.example

r1(config)#interface Gi0
r1(config-if)#ip access-group 101 in
r1(config-if)#no ip access-group 101 in
% Unrecognized interface command: no ip access-group 101 in

And the other way round:

sw1(config)#no vlan 42
VLAN 42 removed                    <- there is no VLAN 42

Why it matters

show running-config is the backup, and test/config-roundtrip.test.js already holds it to two rules: it
replays, and it is complete. A backup you cannot edit back fails the job the other two rules exist for —
there is no way to undo a mistake in the console at all, short of rewriting the device.

no vlan is worse than missing because it lies. It also removes a VLAN that ports still carry, after which
show running-config stops printing vlan 42 while show vlan still lists VLAN 42 from the member ports:
two descriptions of one switch that disagree, which is the same class as #1232, #1256 and #1262.

What "done" looks like

  • every no form above is accepted;
  • undoing a command returns show running-config byte for byte to what it was before the command;
  • removing something that is not there refuses in one sentence, naming the thing, and changes nothing;
  • no ip access-group 103 in while 102 is applied refuses and names 102 rather than clearing whatever was
    bound;
  • no vlan 20 refuses while ports carry it, naming them, so the config and the VLAN table cannot disagree;
  • no hostname puts the device's previous name back, so the canvas label and the config stay in step (#21).
Four config commands can be typed, are printed by `show running-config`, and cannot be taken back from the console. `no vlan` is the mirror image: it reports success whether or not it did anything. ``` r1(config)#hostname ripper r1(config)#no hostname % Unrecognized config command: no hostname ripper r1(config)#ip dhcp pool P1 r1(config-dhcp)#network 10.5.0.0 255.255.255.0 r1(config)#no ip dhcp pool P1 % E_DHCP_BAD_RANGE: DHCP pool P1: both rangeStart and rangeEnd ... <- the `no` was parsed as pool body r1(config)#dns zone test.example r1(config)#no dns zone test.example % Unrecognized config command: no dns zone test.example r1(config)#interface Gi0 r1(config-if)#ip access-group 101 in r1(config-if)#no ip access-group 101 in % Unrecognized interface command: no ip access-group 101 in ``` And the other way round: ``` sw1(config)#no vlan 42 VLAN 42 removed <- there is no VLAN 42 ``` ## Why it matters `show running-config` is the backup, and `test/config-roundtrip.test.js` already holds it to two rules: it replays, and it is complete. A backup you cannot **edit back** fails the job the other two rules exist for — there is no way to undo a mistake in the console at all, short of rewriting the device. `no vlan` is worse than missing because it lies. It also removes a VLAN that ports still carry, after which `show running-config` stops printing `vlan 42` while `show vlan` still lists VLAN 42 from the member ports: two descriptions of one switch that disagree, which is the same class as #1232, #1256 and #1262. ## What "done" looks like * every `no` form above is accepted; * undoing a command returns `show running-config` **byte for byte** to what it was before the command; * removing something that is not there refuses in one sentence, naming the thing, and changes nothing; * `no ip access-group 103 in` while 102 is applied refuses and names 102 rather than clearing whatever was bound; * `no vlan 20` refuses while ports carry it, naming them, so the config and the VLAN table cannot disagree; * `no hostname` puts the device's previous name back, so the canvas label and the config stay in step (#21).
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#1277
No description provided.