Skip to content

8‐2 Add Commands

Yusuke Ogawa (yuogawa) edited this page Apr 23, 2026 · 25 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 area_location

Updates the overall area layout (placement map). By specifying area placement using a two-dimensional array, you can change the relative positions of areas in bulk. New areas can also be added simultaneously.

python [file path]/network_sketcher.py add area_location “[[‘area_name1’,'area_name2'],[‘area_name3’,'area_name4']]” --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show area_location --master “C:\work[MASTER]test.xlsx”
[[‘DC1’, ‘DC2’]]

+area_location updated+
#python .\network_sketcher.py add area_location “[‘DC1’,'DC2'],[‘DC3’,'DC4']]' --master ”C:\work[MASTER]test.xlsx"
--- Area layout updated ---
New areas added: [‘DC3’, ‘DC4’]
Device added for DC3: DC3_device_
Device added for DC4: DC4_device_
New area layout:
[‘DC1’, ‘DC2’]
[‘DC3’, ‘DC4’]

+AFTER+
#python .\network_sketcher.py show area_location --master “C:\work[MASTER]test.xlsx”
[[‘DC1’, ‘DC2’], [‘DC3’, ‘DC4’]]

[Tips]

  • All existing areas must be included in the new layout
  • New areas automatically have default devices added (Standard areas: [area_name]_device_, Waypoint areas: [area_name] minus wp)
  • Waypoint-only areas (area names ending with wp) cannot be placed side-by-side

add device

Adds a new device in the specified direction relative to an existing device. The device is added to a normal area (non-waypoint area).

python [file path]/network_sketcher.py add device [new_device_name] [reference_device] [direction] --master [master file path]

[direction] options:

UP : Add above the reference device
DOWN : Add below the reference device
LEFT : Add to the left of the reference device
RIGHT : Add to the right of the reference device
UP_WITH_GRID : Add a row above the reference device
DOWN_WITH_GRID : Place by adding rows below the reference device
LEFT_WITH_GRID : Place by adding columns to the left of the reference device
RIGHT_WITH_GRID : Place by adding columns to the right of the reference device

  • ex.

+BEFORE+
#python .\network_sketcher.py show device_location --master “C:\work[MASTER]test.xlsx”
[‘tmp’, [[‘sw1’, ‘sw2’]]]

+device added+
#python .\network_sketcher.py add device ‘sw4’ 'sw1' RIGHT --master “C:\work[MASTER]test.xlsx”
--- Device added --- sw4 relative to sw1 with direction RIGHT

+AFTER+
#python .\network_sketcher.py show device --master “C:\work[MASTER]test.xlsx”
[‘tmp’, [[‘sw1’, ‘sw4’, ‘sw2’]]]

[Tips]

  • Device names added cannot duplicate existing device names
  • Devices placed within a waypoint area cannot be used as reference points

add device_location

Updates device placement within a specific area. You can change device positions within the area in bulk by specifying the grid layout of devices using a two-dimensional array. All existing devices will be replaced.

python [file path]/network_sketcher.py add device_location “[‘area_name’,[[‘device_name1’,'device2_name'],[‘device_name3’,'device_name4']]]” --master [master file path]

ex.

+BEFORE+
#python .\network_sketcher.py show device_location --master “C:\work[MASTER]test.xlsx”
[‘DC1’, [[‘SW-1’, ‘SW-2’]]]

+device_location updated+
#python .\network_sketcher.py add device_location “[‘DC1’,[[‘SW-1’,'SW-2'],[‘SW-3’,'AIR']]]” --master “C:\work[MASTER]test.xlsx”
--- Device location updated for area “DC1” ---
Added devices: [‘SW-3’]
New device layout (normalized):
[‘SW-1’, ‘SW-2’]
[‘SW-3’, ‘AIR’]

+AFTER+
#python .\network_sketcher.py show device_location --master “C:\work[MASTER]test.xlsx”
[‘DC1’, [[‘SW-1’, ‘SW-2’], [‘SW-3’, ‘AIR’]]]

