Configuring Industrial Switches via the CLI
Tag: industrial switches Blog | 05-14-2025
Configuring Industrial Switches via the CLI (Command Line Interface)
The specific steps for configuring industrial switches through the CLI may vary depending on the device model and manufacturer. However, the general process is largely similar. Here is a general configuration guide:

- Console Connection: Use an RJ45-to-USB or RS232 serial cable to connect to the Console port of the switch. Access it through terminal emulation software (such as PuTTY, SecureCRT). Set the baud rate to 9600bps, with 8 data bits, 1 stop bit, and no parity.
- SSH/Telnet Connection: You need to know the IP address of the switch in advance and connect remotely via the network (the switch must have its network interface configured already).
After connecting, press the Enter key to activate the CLI. You may be required to enter the default username and password (common defaults are like: admin/admin
, root/root
).
Most industrial switches have a hierarchical CLI structure, and you need to enter the privileged mode and the global configuration mode:
# Enter the privileged mode from the user mode (password required)> enable# Enter the global configuration mode# Different manufacturers may have different syntax. Commonly:# Cisco style:# # configure terminal# Huawei/H3C style:# # system-view# Typical industrial switch style:# # config
(config)# hostname [Switch Name]
(config)# interface vlan [VLAN ID] # Enter the management VLAN interface(config-if)# ip address [IP Address] [Subnet Mask](config-if)# no shutdown # Activate the interface(config-if)# exit
(config)# ip default-gateway [Gateway IP]
(config)# vlan [VLAN ID](config-vlan)# name [VLAN Name](config-vlan)# exit
(config)# interface [Port Number] # For example: ethernet 1/0/1(config-if)# switchport mode access(config-if)# switchport access vlan [VLAN ID](config-if)# exit
(config)# interface [Port Number](config-if)# speed [10/100/1000] # Speed (Mbps)(config-if)# duplex [auto/full/half] # Duplex mode(config-if)# exit
(config)# interface [Port Number](config-if)# shutdown # Disable the port(config-if)# no shutdown # Enable the port(config-if)# exit
To prevent network loops:
(config)# spanning-tree mode [stp/rstp/mstp] # Select the STP mode(config)# spanning-tree vlan [VLAN ID] priority [Priority] # Set the priority
After the configuration is completed, it needs to be saved to avoid losing it after a reboot:
# Different manufacturers have different commands:# Cisco style:# # copy running-config startup-config# Huawei/H3C style:# # save# Typical industrial switch style:# # write memory
# View the interface status# # show interfaces# # show interfaces status# View the VLAN configuration# # show vlan# View the IP configuration# # show ip interface brief# View the spanning tree status# # show spanning-tree
- Backup Configuration: Use
show running-config
to export the current configuration before operation. - Industrial Environment Characteristics: Some switches support ring network redundancy protocols (such as RSTP, ERPS, MRP), which require additional configuration.
- Security Settings:
# Set the management password(config)# enable secret [Password]# Configure SSH(config)# ip ssh version 2(config)# username [Username] password [Password]
- Log Monitoring: Configure a log server to collect the device status.
Please refer to the CLI manual provided by the device manufacturer for specific operations.