-
Notifications
You must be signed in to change notification settings - Fork 13
8‐3 Delete Commands_jp
Masterファイルを直接編集するため、実行前に必ずMasterファイルをバックアップしてください。
CLIから以下のdeleteコマンドを実行できます
- delete ip_address
- delete l2_segment
- delete portchannel
- delete virtual_port delete vport_l2_direct_binding
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]
レイヤ3インタフェースのIPアドレスを削除します。1回に1つのIPアドレスが削除できます。
python [file path]/network_sketcher.py delete ip_address [device name] [layer3_portname] [ip_address/subnetmask] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'Vlan 100', '', '192.168.100.100/24']
+IP Address deleted+
#python .\network_sketcher.py delete ip_address 'L3SW2' 'Vlan 100' '192.168.100.100/24' --master "C:\work\[MASTER]test.xlsx"
--- IP Address deleted --- L3SW2,Vlan 100,192.168.100.100/24
+AFTER+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'Vlan 100', '', '']
インタフェースに設定されたVLAN等のレイヤ2セグメントを削除します。1回に1つのレイヤ2セグメントが削除できます。
python [file path]/network_sketcher.py delete ip_address [device name] [layer2_portname] [l2segment_name] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300,addvlan999', '']
+l2_segment deleted+
#python .\network_sketcher.py delete l2_segment 'L3SW2' 'GigabitEthernet 0/0' 'addvlan999' --master "C:\work\[MASTER]test.xlsx"
--- l2 Segment deleted --- L3SW2,GigabitEthernet 0/0,addvlan999
+AFTER+
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']
レイヤ1インタフェースに設定されたポートチャネル(LAG)を削除します。ポートチャネルに設定されているレイヤ2セグメントも一緒に削除されます。
python [file path]/network_sketcher.py delete portchannel [device name] [layer1_portname] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', 'PortChannel 1', 'vlan1', '']
['L3SW1', 'GigabitEthernet 0/1', 'PortChannel 1', 'vlan1', '']
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'PortChannel 1', '', '']
+portchannel deleted+
#python .\network_sketcher.py delete portchannel 'L3SW1' 'GigabitEthernet 0/0' --master "C:\work\[MASTER]test.xlsx"
--- portchannel deleted --- L3SW1,GigabitEthernet 0/0,PortChannel 1
#python .\network_sketcher.py delete portchannel 'L3SW1' 'GigabitEthernet 0/1' --master "C:\work\[MASTER]test.xlsx"
--- portchannel deleted --- L3SW1,GigabitEthernet 0/1,PortChannel 1
+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '', '']
['L3SW1', 'GigabitEthernet 0/1', '', '', '']
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '']
['L3SW1', 'GigabitEthernet 0/1', '', '']
VLANインタフェース(SVI)等のレイヤ3インタフェースを削除します。ポートチャネルの削除はできません。
python [file path]/network_sketcher.py delete virtual_port [device name] [virtual_portname] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', '', 'addvlan 999', '', '']
['L3SW2', '', 'Vlan 300', 'Vlan300', '']
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'Vlan 300', '', '']
['L3SW2', 'addvlan 999', '', '']
+virtual_port added+
#python .\network_sketcher.py delete l2_segment 'L3SW2' 'GigabitEthernet 0/0' 'addvlan999' --master "C:\work\[MASTER]test.xlsx"
--- Virtual Port deleted --- L3SW2,addvlan 999
+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', '', 'Vlan 300', 'Vlan300', '']
#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', 'Vlan 300', '', '']
Virtualポートで直接VLAN(l2_segment)のようなレイヤ2を送受信する要素を削除します。
python [file path]/network_sketcher.py delete vport_l2_direct_binding [device name] [virtual port] [l2_name_direct_binding] --master [master file path] - ex.
+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['Catalyst 3560', 'GigabitEthernet 0/0', 'GigabitEthernet 0/0.100', '', 'vlan100']
+virtual_port added+
#python .\network_sketcher.py dd vport_l2_direct_binding "Catalyst 3560" "GigabitEthernet 0/0.100" vlan100 --master "C:\work\[MASTER]test.xlsx"
--- vport_l2_direct_binding deleted --- Catalyst 3560,GigabitEthernet 0/0.100,vlan100
+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['Catalyst 3560', 'GigabitEthernet 0/0', 'GigabitEthernet 0/0.100', '', '']
- 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.