[Tips]

  • Device grid is automatically centered and normalized
  • Use _AIR_ to explicitly specify empty cells
  • An error occurs if a new device already exists in another area
  • Only device placement changes (no additions or deletions) are also possible

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 [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', '', '']

+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 ip_address_bulk

This process allows you to create IP addresses for multiple Layer 3 interfaces in bulk. You can add multiple IP addresses to multiple interfaces in a single operation, significantly improving performance compared to individual add ip_address commands. Existing IP addresses on interfaces are preserved, and new addresses are merged and sorted.

python [file path]/network_sketcher.py add ip_address_bulk "[['device_name1','port_name1',['ip1','ip2']],['device_name2','port_name2',['ip3']]]" --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'Vlan 100', '', '']
['L3SW1', 'Vlan 200', '', '']
['L3SW2', 'Vlan 100', '', '']

+ip_address_bulk added+
#python .\network_sketcher.py add ip_address_bulk "[['L3SW1','Vlan 100',['192.168.100.1/24']],['L3SW1','Vlan 200',['192.168.200.1/24','192.168.200.2/24']],['L3SW2','Vlan 100',['192.168.100.2/24']]]" --master "C:\work[MASTER]test.xlsx"
--- Added IP address(es) in bulk ---
L3SW1(Vlan 100) <- 192.168.100.1/24
L3SW1(Vlan 200) <- 192.168.200.1/24, 192.168.200.2/24
L3SW2(Vlan 100) <- 192.168.100.2/24

+AFTER+
#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'Vlan 100', '', '192.168.100.1/24']
['L3SW1', 'Vlan 200', '', '192.168.200.1/24,192.168.200.2/24']
['L3SW2', 'Vlan 100', '', '192.168.100.2/24']

[Tips]

  • All elements (device names, port names, IP addresses) must be enclosed in single or double quotes
  • IP addresses must include subnet mask in CIDR notation (e.g., /24)
  • Spaces in IP addresses are automatically removed (e.g., ' 192.168.1.1 / 24 ' becomes '192.168.1.1/24')
  • Duplicate IP addresses on the same interface are automatically skipped
  • IP addresses are automatically sorted numerically on each interface
  • Existing IP addresses are preserved and merged with new addresses
  • Invalid IP address format will generate an error for that entry only

add l1_link

Creates a Layer 1 physical connection between devices. Only one physical link can be created at a time. Multiple links can be added by repeating the process.

python [file path]/network_sketcher.py add l1_link [from_device] [to_device] [from_portname] [to_portname] --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l1_link --master “C:\work[MASTER]test.xlsx”
[[‘SW-1’, ‘GigabitEthernet 0/0’], [‘SW-3’, ‘GigabitEthernet 0/1’]]

+l1_link added+
#python .\network_sketcher.py add l1_link ‘SW-1’ 'SW-2' ‘GigabitEthernet 0/1’ 'GigabitEthernet 0/0' --master “C:\work[MASTER]test.xlsx”
--- Added Layer 1 link --- SW-1 SW-2 GigabitEthernet 0/1 GigabitEthernet 0/0

+AFTER+
#python .\network_sketcher.py show l1_link --master “C:\work[MASTER]test.xlsx”
[[‘SW-1’, ‘GigabitEthernet 0/0’], [‘SW-3’, ‘GigabitEthernet 0/1’]]
[[‘SW-1’, ‘GigabitEthernet 0/1’], [‘SW-2’, ‘GigabitEthernet 0/0’]]

[Tips]

  • Port names contain spaces, so they must be enclosed in single quotes (‘port 0’).

add l1_link_bulk

Creates multiple Layer 1 physical connections in bulk. Specify multiple link definitions in array format to efficiently add multiple links.

python [file path]/network_sketcher.py add l1_link_bulk “[[‘from_device1’,'to_device1',‘from_port1’,'to_port1'],[‘from_device2’,'to_device2',‘from_port2’,'to_port2']]” --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l1_link --master “C:\work[MASTER]test.xlsx”
[[‘SW-1’, ‘GigabitEthernet 0/0’], [‘SW-3’, ‘GigabitEthernet 0/1’]]

