Skip to content

Terminal Commands

Use the built-in terminal to configure devices with CLI commands.

Accessing the Terminal

  1. Click on a device to select it
  2. The terminal panel opens at the bottom
  3. Type commands and press Enter

Command Modes

User Mode

Basic commands for viewing information:

show ip
show interfaces
ping 192.168.1.1

Privileged Mode

Enter with enable:

enable
show running-config

Configuration Mode

Enter with configure terminal:

configure terminal
hostname MyRouter

Interface Configuration

interface eth0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit

Common Commands

Command Description
help Show available commands
show ip Display IP configuration
show interfaces List all interfaces
show arp Display ARP table
show mac-address-table Display MAC table (switches)
show vlan Display VLAN configuration (switches)
show spanning-tree Display STP status (switches)
ping <ip> Test connectivity
traceroute <ip> Trace packet path
clear Clear terminal screen
clear arp Clear ARP cache
clear mac-address-table Clear MAC table (switches)

VLAN Commands (Switches)

Command Description
vlan <id> Create VLAN or enter VLAN config mode
no vlan <id> Delete VLAN
show vlan Display VLAN information
switchport mode access Set port to access mode
switchport mode trunk Set port to trunk mode
switchport access vlan <id> Assign port to VLAN
switchport trunk allowed vlan <ids> Set trunk allowed VLANs
interface vlan <id> Configure SVI for inter-VLAN routing

Spanning Tree Commands (Switches)

Command Description
spanning-tree enable Enable STP
spanning-tree disable Disable STP
spanning-tree priority <value> Set bridge priority (0-61440)
show spanning-tree Display STP status
show stp interface Display per-port STP states
spanning-tree cost <value> Set port cost (in interface mode)

TCP Connection Commands

Command Description
netstat Display all TCP connections
netstat -l Display listening ports only
netstat -a Display all connections (including listening)
netstat -t Display TCP connections (same as default)
telnet <ip> [port] Open TCP connection to remote host

Example: Starting a TCP Listener

# On a server, start listening on port 80
listen 80

Example: Connecting via Telnet

# Connect to a server on port 80
telnet 192.168.1.100 80

Example: Viewing Connections

# Show all connections
netstat -a

# Output:
Active Internet connections
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp    0      0 *:80                    *:*                     LISTEN
tcp    0      0 192.168.1.10:49152      192.168.1.100:80        ESTABLISHED

Tips

  • Use ? after a command for help
  • Tab completion is supported
  • Use exit to go back one mode level