Skip to content

8‐2 Add Commands

Yusuke Ogawa edited this page Sep 16, 2025 · 7 revisions

Since this process will directly edit the master file, please be sure to back up the master file before proceeding.

What you can do with these steps

You can execute the following "add" command from the CLI.

Basic syntax:

python [file path]/network_sketcher.py [command] --master [master file path]
  • The part marked as [command] 、--master [master file path] below can be modified.
    python [file path]/network_sketcher.py -master [master file path] [command]

add ip_address

This process allows you to create an IP address for a Layer 3 interface. You can create one IP address at a time; by repeating the process, you can add multiple IP addresses.

python [file path]/network_sketcher.py add ip_address [hostname] [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', '', '']

+IP Address added+
#python .\network_sketcher.py add ip_address 'L3SW2' 'Vlan 100' '192.168.100.100/24' --master "C:\work\[MASTER]test.xlsx"
--- IP Address added --- 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', '', '192.168.100.100/24']

add l2_segment

This feature allows you to create Layer 2 segments (such as VLANs) on the interface. You can create one Layer 2 segment at a time, and multiple Layer 2 segments can be created.

python [file path]/network_sketcher.py add l2_segment [hostname] [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', '']

+l2_segment added+
#python .\network_sketcher.py add l2_segment 'L3SW2' 'GigabitEthernet 0/0' 'addvlan999' --master "C:\work\[MASTER]test.xlsx"
--- l2 Segment added --- 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,addvlan999', '']

add virtual_port

We will create Layer 3 interfaces, such as VLAN interfaces (SVIs).

python [file path]/network_sketcher.py add virtual_port [hostname] [virtual_portname] --master [master file path] 
  • ex.

+BEFORE+
#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_port added+
#python .\network_sketcher.py add l2_segment 'L3SW2' 'GigabitEthernet 0/0' 'addvlan999' --master "C:\work\[MASTER]test.xlsx"
--- Virtual Port added --- L3SW2,addvlan 999

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW2', '', 'addvlan 999', '', '']
['L3SW2', '', 'Vlan 100', 'Vlan100', '']

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

Clone this wiki locally