+l1_link_bulk added+
#python .\network_sketcher.py add l1_link_bulk "[[‘SW-1’,'SW-2',‘GigabitEthernet 0/1’,'GigabitEthernet 0/0'], [‘SW-2’,'SW-3',‘GigabitEthernet 0/1’,'GigabitEthernet 0/2']]“ --master ”C:\work[MASTER]test.xlsx"
--- Added 2 Layer 1 link(s) in bulk ---
SW-1(GigabitEthernet 0/1) ↔ SW-2(GigabitEthernet 0/0)
SW-2(GigabitEthernet 0/1) ↔ SW-3(GigabitEthernet 0/2)
Affected devices: [‘SW-1’, ‘SW-2’, ‘SW-3’]

+AFTER+
#python .\network_sketcher.py show l1_link --master “C:\work[MASTER]test.xlsx”
[[‘SW-1’, ‘GigabitEthernet 0/0’], [‘SW-3’, ‘GigabitEthernet 0/1’]]
[[‘SW-1’, ‘GigabitEthernet 0/1’], [‘SW-2’, ‘GigabitEthernet 0/0’]]
[[‘SW-2’, ‘GigabitEthernet 0/1’], [‘SW-3’, ‘GigabitEthernet 0/2’]]

[Tips]

  • All elements (device names, port names) must be enclosed in single or double quotes
  • Using the same port multiple times within a batch will cause an error
  • Ports already in use by existing links cannot be used

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 [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', '']

+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 l2_segment_bulk

This feature allows you to create Layer 2 segments (such as VLANs) on multiple interfaces in bulk. You can add multiple L2 segments to multiple interfaces in a single operation, significantly improving performance compared to individual add l2_segment commands. Existing L2 segments on interfaces are preserved, and new segments are merged and sorted.

python [file path]/network_sketcher.py add l2_segment_bulk "[['device_name1','port_name1',['vlan1','vlan2']],['device_name2','port_name2',['vlan3']]]" --master [master file path]

Multi-device list (Option A): Specify a list of device names as the first element to apply the same segments to multiple devices at once.

[["device_name1","device_name2"],"port_name",["vlan1","vlan2"]]

Port name list (Option B): Specify a list of port names as the second element to apply the same segments to multiple ports at once.

[["device_name",["port1","port2"],["vlan1","vlan2"]]]

Combined (Option A + B): Both can be combined in a single entry.

[[["device_name1","device_name2"],["port1","port2"],["vlan1","vlan2"]]]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', 'Vlan100', '']
['L3SW1', 'GigabitEthernet 0/1', '', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '', '']

+l2_segment_bulk added+
#python .\network_sketcher.py add l2_segment_bulk "[['L3SW1','GigabitEthernet 0/0',['Vlan200','Vlan300']],['L3SW1','GigabitEthernet 0/1',['Vlan100','Vlan200']],['L3SW2','GigabitEthernet 0/0',['Vlan100','Vlan200','Vlan300']]]" --master "C:\work[MASTER]test.xlsx"

--- Added L2 segment(s) in bulk ---
L3SW1(GigabitEthernet 0/0) <- Vlan200, Vlan300
Final: Vlan100, Vlan200, Vlan300
L3SW1(GigabitEthernet 0/1) <- Vlan100, Vlan200
Final: Vlan100, Vlan200
L3SW2(GigabitEthernet 0/0) <- Vlan100, Vlan200, Vlan300
Final: Vlan100, Vlan200, Vlan300

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']
['L3SW1', 'GigabitEthernet 0/1', '', 'Vlan100,Vlan200', '']
['L3SW2', 'GigabitEthernet 0/0', '', 'Vlan100,Vlan200,Vlan300', '']

Additional Examples (Ver 3.0.1)

Example A: Multi-device list (Option A) - apply same VLANs to multiple devices
#python .\network_sketcher.py add l2_segment_bulk "[[['Access-Stack1','Access-Stack2','Access-Stack3'],'Port-channel 1',['Vlan10','Vlan20','Vlan100','Vlan200']]]" --master "C:\work\[MASTER]test.xlsx"

Example B: Port name list (Option B) - apply same VLANs to multiple ports
#python .\network_sketcher.py add l2_segment_bulk "[['Access-Stack1',['GigabitEthernet 1/0/47','GigabitEthernet 2/0/47'],['Vlan10','Vlan20']]]" --master "C:\work\[MASTER]test.xlsx"

Example C: Combined (Option A + B) - apply same VLANs to multiple ports on multiple devices
#python .\network_sketcher.py add l2_segment_bulk "[[['Access-Stack1','Access-Stack2'],['GigabitEthernet 1/0/47','GigabitEthernet 2/0/47'],['Vlan10','Vlan20']]]" --master "C:\work\[MASTER]test.xlsx"

[Tips]

  • All elements (device names, port names, segment names) must be enclosed in single or double quotes
  • Spaces in segment names are automatically removed (e.g., ' Vlan 100 ' becomes 'Vlan100')
  • Duplicate segments on the same interface are automatically skipped
  • Segments are automatically sorted (VLAN numbers sorted numerically)
  • Existing L2 segments are preserved and merged with new segments
  • Cannot be used on interfaces with vport_l2_direct_binding configured
  • Physical ports (GigabitEthernet, etc.) and virtual ports (Vlan, Port-channel, etc.) are both supported
  • Specify a list of device names (e.g., ["device1","device2"]) as the first element (Option A) to apply the same segments to multiple devices at once
  • Specify a list of port names (e.g., ["port1","port2"]) as the second element (Option B) to apply the same segments to multiple ports at once
  • [IMPORTANT] When combining device list and port list (Option A + B), all listed ports must exist on every listed device

add portchannel

Create a port channel (LAG) on the Layer 1 interface.

python [file path]/network_sketcher.py add portchannel [device name] [layer1_portname] [portchannel_name] --master [master file path] 
  • ex.

+BEFORE+
#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', '', '']

+portchannel added+
#python .\network_sketcher.py add portchannel 'L3SW1' 'GigabitEthernet 0/0' 'PortChannel 1' --master "C:\work\[MASTER]test.xlsx"
--- portchannel added --- L3SW1,GigabitEthernet 0/0,PortChannel 1
#python .\network_sketcher.py add portchannel 'L3SW1' 'GigabitEthernet 0/1' 'PortChannel 1' --master "C:\work\[MASTER]test.xlsx"
--- portchannel added --- L3SW1,GigabitEthernet 0/1,PortChannel 1

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', 'PortChannel 1', '', '']
['L3SW1', 'GigabitEthernet 0/1', 'PortChannel 1', '', '']

#python .\network_sketcher.py show l3_interface --master "C:\work\[MASTER]test.xlsx"
['L3SW1', 'PortChannel 1', '', '']

add portchannel_bulk

This feature allows you to create port channels (LAGs) on multiple Layer 1 interfaces in bulk. You can assign multiple physical interfaces to port channels across multiple devices in a single operation, significantly improving performance compared to individual add portchannel commands.

python [file path]/network_sketcher.py add portchannel_bulk "[['device_name1',['port1','port2'],'portchannel_name1'],['device_name2',['port3','port4'],'portchannel_name2']]" --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '', '']
['L3SW1', 'GigabitEthernet 0/1', '', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '', '']
['L3SW2', 'GigabitEthernet 0/1', '', '', '']

