Skip to content

8‐4. Rename Commands

Yusuke Ogawa edited this page Oct 3, 2025 · 6 revisions

Since you will be editing the Master file directly, be sure to back up the Master file before proceeding.

What you can do with this procedure

You can run the following rename command from the CLI

Basic Syntax

python [file path]/network_sketcher.py [command] --master [master file path]
  • The location of [command] 、--master [master file path] can be changed as follows:
    python [file path]/network_sketcher.py -master [master file path] [command]

rename device

Change the device name.

python [file path]/network_sketcher.py rename device [Original device name] [Updated device name] --master [master file path] 
  • ex.

+BEFORE+
#python .\network_sketcher.py show device --master "C:\work\[MASTER]test.xlsx"
L3SW1
L3SW2

+Device renamed+
#python .\network_sketcher.py rename device 'L3SW1' 'L3SW100' --master "C:\work\[MASTER]test.xlsx"
--- Device Name renamed --- L3SW1 -> L3SW100

+AFTER+
#python .\network_sketcher.py show device --master "C:\work\[MASTER]test.xlsx"
L3SW100
L3SW2

rename port

Change the port name and port number.

python [file path]/network_sketcher.py rename port [device name] [Original port name] [Updated port name] --master [master file path] 
  • ex.

+BEFORE+
#python .\network_sketcher.py show l1_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'GE 0/0', 'GigabitEthernet 0/0', 'Auto', 'Auto', '1000BASE-T']
['L3SW2', 'GE 0/0', 'GigabitEthernet 0/0', 'Auto', 'Auto', '1000BASE-T']

#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', '', 'Vlan 201', 'Vlan100', '']
['L3SW1', '', 'Vlan 200', 'Vlan200', '']
['L3SW1', '', 'Vlan 300', 'Vlan300', '']
['L3SW1', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']
['L3SW2', '', 'addvlan 999', '', '']
['L3SW2', '', 'Vlan 201', 'Vlan100', '']
['L3SW2', '', 'Vlan 200', 'Vlan200', '']
['L3SW2', '', 'Vlan 202', 'Vlan300', '']
['L3SW2', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']

#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'Vlan 201', '', '']
['L3SW1', 'Vlan 200', '', '']
['L3SW1', 'Vlan 300', '', '']
['L3SW2', 'Vlan 201', '', '']
['L3SW2', 'Vlan 200', '', '']
['L3SW2', 'Vlan 202', '', '']
['L3SW2', 'addvlan 999', '', '']

+Port renamed+
#python .\network_sketcher.py rename port 'L3SW1' 'GigabitEthernet 0/0' 'FastEthernet 1/1' --master "C:\work\[MASTER]test.xlsx"
--- Physical Port Name renamed --- L3SW1 GigabitEthernet 0/0 -> FastEthernet 1/1

#python .\network_sketcher.py rename port 'L3SW2' 'Vlan 200' 'Vlan 999' --master "C:\work\[MASTER]test.xlsx"
--- Virtual Port Name renamed --- L3SW2 Vlan 200 -> Vlan 999

+AFTER+
#python .\network_sketcher.py show l1_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'FE 1/1', 'FastEthernet 1/1', 'Auto', 'Auto', '1000BASE-T']
['L3SW2', 'GE 0/0', 'GigabitEthernet 0/0', 'Auto', 'Auto', '1000BASE-T']

#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', '', 'Vlan 201', 'Vlan100', '']
['L3SW1', '', 'Vlan 200', 'Vlan200', '']
['L3SW1', '', 'Vlan 300', 'Vlan300', '']
['L3SW1', 'FastEthernet 1/1', '', 'Vlan100,Vlan200,Vlan300', '']
['L3SW2', '', 'addvlan 999', '', '']
['L3SW2', '', 'Vlan 201', 'Vlan100', '']
['L3SW2', '', 'Vlan 999', 'Vlan200', '']
['L3SW2', '', 'Vlan 202', 'Vlan300', '']
['L3SW2', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']

#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'Vlan 201', '', '']
['L3SW1', 'Vlan 200', '', '']
['L3SW1', 'Vlan 300', '', '']
['L3SW2', 'Vlan 201', '', '']
['L3SW2', 'Vlan 999', '', '']
['L3SW2', 'Vlan 202', '', '']
['L3SW2', 'addvlan 999', '', '']

Clone this wiki locally