show running-config cannot be pasted back: no exit between blocks, own header rejected, and the config lands on the wrong port #1230
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What happens
show running-configis not a config you can paste back. On a router with more than one interface theoutput starts failing at the second line and — worse — the rest of the config silently lands on the
wrong port.
Steps to reproduce
Output (excerpt):
Now paste that, header line and all, into a fresh device of the same model:
Every one of those lines is rejected, and the config that is accepted goes to the wrong place:
…and the replayed
show running-configshows why this is a correctness problem, not just noise:The device ends up with an address and a shutdown on a different interface from the one they were
configured on.
Three separate causes
exit.show running-configwritesinterface <name>blocks back toback, so a reader never leaves interface mode. Every line after the first interface is then parsed
as an interface command — including global ones like
ip route, which is why the route isrejected and the address is applied to whatever interface was current.
! PacketForge running-config,comes back as
% Unrecognized config command— a comment is not a comment.interface <name>inside interface mode is rejected. IOS treats a newinterfaceline while ininterface mode as a mode switch, not an error; this CLI reports
% Unrecognized interface command: interface Gi0/0/0.Expected
show running-configproduces output that, pasted into a fresh device of the same model at theconfig prompt, reproduces the same running-config — same addresses on the same ports.
!) are ignored wherever they appear, like every other CLI.interface <name>in interface mode selects that interface.block-after-block shape, not just the corrected one.
Scope
Every device with more than one port: the second
interfaceline is the first failure. A single-portdevice survives only because its one block is the last thing before the global section.
show running-configis now a config you can paste back (#1230) #1231show interfaces Port 1refuses a port that exists: the reporting doors read only the first word of a name #1401hostnameerased the name,descriptioncleared itself #1497noline that names a setting undoes the setting, not the group #1960!, the line a box prints #2087