#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '']
['L3SW1', 'GigabitEthernet 0/1', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '']
['L3SW2', 'GigabitEthernet 0/1', '', '']

+portchannel_bulk added+
#python .\network_sketcher.py add portchannel_bulk "[['L3SW1',['GigabitEthernet 0/0','GigabitEthernet 0/1'],'Port-channel 1'],['L3SW2',['GigabitEthernet 0/0','GigabitEthernet 0/1'],'Port-channel 1']]" --master "C:\work[MASTER]test.xlsx"
--- Added port-channel(s) in bulk ---
L3SW1: GigabitEthernet 0/0, GigabitEthernet 0/1 -> Port-channel 1
L3SW2: GigabitEthernet 0/0, GigabitEthernet 0/1 -> Port-channel 1

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', 'Port-channel 1', '', '']
['L3SW1', 'GigabitEthernet 0/1', 'Port-channel 1', '', '']
['L3SW2', 'GigabitEthernet 0/0', 'Port-channel 1', '', '']
['L3SW2', 'GigabitEthernet 0/1', 'Port-channel 1', '', '']

#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'Port-channel 1', '', '']
['L3SW2', 'Port-channel 1', '', '']

[Tips]

  • All elements (device names, port names, port-channel names) must be enclosed in single or double quotes
  • Port-channel names must be valid interface names (e.g., 'Port-channel 1', 'PortChannel 1')
  • Multiple physical interfaces can be assigned to the same port-channel in a single entry
  • An error occurs if a physical interface is already assigned to a different port-channel
  • The port-channel interface is automatically created in the L3 interface table
  • Spaces in interface names are normalized (multiple spaces converted to single space)

