Over the years of working with Ubiquiti products I have create a list of commands that I use frequently.
They can be used to manage some common tasks in Unifi CLI be it switches APs etc. and the sources.
Device | Command | Comments |
USG | clear dhcp leases | Clears dhcp leases from the USG |
USG | Cat /etc/hosts | Shows hosts on the USG via DHCP |
USG | – SSH into the USG – Open the vi editor to create a new file: sudo vi /etc/dnsmasq.d/dnsmasq.static.conf – Add the host and ipaddress: address=/<dnsfqdn>/<ipaddress> – Save it – Activate that with: sudo /etc/init.d/dnsmasq force-reload | If you are not familiar with vi this link has all the commands you need. https://staff.washington.edu/rells/R110/ |
USG | show log tail # | View FW logs https://community.ubnt.com/t5/UniFi-Routing-Switching/Firewall-Logs/td-p/2360113 |
USG | configure edit protocols igmp-proxy set interface eth1.80 role downstream set interface eth1.80 threshold 1 set interface eth1.80 alt-subnet 0.0.0.0/0 delete interface eth1.103 role upstream delete interface eth1.103 threshold 1 delete interface eth1.103 alt-subnet 0.0.0.0/0 exit commit save | Configuring Unifi for Sonos https://blog.awelswynol.co.uk/2017/11/unifi-sonos-and-vlans |
USG | sudo tcpdump -ni eth0 port 2 | Logs |
All Devices | set-inform http://<ip of controller:8080/inform | This is used to set the value of the controller so that you can adopt the device from within the controller. Useful if new devices cant resolve the hostname “unifi” to the controller. You can check the value set for inform by running “INFO” after connecting via SSH to a device ip. https://help.ubnt.com/hc/en-us/articles/204909754-UniFi-Device-Adoption-Methods-for-Remote-UniFi-Controllers |