-
Notifications
You must be signed in to change notification settings - Fork 13
8‐4. Rename Commands_jp
Masterファイルを直接編集するため、実行前に必ずMasterファイルをバックアップしてください。
CLIから以下のrenameコマンドを実行できます
python [file path]/network_sketcher.py [command] --master [master file path]- 以下のように[command] 、--master [master file path] の場所は変更可能
python [file path]/network_sketcher.py -master [master file path] [command]
エリア名を変更します。
python [file path]/network_sketcher.py rename area [Original area name] [Updated area name] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show area --master "C:\work\[MASTER]test.xlsx"
Area1
Area2
Area3
+Device renamed+
#python .\network_sketcher.py rename area 'Area3' 'Area99' --master "C:\work\[MASTER]test.xlsx"
--- Area renamed --- Area3 -> Area99
+AFTER+
#python .\network_sketcher.py show area --master "C:\work\[MASTER]test.xlsx"
Area1
Area2
Area99
デバイス名を変更します。
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
レイヤ3インタフェースが所属するVRFのようなl3_instanceを変更します。デフォルトでは全てのレイヤ3インタフェースはDefaultを意味する空欄''が設定されています。仮に1つのレイヤ3インターフェースのl3_instance名を変更すると、空欄''が設定されているその他全てのl3_instanceはDefaultのl3_instanceが設定された状態と同じ意味となります。
python [file path]/network_sketcher.py rename l3_instance [device name] [layer3 port name] [Renamed l3_instance name] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['devcie1', 'GigabitEthernet 0/0', '', '']
+l3_interface renamed+
#python .\network_sketcher.py rename l3_instance 'devcie1' 'GigabitEthernet 0/0' 'VRF-1' --master "C:\work\[MASTER]test.xlsx"
--- l3 instance renamed --- devcie1,GigabitEthernet 0/0,VRF-10
+AFTER+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['devcie1', 'GigabitEthernet 0/0', 'VRF-1', '']
ポート名及びポート番号を変更します。
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', '', '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', '', '']
+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', '', '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', '', '']
- Yusuke Ogawa - Security Architect, Cisco | CCIE#17583
SPDX-License-Identifier: Apache-2.0
Copyright 2023 Cisco Systems, Inc. and its affiliates
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.