add virtual_port

Create Layer 3 virtual interfaces, such as VLAN interfaces (SVIs).After creating a virtual port, it will be in loopback address state, so if you want to connect to a layer 2 segment such as a VLAN, execute the add l2_segment command to connect the created virtual port to the l2_segment.

python [file path]/network_sketcher.py add 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', '', '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 virtual_port 'L3SW2' 'addvlan 999' --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 300', 'Vlan300', '']

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

add virtual_port_bulk

This feature allows you to create Layer 3 virtual interfaces (such as VLAN interfaces/SVIs and Loopback interfaces) on multiple devices in bulk. You can add multiple virtual ports to multiple devices in a single operation, significantly improving performance compared to individual add virtual_port commands.

python [file path]/network_sketcher.py add virtual_port_bulk "[['device_name1',['vport1','vport2']],['device_name2',['vport3','vport4']]]" --master [master file path]
  • ex.

+BEFORE+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '', '']

#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '']

+virtual_port_bulk added+
#python .\network_sketcher.py add virtual_port_bulk "[['L3SW1',['Vlan 100','Vlan 200','Loopback 0']],['L3SW2',['Vlan 100','Vlan 200']]]" --master "C:\work[MASTER]test.xlsx"
--- Added virtual port(s) in bulk ---
L3SW1 <- Vlan 100, Vlan 200, Loopback 0
L3SW2 <- Vlan 100, Vlan 200

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '', '']
['L3SW1', '', 'Loopback 0', '', '']
['L3SW1', '', 'Vlan 100', '', '']
['L3SW1', '', 'Vlan 200', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '', '']
['L3SW2', '', 'Vlan 100', '', '']
['L3SW2', '', 'Vlan 200', '', '']

#python .\network_sketcher.py show l3_interface --master "C:\work[MASTER]test.xlsx"
['L3SW1', 'GigabitEthernet 0/0', '', '']
['L3SW1', 'Loopback 0', '', '']
['L3SW1', 'Vlan 100', '', '']
['L3SW1', 'Vlan 200', '', '']
['L3SW2', 'GigabitEthernet 0/0', '', '']
['L3SW2', 'Vlan 100', '', '']
['L3SW2', 'Vlan 200', '', '']

[Tips]

  • All elements (device names, virtual port names) must be enclosed in single or double quotes
  • Virtual port names must be valid interface names (e.g., 'Vlan 100', 'Loopback 0', 'Tunnel 1')
  • After creating virtual ports, they are in loopback state; use add l2_segment or add l2_segment_bulk to connect to L2 segments
  • Duplicate virtual port names on the same device are automatically skipped with a warning
  • An error occurs if the virtual port name conflicts with an existing L1 interface name
  • Virtual ports are automatically sorted by interface value (e.g., Vlan 100 before Vlan 200)
  • Spaces in interface names are normalized (multiple spaces converted to single space)

