Ubiquiti Commands

Ubiquiti UniFi and EdgeSwitch CLI commands for network devices.

Device Startup Procedure

Step 1: Power on device

Connect PoE or power to boot Ubiquiti device

Step 2: Wait for boot

Wait 1-3 minutes for device to fully boot

Step 3: Verify system (UniFi)

Check system status after boot

info

Display device information

show version

Display firmware version

Step 4: Check controller connection

Verify device adopted by controller (UniFi)

syswrapper.sh get-inform

Display controller inform URL

Step 5: Verify interfaces (EdgeSwitch)

Check interface status

show interface status

Display interface status (EdgeSwitch)

Device Shutdown Procedure

Step 1: Save configuration (EdgeSwitch)

Save configuration before shutdown

copy running-config startup-config

Save configuration (EdgeSwitch)

write memory

Save configuration alternative

Step 2: Save configuration (UniFi)

Ensure UniFi device config is synced

save

Save configuration (UniFi)

cfgmtd -w -p /etc/

Write configuration to flash (UniFi)

Step 3: Graceful shutdown/reboot

Shutdown or reboot the device

reload

Reboot switch (EdgeSwitch)

reboot

Reboot device (UniFi)

ubnt-systool reboot

Reboot via system tool (UniFi)

Step 4: Factory reset (if needed)

Reset device to factory defaults

ubnt-systool reset2defaults

Factory reset (UniFi)

System Information (UniFi)

info

Display device information

show version

Display firmware version

show hardware

Display hardware information

show uptime

Display system uptime

show system

Display system configuration

show syslog

Display system logs

UniFi Controller Commands

set-inform http://<controller>:8080/inform

Adopt device to controller

mca-cli-op adopt <controller_ip> <token>

Adopt device with token

mca-cli-op forget

Forget controller (factory reset adoption)

cat /var/etc/persistent/cfg/mgmt

Display controller configuration

syswrapper.sh get-inform

Get current inform URL

mca-cli-op set-locate on

Enable locate LED

mca-cli-op set-locate off

Disable locate LED

Interface Configuration (EdgeSwitch)

enable

Enter privileged EXEC mode

configure

Enter configuration mode

show interface status

Display interface status

interface <interface>

Enter interface configuration mode

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

show running-config

Display running configuration

copy running-config startup-config

Save configuration

write memory

Save configuration (alternative)

VLAN Configuration (EdgeSwitch)

vlan database

Enter VLAN database mode

vlan <vlan_id>

Create VLAN

vlan name <vlan_id> <name>

Set VLAN name

show vlan

Display VLAN configuration

switchport mode access

Set port to access mode

switchport access vlan <vlan_id>

Assign access VLAN

switchport mode trunk

Set port to trunk mode

switchport mode general

Set port to general mode

switchport trunk allowed vlan <vlan_list>

Set allowed VLANs on trunk

switchport trunk native vlan <vlan_id>

Set native VLAN on trunk

Link Aggregation (EdgeSwitch)

interface port-channel <id>

Create port-channel

channel-group <id> mode active

Add interface to LACP LAG (active)

channel-group <id> mode passive

Add interface to LACP LAG (passive)

channel-group <id> mode on

Add interface to static LAG

show port-channel summary

Display LAG summary

show lacp

Display LACP information

Spanning Tree (EdgeSwitch)

spanning-tree

Enable spanning tree globally

spanning-tree mode stp

Set STP mode to 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 portfast

Enable portfast on interface

spanning-tree bpduguard enable

Enable BPDU guard

show spanning-tree

Display spanning tree status

IP Configuration (EdgeSwitch)

interface vlan <vlan_id>

Create/configure VLAN interface

ip address <ip> <netmask>

Set IP address on interface

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

PoE Management

show poe

Display PoE status

show poe summary

Display PoE summary

poe opmode <auto|shutdown|static>

Set PoE operation mode

poe power-limit <watts>

Set PoE power limit

no poe

Disable PoE on interface

User & Security

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

Create user account

enable password <password>

Set enable mode password

show users

Display user accounts

show users accounts

Display detailed user information

port-security

Enable port security on interface

port-security max <num>

Set maximum MAC addresses

show port-security

Display port security status

Monitoring & Diagnostics

show mac address-table

Display MAC address table

show arp

Display ARP table

show tech-support

Generate tech support report

show lldp neighbors

Display LLDP neighbors

show lldp neighbors detail

Display detailed LLDP information

show environment

Display temperature and power status

show cpu utilization

Display CPU utilization

show memory

Display memory usage

ping <ip>

Ping IP address

traceroute <ip>

Traceroute to destination

UniFi Network Commands

iwlist scan

Scan for wireless networks

iwconfig

Display wireless configuration

wstalist

Display connected wireless clients

mca-cli-op dump-cfg

Dump device configuration

ubnt-tools spectrum-scan <interface>

Perform spectrum scan

ubnt-systool reboot

Reboot device

ubnt-systool reset2defaults

Factory reset device

System Maintenance (EdgeSwitch)

reload

Reboot switch

boot system <image>

Set boot image

show boot

Display boot configuration

copy tftp startup-config

Restore config from TFTP

copy startup-config tftp

Backup config to TFTP

upgrade <url>

Upgrade firmware from URL

delete backup

Delete backup image

show switch

Display switch information

clock set <time>

Set system clock

ntp server <ip>

Configure NTP server

UniFi Troubleshooting

tail -f /var/log/messages

Monitor system messages

cat /etc/board.info

Display board information

ps aux

Display running processes

netstat -tuln

Display listening ports

ubnt-discover

Send discovery broadcast

cfgmtd -w -p /etc/

Write configuration to flash

save

Save configuration (UniFi)

reboot

Reboot device (UniFi)