Skip to content

OPX commands

Amy Buck edited this page Nov 20, 2018 · 26 revisions

OPX commands are available for Linux management for release 3.0.0.

Note: Use source etc/opx/opx-environment.sh in advance before using any of these commands.

  • [#opx-config-fanout]

opx-chassis-beacon

Easily identify each time a beacon is sent to check for pending packets on the interface.

opx-chassis-beacon [on | off]

Enable beacon LED

$ opx-chassis-beacon on

opx-config-fanout

Using a breakout cable, you can split a 40GbE physical port into four (quad) 10GbE SFP+ ports (if supported by the NPU). Each 4x10G port is represented by a Linux interface with a fanout field in the interface name that identifies the 4x10G port.

NOTE: The fanout configuration can be saved persistently over reboots if you edit the /etc/opx/dn_nas_fanout_init_config.xml file on the target.

You can fanout a 40GbE port, then return the physical port to 40G operation.

opx-config-fanout portID <mode> <interface_speed>

Fanout e101-005-0 port

$ opx-config-fanout e101-001-0 4x1 10g
Deleting.. e101-001-0
Completed...
Creating interface e101-001-1
Creating interface e101-001-2
Creating interface e101-001-3
Creating interface e101-001-4
Successfully created interfaces...

Unconfigure fanout e101-005-0 port

# opx-config-fanout e101-001-0 1x1 40g
Deleting.. e101-001-1
Deleting.. e101-001-1
Deleting.. e101-001-1
Deleting.. e101-001-2
Deleting.. e101-001-1
Deleting.. e101-001-3
Deleting.. e101-001-3
Deleting.. e101-001-4
Completed...

Example dn_nas_fanout_init_config.xml

<interfaces> 
    <interface name="e101-001-0" fanout="4x1" speed="10G"/> 
    <interface name="e101-002-0" fanout="1x1" speed="40G"/>
</interfaces>

opx-config-switch

Reconfigure MAC age-timer and set switch values, and display current switch values.

opx-config-switch [set | show]

Set switch values

$ opx-config-switch set switch-id=0 mac-age-timer=1900
Success

Show switch values

$ opx-config-switch show
Key: 2.3.0966121.
base-switch/switching-entities/switch-count = 1
Key: 1.30.1966121.1966082.1966085.
base-switch/switching-entities/switching-entity/bridge-table-size = 163840
base-switch/switching-entities/switching-entity/acl-table-max-priority = 11
base-switch/switching-entities/switching-entity/acl-entry-min-priority = 0
base-switch/switching-entities/switching-entity/acl-table-min-priority = 0
base-switch/switching-entities/switching-entity/ecmp-hash-fields  =  8,9,5,3,10,4,2,1,7,6
base-switch/switching-entities/switching-entity/npu-identifiers  =  0
base-switch/switching-entities/switching-entity/mac-age-timer = 1800
base-switch/switching-entities/switching-entity/lag-hash-algorithm = 2
base-switch/switching-entities/switching-entity/switch-id = 0
base-switch/switching-entities/switching-entity/temperature = 45
base-switch/switching-entities/switching-entity/switch-mode = 2
base-switch/switching-entities/switching-entity/lag-hash-fields  =  8,9,5,3,10,4,2,1,7,6
base-switch/switching-entities/switching-entity/max-ecmp-entry-per-group = 64
base-switch/switching-entities/switching-entity/ecmp-hash-algorithm = 2
base-switch/switching-entities/switching-entity/acl-entry-max-priority = 2147483647
base-switch/switching-entities/switching-entity/default-mac-address = 90:b1:1c:f4:aa:81
base-switch/switching-entities/switching-entity/max-mtu = 9216

opx-config-vrf

Creates virtual routing and forwarding (VRF) network namespace, add ports to the VRF, and remove the VRF.

opx-vrf-config [-c,--create | -d,--delete | -v,--vrf | -p,--port | --addport | --removeport | -s,--show]

Options:

  • -c,--create — add VRF to the configuration
  • -d,--delete — delete a specific VRF
  • -v,--vrf — VRF name to create
  • -p,--port — port to be added to VRF
  • --addport — add port to given VRF
  • --removeport — remove port from given VRF
  • -s,--show — display VRF parameter or show all parameters

Create VRF

$ opx-vrf-config --create --vrfblue --port e101-001-0
Configuration successful...

Show VRF

$ opx-vrf-config --show
Key: 1.292.19136521.
ni/network-instances/network-instance/name = blue
Key: 1.292.19136521.
ni/network-instances/network-instance/name = default

Remove VRF

$ opx-vrf-config --removeport --vrf blue --port e101-001-0
Configuration successful...

opx-ethtool

Display statistics and media information from a Linux interface which maps to a physical port. The output is a subset of the opx-show-stats output for the same physical port interface.

opx-ethtool [-v | -e | -s | -S]

Options:

  • -v — display version information
  • -e — display transceiver statistics
  • -s — display port speed, duplex, and auto-negotiation settings
  • -S — display port statistics

View port stats

$ opx-ethtool -S e101-001-0
Statistics for interface e101-001-0
  Ether statistics:
    rx_bytes: 9185614848
    rx_no_errors: 0
    tx_no_errors: 9003181
    tx_total_collision: 0
    rx_undersize_packets: 0
    rx_jabbers: 0
    rx_fragments: 0
    rx_align_errors: 0
    rx_discards: 0
    rx_mcast_packets: 35445
    rx_bcast_packets: 0
    rx_oversize_packets: 0
    tx_oversize_packets: 0
    rx_64_byte_packets: 0
    rx_65_to_127_byte_packets: 0
    rx_128_to_255_byte_packets: 0
    rx_256_to_511_byte_packets: 0
    rx_512_to_1023_byte_packets: 0
    rx_1024_to_1518_byte_packets: 0
    rx_1519_to_2047_byte_packets: 0
    rx_2048_to_4095_byte_packets: 0
    rx_4096_to_9216_byte_packets: 0
    tx_64_byte_packets: 0
    tx_65_to_127_byte_packets: 33217
    tx_128_to_255_byte_packets: 2228
    tx_256_to_511_byte_packets: 0
    tx_512_to_1023_byte_packets: 0
    tx_1024_to_1518_byte_packets: 8967736
    tx_1519_to_2047_byte_packets: 0
    tx_2048_to_4095_byte_packets: 0
    tx_4096_to_9216_byte_packets: 0

View transceiver stats

$ opx-ethtool -e e101-001-0
Show media info for e101-001-0
if_index is 17
Key: 2.19.1245389.1245248.1245249.1245250.
base-pas/media/rate-identifier = 0
base-pas/media/oper-status = 0
base-pas/media/category = 3
base-pas/media/voltage-state = 1
base-pas/media/bias-low-warning-threshold =
base-pas/media/vendor-pn = 568400002
base-pas/media/current-temperature = ??
base-pas/media/insertion-cnt = 0
base-pas/media/voltage-low-warning-threshold =
base-pas/media/cc_ext = 162
base-pas/media/length-om2 = 0
base-pas/media/length-om3 = 0
base-pas/media/rx-power-low-alarm-threshold =
base-pas/media/length-om1 = 0
base-pas/media/vendor-id = AP
base-pas/media/media-category/sfp-plus/br-max = 0
base-pas/media/connector = 33
base-pas/media/ext-transceiver = 0
base-pas/media/vendor-Specific = ffffffffffffff00000000000000000000000000000000000000000000000000
base-pas/media/media-category/sfp-plus/br-min = 0
base-pas/media/encoding = 0
base-pas/media/tx-power-high-warning-threshold =
base-pas/media/vendor-name = Amphenol
base-pas/media/rx-power-low-warning-threshold =
base-pas/media/slot = 1
base-pas/media/port = 1
base-pas/media/vendor-rev = 4700
base-pas/media/slot = 1
base-pas/media/port = 1
base-pas/media/tx-power-low-alarm-threshold =
base-pas/media/bias-low-alarm-threshold =
base-pas/media/capability = 6
base-pas/media/media-category/sfp-plus/sff-8472-compliance = 0
base-pas/media/diag-mon-type = 0
base-pas/media/temp-state = 1
base-pas/media/type = 43
base-pas/media/media-category/qsfp-plus/wavelength-tolerance = 0
base-pas/media/ext-identifier = 0
base-pas/media/temp-low-warning-threshold =
base-pas/media/voltage-high-warning-threshold =
base-pas/media/temp-high-alarm-threshold =
base-pas/media/length-sfm = 0
base-pas/media/rate-select-state = 0
base-pas/media/rx-power-measurement-type = 0
base-pas/media/wavelength = 0
base-pas/media/cc_base = 54
base-pas/media/temp-low-alarm-threshold =
base-pas/media/tx-power-low-warning-threshold =
base-pas/media/insertion-timestamp = 0
base-pas/media/current-voltage =
base-pas/media/bias-high-alarm-threshold =
base-pas/media/high-power-mode = 1
base-pas/media/br-nominal = 0
base-pas/media/options = 0
base-pas/media/rx-power-high-warning-threshold =
base-pas/media/date-code = 3131303632322000
base-pas/media/present = 1
base-pas/media/transceiver = 0000000000000000205c
base-pas/media/length-cable = 2
base-pas/media/voltage-high-alarm-threshold =
base-pas/media/identifier = 12
base-pas/media/voltage-low-alarm-threshold =
base-pas/media/dell-qualified = 0
base-pas/media/length-sfm-km = 0
base-pas/media/rx-power-high-alarm-threshold =
base-pas/media/admin-status = 0
base-pas/media/serial-number = APF11240020140
base-pas/media/tx-power-high-alarm-threshold =
base-pas/media/temp-high-warning-threshold =
base-pas/media/bias-high-warning-threshold =
base-pas/media/enhanced-options = 0
base-pas/media/media-category/qsfp-plus/max-case-temp = 70 

opx_logging_cli

Enables logging which is maintained in the var/log/syslog file. You must restart the module after changing logging levels.

opx_logging_cli [show-id | show all module-id {log-level value} | enable | disable]

Options:

  • show-id — display module IDs and current logging levels
  • show — display current logging status for all or specific module IDs and logging levels
  • enable — enable logging status for all or specific module IDs and logging levels
  • disable — disable logging status for all or specific module IDs and logging levels
  • log-level value — set logging levels (debug, info, notice, warning, error, critical, alert, emerg)

Enable all logging

$ opx_logging_cli enable all

Enable L3 services logging

$ opx_logging_cli enable L3_SERVICES

opx-show-alms

Display information about current alarms present in OPX.

opx-show-alms

View current alarms

$ opx-show-alms
2018-11-16 13:31:12.170129 Fan tray 1 absent
2018-11-16 13:34:09.012345 Temperature sensor NPU sensor warning

opx-show-env

Display information about environmental system components, such as temperature, fan, and voltage.

opx-show-env

View environmental information

$ opx-show-env

Node
	Vendor name:				        Dell
	Service tag: 				        69Y8VS1
	PPID: 						CN-08YWFG-28298-3AR-0087-A00
	Platform name:
	Product name: 					S6000
	Hardware version:
	Number of MAC addresses: 		        129
	Base MAC address: 				90:b1:1c:f4:a8:30
	Operating status: 				Fail
Power supplies
	Slot 1
		Present: 				Yes
		Vendor name:
		Service tag:
		PPID:					CN0T9FNW282983AR020
		Platform name:
		Product name:				CN0T9FNW282983AR020
		Hardware version:
		Operating status:			Up
		Input:					AC
		Fan airflow:				Normal
	Slot 2
		Present: 				Yes
		Vendor name:
		Service tag:
		PPID:	
		Platform name:
		Product name:
		Hardware version:
		Operating status:			Up
		Input:					Invalid
		Fan airflow:				Invalid
Fan trays
	Slot 1
		Present: 				Yes
		Vendor name:
		Service tag:
		PPID:					CN0MGDH8282983AR028
		Platform name:
		Product name:				CN0MGDH8282983AR028
		Hardware version:
		Operating status:			Up
		Fan airflow:				Reverse
	Slot 2
		Present: 				Yes
		Vendor name:
		Service tag:
		PPID:					CN0MGDH8282983AR028
		Platform name:
		Product name:				CN0MGDH8282983AR028
		Hardware version:
		Operating status:			Up
		Fan airflow:				Reverse
	Slot 3
		Present: 				Yes
		Vendor name:
		Service tag:
		PPID:					CN0MGDH8282983AR028
		Platform name:
		Product name:				CN0MGDH8282983AR028
		Hardware version:
		Operating status:			Up
		Fan airflow:				Reverse
Fans
	Fan 1, PSU slot 1
		Operating status:			Up
		Speed (RPM):				6720
		Speed (%):				37
	Fan 1, Fan tray slot 1
		Operating status:			Up
		Speed (RPM):				6916
		Speed (%):				38
	Fan 2, Fan tray slot 1
		Operating status:			Up
		Speed (RPM):				6803
		Speed (%):				37
	Fan 1, Fan tray slot 2
		Operating status:			Up
		Speed (RPM):				7188
		Speed (%):				39
	Fan 2, Fan tray slot 2
		Operating status:			Up
		Speed (RPM):				7175
		Speed (%):				39
	Fan 1, Fan tray slot 3
		Operating status:			Up
		Speed (RPM):				7201
		Speed (%):				40
	Fan 2, Fan tray slot 3
		Operating status:			Up
		Speed (RPM):				6698
		Speed (%):				37
Temperature sensors
	Sensor T2 temp sensor, Card slot 1
		Operating status:			Up
		Temperature (degrees C):	        33
	Sensor system-NIC temp sensor, Card slot 1
		Operating status:			Up
		Temperature (degrees C):	        25
	Sensor Ambient temp sensor, Card slot 1
		Operating status:			Up
		Temperature (degrees C):	        27
Sensor NPU temp sensor, Card slot 1
		Operating status:			Up
		Temperature (degrees C):	        46

opx-show-packages

Display detailed information on OPX packages including name, original and current version, if the package was altered since installation, and a short package description.

opx-show-packages

View package information

$ opx-show-packages
Name                  Original Version  Current Version  Altered  Description                                                  
=======================================================================================

libopx-nas-l3-1       3.0.0              3.0.0           No       This package contains 
base layer 3 functionality for the OpenSwitch software

libopx-nas-l2-1       1.12.0             1.12.0          No       This package contains 
L2 Network abstraction features 

opx-show-stats

Display port statistics for all or a specified Linux interface which maps to physical ports. Enter a filter_list value to display specified statistics.

opx-show-stats [if_stat iface_name filter_list | vlan_stat vlan_ifindex filter_list | clear iface_name vlan_ifindex]

Options:

  • if_stat — statistics for all or specified port interfaces
  • iface_name — physical port (such as e101-001-0)
  • filter_list — filter to retrieve stats (no filters are applied by default)
  • vlan_stat — stats for all or a specified VLAN interface
  • vlan_ifindex — VLAN ID using the interface index
  • clear — clears stats for all or a specified port or VLAN

View e101-001-0 port stats

$ opx-show-stats if_stat e101-001-0
Key:
base-stats/interface/ip/in-discards = 0
base-stats/interface/ether-octets = 13442942147
base-stats/interface/ether-out/pkts-64-octets = 0
base-stats/interface/ether-collisions = 0
base-stats/interface/ether-in/pkts-4096-to-9216-octets = 0
base-stats/interface/ether-in/pkts-1024-to-1518-octets = 0
base-stats/interface/ipv6-out-mcast-pkts = 0
base-stats/interface/if/in-octets = 0
base-stats/interface/ether-jabbers = 0
base-stats/interface/if-out-multicast-pkts = 36295
base-stats/interface/ether-out/pkts-256-to-511-octets = 0
base-stats/interface/if-out-errors = 0
base-stats/interface/ether-rx-no-errors = 0
base-stats/interface/ether/pkts-512-to-1023-octets = 0
base-stats/interface/ether/pkts-64-octets = 0
base-stats/interface/ether/pkts-1024-to-1518-octets = 13125220
base-stats/interface/ipv6/out-discards = 0
base-stats/interface/if/out-octets = 13442942147
base-stats/interface/ether-in/pkts-256-to-511-octets = 0
base-stats/interface/if/out-ucast-pkts = 13125220
base-stats/interface/ether-fragments = 0
base-stats/interface/ether-crc-align-errors = 0
base-stats/interface/ipv6-in-mcast-pkts = 0
base-stats/interface/ether-out/pkts-65-to-127-octets = 34014
base-stats/interface/if-out-broadcast-pkts = 0
base-stats/interface/ether-drop-events = 0
base-stats/interface/if/in-ucast-pkts = 0
base-stats/interface/ether-out/pkts-128-to-255-octets = 2281
base-stats/interface/ether-in/pkts-2048-to-4095-octets = 0
base-stats/interface/ether-tx-oversize-pkts = 0
base-stats/interface/ether/pkts-256-to-511-octets = 0
base-stats/interface/ether-multicast-pkts = 36295
base-stats/interface/ether-out/pkts-4096-to-9216-octets = 0
base-stats/interface/ether/pkts-128-to-255-octets = 2281
base-stats/interface/ether-in/pkts-128-to-255-octets = 0
base-stats/interface/time-stamp = 1455586392
base-stats/interface/ip-in-receives = 0
base-stats/interface/ether-rx-oversize-pkts = 0
base-stats/interface/ether-oversize-pkts = 0
base-stats/interface/ether-out/pkts-1024-to-1518-octets = 13125220
base-stats/interface/if-in-errors = 0
base-stats/interface/ether-out/pkts-512-to-1023-octets = 0
base-stats/interface/if/in-non-ucast-pkts = 0
base-stats/interface/ether-in/pkts-65-to-127-octets = 0
base-stats/interface/ether/pkts-65-to-127-octets = 34014
base-stats/interface/if/in-discards = 0
base-stats/interface/ipv6-in-receives = 0
base-stats/interface/if/out-non-ucast-pkts = 36295
base-stats/interface/ipv6/in-discards = 0
base-stats/interface/ether-tx-no-errors = 13161515
base-stats/interface/ether-broadcast-pkts = 0
base-stats/interface/if-in-broadcast-pkts = 0
base-stats/interface/if/out-discards = 0
base-stats/interface/ether-out/pkts-1519-to-2047-octets = 0
base-stats/interface/ether-out/pkts-2048-to-4095-octets = 0
base-stats/interface/ether-pkts = 13161515
base-stats/interface/ether-in/pkts-1519-to-2047-octets = 0
base-stats/interface/ether/pkts-4096-to-9216-octets = 0
base-stats/interface/ether-undersize-pkts = 0
base-stats/interface/if-in-unknown-protos = 0
base-stats/interface/if-out-qlen = 0
base-stats/interface/if-in-multicast-pkts = 0
base-stats/interface/ether-in/pkts-64-octets = 0
base-stats/interface/ether-in/pkts-512-to-1023-octets = 0 

View VLAN stats

$ opx-show-stats vlan_stat br1
Key:
base-stats/vlan/time-stamp:  1455586573
base-stats/vlan/in-octets:  16381983058
base-stats/vlan/in-pkts:  16101053
base-stats/vlan/out-octets:  55146334258
base-stats/vlan/out-pkts:  67419926 

Clear port stats

$ opx-show-stats clear e101-001-0
Success 

opx-show-system-status

Display system status information including failed services and corrupted packages.

opx-show-system-status

View system status

$ opx-show-system-status
System State:  running
No Failed Service
No Modified Package

opx-show-transceivers

Display information about the transceiver types present.

opx-show-transceivers [summary]

View transceiver summary

$ opx-show-transceivers summary
Front Panel Port  Media Type      Part Number     Serial Number DellQualified
1             QSFP 40GBASE SR4    AFBR-79E4Z-D-FT1 7503832L005V    Yes
2             QSFP 40GBASE SR4    AFBR-79EQDZ-FT1  482943B200GW    Yes
3             QSFP 40GBASE CR4 3M 616750003        CN0FC6KV35D6864 Yes
4             Not Present
5             Not Present
...
32            Not Present

opx-show-version

Display OPX software version information.

opx-show-version

View OPX version

$ opx-show-version
OS_NAME="OPX"
OS_VERSION="3.0.0"
PLATFORM="S6000-ON"
ARCHITECTURE="x86_64"
INTERNAL_BUILD_ID="OpenSwitch Blue Print 1.0.0"
BUILD_VERSION="3.0.0(27)"
BUILD_DATE="2018-07-25T16:28:19-0700"
INSTALL_DATE="2018-07-08T06:24:18+0000"
SYSTEM_UPTIME= 21 minutes
SYSTEM_STATE= degraded
UPGRADED_PACKAGES=no
ALTERED_PACKAGES=no

opx-switch-log

Enable SAI-specific logging by module name and level.

opx-switch-log set [module_name] [level_name]

Options:

  • module_name — SAI module (WRED, FDB, ROUTE, VLAN, HOST_INTERFACE, ACL, MIRROR, QOS_QUEUE, SCHEDULER_GROUP, PORT, VIRTUAL_ROUTER, NEXT_HOP_GROUP, SWITCH, POLICER, NEIGHBOR, UNSPECIFIED, SAMPLEPACKET, QOS_MAPS, ALL, STP, LAG, ROUTER_INTERFACE, NEXT_HOP, SCHEDULER)
  • level_name — SAI logging level (debug, info, notice, warning, critical, error)

Enable WRED debug log

$ opx-switch-log set wred debug

opx-switch-profile

Assigns an profile to the switch.

opx-switch-profile <switch-id> <profile-name> --list

Options:

  • switch-id — switch ID to enable or disable
  • profile-name — name of the switch profile
  • --list — list of current switch profiles

Assign switch profile

$ opx-switch-profile 0
Current profile: profile1
Profile on next boot: profile1

List switch profile

# opx-switch-profile 0 -list
profile1
profile2
profile3
Clone this wiki locally