add vport_l1if_direct_binding

This adds a virtual port that connects directly to a layer 1 interface. For example, this is used when creating subinterfaces on a router and configuring dot1q tagging for each subinterface. It is also possible to configure multiple virtual ports to be connected to a single layer 1 interface. This setting alone only creates a subinterface, so to send and receive layer 2 data, you must add add vport_l2_direct_binding to this setting and add layer 2 elements such as VLANs to the virtual port created.

python [file path]/network_sketcher.py add vport_l1if_direct_binding [device name] [Layer1 port] [vport_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', '', '', '']

+vport_l1if_direct_binding added+
#python .\network_sketcher.py add vport_l1if_direct_binding "Catalyst 3560" "GigabitEthernet 0/0" "GigabitEthernet 0/0.100" --master "C:\work\[MASTER]test.xlsx"
--- vport_l1if_direct_binding added --- Catalyst 3560,GigabitEthernet 0/0,GigabitEthernet 0/0.100

+AFTER+
#python .\network_sketcher.py show l2_interface --master "C:\work\[MASTER]test.xlsx"
['Catalyst 3560', 'GigabitEthernet 0/0', 'GigabitEthernet 0/0.100', '', '']

add vport_l2_direct_binding

This command allows a virtual port to directly send and receive Layer 2 data such as VLANs. Normally, a virtual port is connected to an l2_segment, and then that l2_segment is connected to a Layer 1 interface, thereby connecting the Layer 1 interface and the virtual port. However, this command directly connects a virtual port to a Layer 1 interface, allowing Layer 2 elements such as VLANs (l2_segment) to be sent and received. For example, this command is used when creating subinterfaces on a router and configuring dot1q tagging for each subinterface. It is also possible to configure a single virtual port to send and receive Layer 2 data such as multiple VLANs. Note that l2_segment and vport_l2_direct_binding cannot be registered simultaneously on the same virtual port.

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

+virtual_port added+
#python .\network_sketcher.py add vport_l2_direct_binding "Catalyst 3560" "GigabitEthernet 0/0.100" vlan100 --master "C:\work\[MASTER]test.xlsx"
--- vport_l2_direct_binding added --- 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', '', 'vlan100']

add waypoint

Adds a new waypoint in the specified direction relative to an existing waypoint. Waypoints are added to the dedicated waypoint area (area names ending with wp).

python [file path]/network_sketcher.py add waypoint [new_waypoint_name] [reference_waypoint] [direction] --master [master file path]

[direction] specifications:

UP : Add above the reference waypoint
DOWN : Add below the reference waypoint
LEFT : Add to the left of the reference waypoint
RIGHT : Add to the right of the reference waypoint

  • ex.

+BEFORE+
#python .\network_sketcher.py show waypoint_location --master “C:\work[MASTER]test.xlsx”
[‘WAN-1_wp_’, [[‘WAN-1’]]]

+waypoint added+
#python .\network_sketcher.py add waypoint ‘WAN-2’ 'WAN-1' ‘RIGHT’ --master “C:\work[MASTER]test.xlsx”
--- Waypoint added --- WAN-2 relative to WAN-1 with direction RIGHT

+AFTER+
#python .\network_sketcher.py show waypoint_location --master “C:\work[MASTER]test.xlsx”
[‘WAN-1_wp_’, [[‘WAN-1’, ‘WAN-2’]]]

[Tips]

  • Waypoints are always placed within dedicated waypoint areas (area names ending with wp)
  • An error occurs if the reference device is not present in a dedicated waypoint area
  • If a regular area exists adjacent to the X-axis, only UP/DOWN can be used
  • If all areas adjacent to the X-axis are waypoint areas or empty, only LEFT/RIGHT can be used

Clone this wiki locally