Netmiko Device Commands¶
This section contains details of the commands capable of being executed by the switches and the CLI commands sent to the switch for each command module that is selected.
Switches¶
AristaEos:¶
Device Name: Arista EOS
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan {segmentation_id}
no switchport mode trunk
switchport trunk allowed vlan none
SET_NATIVE_VLAN:¶
Sets a specified native VLAN
interface {port}
switchport mode trunk
switchport trunk native vlan {segmentation_id}
switchport trunk allowed vlan add {segmentation_id}
DELETE_NATIVE_VLAN:¶
Removes the native VLAN
interface {port}
no switchport trunk native vlan {segmentation_id}
switchport trunk allowed vlan remove {segmentation_id}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
switchport trunk allowed vlan add {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
switchport trunk allowed vlan remove {segmentation_id}
ArubaOSCX:¶
Device Name: ArubaOS-CX
Port can be disabled: True
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
no routing
vlan access {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no vlan access {segmentation_id}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
no routing
vlan trunk allowed {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
no vlan trunk allowed {segmentation_id}
ENABLE_PORT:¶
Enables the port
interface {port}
no shutdown
DISABLE_PORT:¶
Shuts down the port
interface {port}
shutdown
BrocadeFastIron:¶
Device Name: Brocade ICX (FastIron)
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id} by port
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
vlan {segmentation_id} by port
untagged ether {port}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
vlan {segmentation_id} by port
no untagged ether {port}
QUERY_PORT:¶
Shows details about the switch for that port
show interfaces ether {port} | include VLAN
CiscoIos:¶
Device Name: Cisco IOS
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan {segmentation_id}
no switchport mode trunk
switchport trunk allowed vlan none
SET_NATIVE_VLAN:¶
Sets a specified native VLAN
interface {port}
switchport mode trunk
switchport trunk native vlan {segmentation_id}
switchport trunk allowed vlan add {segmentation_id}
DELETE_NATIVE_VLAN:¶
Removes the native VLAN
interface {port}
no switchport mode trunk
no switchport trunk native vlan {segmentation_id}
switchport trunk allowed vlan remove {segmentation_id}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
switchport mode trunk
switchport trunk allowed vlan add {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
switchport trunk allowed vlan remove {segmentation_id}
CiscoNxOS:¶
Device Name: Cisco NX-OS (Nexus)
Port can be disabled: True
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
exit
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
exit
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan
exit
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
switchport mode trunk
switchport trunk allowed vlan add {segmentation_id}
exit
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
switchport trunk allowed vlan remove {segmentation_id}
exit
ENABLE_PORT:¶
Enables the port
interface {port}
no shutdown
exit
DISABLE_PORT:¶
Shuts down the port
interface {port}
shutdown
exit
Cisco300:¶
Device Name: Cisco 300-Series
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan
switchport trunk allowed vlan remove all
Cumulus:¶
Device Name: Cumulus Linux (via NCLU)
Port can be disabled: True
Built for Cumulus 4.x
Note for this switch you want config like this, where secret is the password needed for sudo su:
[genericswitch:<hostname>] device_type = netmiko_cumulus ip = <ip> username = <username> password = <password> secret = <password for sudo> ngs_physical_networks = physnet1 ngs_max_connections = 1 ngs_port_default_vlan = 123 ngs_disable_inactive_ports = False
NETMIKO_DEVICE_TYPE:¶
Netmiko compatible device type
linux
ADD_NETWORK:
~~~~~~~~~~~~
A tuple of command strings used to add a VLAN
net add vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
net del vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
net add interface {port} bridge access {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
net del interface {port} bridge access {segmentation_id}
PLUG_BOND_TO_NETWORK:¶
Adds bond to the bridge as a port for the VLAN
net add bond {bond} bridge access {segmentation_id}
UNPLUG_BOND_FROM_NETWORK:¶
Removes bond’s access VLAN assignment
net del bond {bond} bridge access {segmentation_id}
ENABLE_PORT:¶
Enables the port
net del interface {port} link down
DISABLE_PORT:¶
Shuts down the port
net add interface {port} link down
ENABLE_BOND:¶
Enables bond interface by removing link down state
net del bond {bond} link down
DISABLE_BOND:¶
Disables bond interface by setting its link state to down
net add bond {bond} link down
SAVE_CONFIGURATION:¶
Saves the configuration
net commit
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
re.compile('ERROR: Command not found.')
re.compile('command not found')
re.compile('is not a physical interface on this switch')
CumulusNVUE:¶
Device Name: Cumulus Linux(via NVUE)
Port can be disabled: True
Built for Cumulus 5.x
Note for this switch you want config like this, where secret is the password needed for sudo su:
[genericswitch:<hostname>] device_type = netmiko_cumulus_nvue ip = <ip> username = <username> password = <password> secret = <password for sudo> ngs_physical_networks = physnet1 ngs_max_connections = 1 ngs_port_default_vlan = 123 ngs_disable_inactive_ports = False
NETMIKO_DEVICE_TYPE:¶
Netmiko compatible device type
linux
ADD_NETWORK:
~~~~~~~~~~~~
A tuple of command strings used to add a VLAN
nv set bridge domain br_default vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
nv unset bridge domain br_default vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
nv unset interface {port} bridge domain br_default untagged
nv set interface {port} bridge domain br_default access {segmentation_id}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
nv unset interface {port} bridge domain br_default access
nv set interface {port} bridge domain br_default vlan {segmentation_id}
ADD_NETWORK_TO_BOND_TRUNK:¶
Adds a VLAN to the bond interface for trunking
nv unset interface {bond} bridge domain br_default access
nv set interface {bond} bridge domain br_default vlan {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
nv unset interface {port} bridge domain br_default vlan {segmentation_id}
DELETE_NETWORK_ON_BOND_TRUNK:¶
Removes a VLAN from the bond interface for trunking
nv unset interface {bond} bridge domain br_default vlan {segmentation_id}
SET_NATIVE_VLAN:¶
Sets a specified native VLAN
nv unset interface {port} bridge domain br_default access
nv set interface {port} bridge domain br_default untagged {segmentation_id}
nv set interface {port} bridge domain br_default vlan {segmentation_id}
SET_NATIVE_VLAN_BOND:¶
Sets the native VLAN for the bond interface
nv unset interface {bond} bridge domain br_default access
nv set interface {bond} bridge domain br_default untagged {segmentation_id}
nv set interface {bond} bridge domain br_default vlan {segmentation_id}
DELETE_NATIVE_VLAN:¶
Removes the native VLAN
nv unset interface {port} bridge domain br_default untagged {segmentation_id}
nv unset interface {port} bridge domain br_default vlan {segmentation_id}
DELETE_NATIVE_VLAN_BOND:¶
Unsets the native VLAN for the bond interface
nv unset interface {bond} bridge domain br_default untagged {segmentation_id}
nv unset interface {bond} bridge domain br_default vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
nv unset interface {port} bridge domain br_default access
nv unset interface {port} bridge domain br_default untagged
nv unset interface {port} bridge domain br_default vlan
ENABLE_PORT:¶
Enables the port
nv set interface {port} link state up
DISABLE_PORT:¶
Shuts down the port
nv set interface {port} link state down
SAVE_CONFIGURATION:¶
Saves the configuration
nv config save
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
re.compile('Invalid config')
re.compile('Config invalid at')
re.compile('ERROR: Command not found.')
re.compile('command not found')
re.compile('is not a physical interface on this switch')
re.compile('Error: Invalid parameter')
re.compile('Unable to restart services')
re.compile('Failure during apply')
DellNos:¶
Device Name: Dell Force10 (OS9)(netmiko_dell_force10)
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
interface vlan {segmentation_id}
description {network_name}
exit
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no interface vlan {segmentation_id}
exit
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface vlan {segmentation_id}
untagged {port}
exit
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface vlan {segmentation_id}
no untagged {port}
exit
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface vlan {segmentation_id}
tagged {port}
exit
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface vlan {segmentation_id}
no tagged {port}
exit
DellOS10:¶
Device Name: Dell OS10 (netmiko_dell_os10)
Port can be disabled: True
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
interface vlan {segmentation_id}
description {network_name}
exit
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no interface vlan {segmentation_id}
exit
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
exit
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan
exit
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
switchport mode trunk
switchport trunk allowed vlan {segmentation_id}
exit
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
no switchport trunk allowed vlan {segmentation_id}
exit
SET_NATIVE_VLAN:¶
Sets a specified native VLAN
interface {port}
switchport mode trunk
switchport access vlan {segmentation_id}
DELETE_NATIVE_VLAN:¶
Removes the native VLAN
interface {port}
no switchport access vlan
ENABLE_PORT:¶
Enables the port
interface {port}
no shutdown
exit
DISABLE_PORT:¶
Shuts down the port
interface {port}
shutdown
exit
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
DellPowerConnect:¶
Device Name: Dell PowerConnect
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan database
vlan {segmentation_id}
exit
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
vlan database
no vlan {segmentation_id}
exit
PLUG_PORT_TO_NETWORK_GENERAL:¶
Allows the VLAN and lets it carry untagged frames
interface {port}
switchport general allowed vlan add {segmentation_id} untagged
switchport general pvid {segmentation_id}
exit
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport access vlan {segmentation_id}
exit
DELETE_PORT_GENERAL:¶
Removes VLAN from allowed list and stops allowing it to carry untagged frames
interface {port}
switchport general allowed vlan remove {segmentation_id}
no switchport general pvid
exit
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
switchport access vlan none
exit
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
interface {port}
switchport general allowed vlan add {segmentation_id} tagged
exit
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
interface {port}
switchport general allowed vlan remove {segmentation_id}
exit
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
re.compile('\% Incomplete command')
re.compile('VLAN was not created by user')
re.compile('Configuration Database locked by another application \- try later')
re.compile('Port is not in Layer-2 mode')
Fake:¶
Netmiko device driver for Fake switches.
NETMIKO_DEVICE_TYPE:¶
Netmiko compatible device type
linux
ADD_NETWORK:
~~~~~~~~~~~~
A tuple of command strings used to add a VLAN
add network {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
delete network {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
plug port {port} to network {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
delete port {port}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
add network {segmentation_id} to trunk {port}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
remove network {segmentation_id} from trunk {port}
ENABLE_PORT:¶
Enables the port
enable {port}
DISABLE_PORT:¶
Shuts down the port
disable {port}
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
HpeComware:¶
Device Name: HPE 5900 Series Switches
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
undo vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
port link-type access
port access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
undo port access vlan
HpeComware:¶
Device Name: HPE 5900 Series Switches
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
undo vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
port link-type access
port access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
undo port access vlan
Huawei:¶
Device Name: Huawei (VRP V3 and V5)
For Huawei Network Operating System VRP V3 and V5.
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
undo vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
port link-type access
port default vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
undo port default vlan {segmentation_id}
Huawei:¶
Device Name: Huawei (VRP V8)
For Huawei Next-Generation Network Operating System VRP V8.
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
commit
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
undo vlan {segmentation_id}
commit
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
port link-type access
port default vlan {segmentation_id}
commit
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
undo port default vlan {segmentation_id}
commit
Juniper:¶
Device Name: Juniper Junos OS
Port can be disabled: True
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
set vlans {network_name} vlan-id {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
delete vlans {network_name}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
delete interfaces {port} unit 0 family ethernet-switching vlan members
set interfaces {port} unit 0 family ethernet-switching vlan members {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
delete interfaces {port} unit 0 family ethernet-switching vlan members
ENABLE_PORT:¶
Enables the port
delete interfaces {port} disable
DISABLE_PORT:¶
Shuts down the port
set interfaces {port} disable
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
set interfaces {port} unit 0 family ethernet-switching vlan members {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
delete interfaces {port} unit 0 family ethernet-switching vlan members {segmentation_id}
MellanoxMlnxOS:¶
Device Name: Mellanox MLNX-OS
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface ethernet {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface ethernet {port}
no switchport access vlan
no switchport mode
NokiaSRL:¶
Device Name: Nokia SR Linux OS
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
set tunnel-interface vxlan0 vxlan-interface {segmentation_id} type bridged
set tunnel-interface vxlan0 vxlan-interface {segmentation_id} ingress vni {segmentation_id}
set tunnel-interface vxlan0 vxlan-interface {segmentation_id} egress source-ip use-system-ipv4-address
set network-instance mac-vrf-{segmentation_id} type mac-vrf
set network-instance mac-vrf-{segmentation_id} description OS-Network-ID-{network_name}
set network-instance mac-vrf-{segmentation_id} vxlan-interface vxlan0.{segmentation_id}
set network-instance mac-vrf-{segmentation_id} protocols bgp-evpn bgp-instance 1 vxlan-interface vxlan0.{segmentation_id}
set network-instance mac-vrf-{segmentation_id} protocols bgp-evpn bgp-instance 1 evi {segmentation_id}
set network-instance mac-vrf-{segmentation_id} protocols bgp-evpn bgp-instance 1 ecmp 8
set network-instance mac-vrf-{segmentation_id} protocols bgp-vpn bgp-instance 1 route-target export-rt target:1:{segmentation_id}
set network-instance mac-vrf-{segmentation_id} protocols bgp-vpn bgp-instance 1 route-target import-rt target:1:{segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
delete network-instance mac-vrf-{segmentation_id}
delete tunnel-interface vxlan0 vxlan-interface {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
set interface {port} subinterface {segmentation_id} type bridged
set network-instance mac-vrf-{segmentation_id} interface {port}.{segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
delete network-instance mac-vrf-{segmentation_id} interface {port}.{segmentation_id}
delete interface {port} subinterface {segmentation_id}
OvsLinux:¶
Device Name: OpenVSwitch
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
ovs-vsctl set port {port} vlan_mode=access
ovs-vsctl set port {port} tag={segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
ovs-vsctl clear port {port} tag
ovs-vsctl clear port {port} trunks
ovs-vsctl clear port {port} vlan_mode
SET_NATIVE_VLAN:¶
Sets a specified native VLAN
ovs-vsctl set port {port} vlan_mode=native-untagged
ovs-vsctl set port {port} tag={segmentation_id}
ovs-vsctl add port {port} trunks {segmentation_id}
DELETE_NATIVE_VLAN:¶
Removes the native VLAN
ovs-vsctl clear port {port} vlan_mode
ovs-vsctl clear port {port} tag
ovs-vsctl remove port {port} trunks {segmentation_id}
SET_NATIVE_VLAN_BOND:¶
Sets the native VLAN for the bond interface
ovs-vsctl set port {bond} vlan_mode=native-untagged
ovs-vsctl set port {bond} tag={segmentation_id}
ovs-vsctl add port {bond} trunks {segmentation_id}
DELETE_NATIVE_VLAN_BOND:¶
Unsets the native VLAN for the bond interface
ovs-vsctl clear port {bond} vlan_mode
ovs-vsctl clear port {bond} tag
ovs-vsctl remove port {bond} trunks {segmentation_id}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
ovs-vsctl add port {port} trunks {segmentation_id}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
ovs-vsctl remove port {port} trunks {segmentation_id}
ADD_NETWORK_TO_BOND_TRUNK:¶
Adds a VLAN to the bond interface for trunking
ovs-vsctl add port {bond} trunks {segmentation_id}
DELETE_NETWORK_ON_BOND_TRUNK:¶
Removes a VLAN from the bond interface for trunking
ovs-vsctl remove port {bond} trunks {segmentation_id}
Pluribus:¶
Device Name: Pluribus
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan-create id {segmentation_id} scope fabric ports none description {network_name} auto-vxlan
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
vlan-delete id {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
vlan-port-remove vlan-range all ports {port}
port-vlan-add port {port} untagged-vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
vlan-port-remove vlan-range all ports {port}
Ruijie:¶
Device Name: Ruijie
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan {segmentation_id}
no switchport mode trunk
switchport trunk allowed vlan none
Sonic:¶
Device Name: SONiC
Built for SONiC 3.x
Note for this switch you want config like this, where secret is the password needed for sudo su:
[genericswitch:<hostname>] device_type = netmiko_sonic ip = <ip> username = <username> password = <password> secret = <password for sudo> ngs_physical_networks = physnet1 ngs_max_connections = 1 ngs_port_default_vlan = 123 ngs_disable_inactive_ports = False
NETMIKO_DEVICE_TYPE:¶
Netmiko compatible device type
linux
ADD_NETWORK:
~~~~~~~~~~~~
A tuple of command strings used to add a VLAN
config vlan add {segmentation_id}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
config vlan del {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
config vlan member add -u {segmentation_id} {port}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
config vlan member del {segmentation_id} {port}
ADD_NETWORK_TO_TRUNK:¶
Adds a network to a trunk port.
config vlan member add {segmentation_id} {port}
REMOVE_NETWORK_FROM_TRUNK:¶
Removes a network from a trunk port.
config vlan member del {segmentation_id} {port}
SAVE_CONFIGURATION:¶
Saves the configuration
config save -y
ERROR_MSG_PATTERNS:¶
A tuple of regular expressions. These patterns are used to match and handle error messages returned by the switch.
re.compile('VLAN[0-9]+ doesn\'t exist')
re.compile('Invalid Vlan Id , Valid Range : 1 to 4094')
re.compile('Interface name is invalid!!')
re.compile('No such command')
SupermicroSmis:¶
Device Name: Supermicro
A class to represent a Supermicro SMIS switch.
ADD_NETWORK:¶
A tuple of command strings used to add a VLAN
vlan {segmentation_id}
name {network_name}
DELETE_NETWORK:¶
A tuple of command strings used to delete a VLAN
no vlan {segmentation_id}
PLUG_PORT_TO_NETWORK:¶
A tuple of command strings used to configure a port to connect to a specific VLAN
interface {port}
switchport mode access
switchport access vlan {segmentation_id}
DELETE_PORT:¶
A tuple of command strings used to remove a port from the VLAN
interface {port}
no switchport access vlan {segmentation_id}
no switchport mode trunk
switchport trunk allowed vlan none