February 4, 2024

UniFi Additions and Modifications

Revised:Dec 17 09:59:24 EST 2024
Original:Feb 4 06:51:14 EST 2024

A few things added to and modified on UniFi systems. This page will expand with details over time.

DHCP lease renewal on switch

  • renew the lease on a UniFi switch without rebooting the switch
  • killall -HUP udhcpc # this restarts the /sbin/udhcpc process

on_boot system

  • on_boot system that provides persistent modifications and additions with every boot despite UniFi updates that erase so many things. This system is based on a github project but greatly simplified.
  • Add legitimate LetsEncrypt certificates via on_boot to controller and manually to cameras to make local access more pleasant.
  • Install ssh keys via on_boot for convenient login
  • tailor dnsmasq via on_boot for local name servers and reserved addresses etc

Ookla Speedtest on Gateway

  • Refer to ookla page
  • Use script on referenced page
  • armhf for raspberry 32 bit
  • aarch64 for unifi, unvr, cloudkey, etc and raspberry pi 64 bit

SNMP Install and Configure

  • Add snmpd to gateway for MRTG to access. Avoid turning SNMP on for the whole network, just the gateway.
  • works on UniFi UGX and UDM, probably any gateway
  • Reference
  • must run apt-get update prior to install
  • apt-get install snmp snmpd libsnmp-dev
  • configuration must be in two locations
    • /usr/share/snmp/snmpd.conf
      /etc/snmp/snmpd.conf
  • Need systemd unit file to start snmpd (comes with snmpd install)
  • /lib/systemd/system/snmpd.service
  • Some unifi updates remove the snmpd binary. If this happens must stop and start the snmpd.service after reinstalling snmpd. This could be incorporated into on_boot
  • Install commands
    apt-get update
    apt-get -y install snmp snmpd libsnmp-dev
    cp snmpd.conf-src /usr/share/snmp/snmpd.conf
    cp snmpd.conf-src /etc/snmp/snmpd.conf
            

References

No comments:

Post a Comment