TP-Link Switch Commands

TP-Link managed switch CLI commands and configuration.

Switch Startup Procedure

Step 1: Power on switch

Connect power to boot the TP-Link switch

Step 2: Wait for boot

Wait 1-2 minutes for system to load

Step 3: Verify system

Check system status after boot

show version

Display system version and hardware info

show system-info

Display system information

Step 4: Check interfaces

Verify interface states

show interface status

Display interface status

Step 5: Verify configuration

Ensure configuration is loaded

show running-config

Display running configuration

Switch Shutdown Procedure

Step 1: Save configuration

Ensure configuration is saved before shutdown

copy running-config startup-config

Save running configuration

Step 2: Verify configuration saved

Confirm configuration is saved

show startup-config

Display startup configuration

Step 3: Graceful shutdown/reboot

Reboot or power off the switch

reload

Reboot the switch

Step 4: Factory reset (if needed)

Reset to factory defaults

erase startup-config

Erase startup configuration

factory-default

Reset to factory defaults

Basic Configuration

enable

Enter privileged EXEC mode

configure

Enter configuration mode

show running-config

Display running configuration

show startup-config

Display startup configuration

copy running-config startup-config

Save configuration

hostname <name>

Set switch hostname

exit

Exit current mode

end

Return to privileged EXEC mode

reload

Reboot the switch

show version

Display system version and hardware info

Interface Configuration

interface gigabitEthernet <port>

Enter interface configuration mode

interface range gigabitEthernet <start>-<end>

Configure multiple interfaces

description <text>

Set interface description

shutdown

Disable interface

no shutdown

Enable interface

speed <10|100|1000|auto>

Set interface speed

duplex <auto|full|half>

Set duplex mode

switchport mode access

Set port to access mode

switchport mode trunk

Set port to trunk mode

switchport access vlan <vlan_id>

Assign VLAN to access port

switchport trunk allowed vlan <vlan_list>

Set allowed VLANs on trunk

show interface status

Display interface status summary

show interface gigabitEthernet <port>

Display detailed interface info

VLAN Configuration

vlan <vlan_id>

Create VLAN and enter VLAN config mode

name <vlan_name>

Set VLAN name

no vlan <vlan_id>

Delete VLAN

show vlan

Display VLAN information

show vlan id <vlan_id>

Display specific VLAN details

switchport general allowed vlan <vlan_list>

Set VLANs on general mode port

switchport pvid <vlan_id>

Set port VLAN ID (PVID)

Link Aggregation (LAG)

interface port-channel <id>

Create/configure LAG group

channel-group <id> mode on

Add port to static LAG

channel-group <id> mode active

Add port to LACP LAG (active)

channel-group <id> mode passive

Add port to LACP LAG (passive)

lacp timeout short

Set LACP timeout to 1 second

show etherchannel summary

Display LAG summary

show lacp neighbor

Display LACP neighbor information

Spanning Tree Protocol

spanning-tree

Enable spanning tree globally

spanning-tree mode stp

Set STP mode to classic STP

spanning-tree mode rstp

Set STP mode to RSTP

spanning-tree mode mstp

Set STP mode to MSTP

spanning-tree priority <value>

Set bridge priority

spanning-tree mst configuration

Enter MST configuration mode

spanning-tree portfast

Enable portfast on interface

spanning-tree bpduguard enable

Enable BPDU guard on interface

show spanning-tree

Display spanning tree status

show spanning-tree interface <port>

Display STP info for interface

IP Configuration

interface vlan <vlan_id>

Create/configure VLAN interface

ip address <ip> <netmask>

Set IP address

ip address dhcp

Obtain IP via DHCP

ip default-gateway <gateway>

Set default gateway

ip route <network> <netmask> <gateway>

Add static route

show ip interface

Display IP interface configuration

show ip route

Display routing table

ping <ip>

Ping IP address

Quality of Service (QoS)

qos

Enable QoS globally

qos mode port-based

Set QoS mode to port-based

qos mode dscp-based

Set QoS mode to DSCP-based

qos trust cos

Trust CoS values

qos trust dscp

Trust DSCP values

qos queue-mode wrr

Set queue scheduling to WRR

show qos

Display QoS configuration

Security Features

username <name> privilege <level> password <password>

Create user account

enable password <password>

Set enable mode password

port security enable

Enable port security on interface

port security max <num>

Set maximum MAC addresses

port security mode <mode>

Set port security mode

storm-control broadcast enable

Enable broadcast storm control

storm-control broadcast level <percentage>

Set storm control threshold

show port security

Display port security status

show users

Display user accounts

Monitoring & Diagnostics

show mac address-table

Display MAC address table

show arp

Display ARP table

show system-info

Display system information

show power inline

Display PoE status

show logging

Display system logs

show cpu

Display CPU utilization

show memory

Display memory usage

show cable-diagnostics interface <port>

Run cable diagnostics

show transceiver interface <port>

Display SFP module information

show lldp neighbor

Display LLDP neighbors

SNMP Configuration

snmp-server enable

Enable SNMP

snmp-server community <string> ro

Set read-only community

snmp-server community <string> rw

Set read-write community

snmp-server host <ip> version <version> <community>

Set SNMP trap receiver

snmp-server location <text>

Set SNMP location

snmp-server contact <text>

Set SNMP contact

show snmp

Display SNMP configuration

System Maintenance

copy tftp startup-config

Restore config from TFTP

copy startup-config tftp

Backup config to TFTP

firmware upgrade <tftp_server> <filename>

Upgrade firmware from TFTP

boot system <filename>

Set boot image

show boot

Display boot configuration

clock set <time> <date>

Set system clock

ntp server <ip>

Configure NTP server

ntp enable

Enable NTP client

show clock

Display system time

show ntp status

Display NTP status

erase startup-config

Erase startup configuration

factory-default

Reset to factory defaults