Unifi handy CLI

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.

DeviceCommandComments
USGclear dhcp leasesClears dhcp leases from the USG
USGCat /etc/hostsShows 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/
USGshow log tail # View FW logs
https://community.ubnt.com/t5/UniFi-Routing-Switching/Firewall-Logs/td-p/2360113
USGconfigure
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
USGsudo tcpdump -ni eth0 port 2Logs
All Devicesset-inform http://<ip of controller:8080/informThis 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

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *