Skip to content

Instantly share code, notes, and snippets.

@arbourd
Last active March 22, 2022 19:02
Show Gist options
  • Save arbourd/1c55a153488cda2b5c87699857d80b12 to your computer and use it in GitHub Desktop.
Save arbourd/1c55a153488cda2b5c87699857d80b12 to your computer and use it in GitHub Desktop.

unifi

Connect

SSH into a device with ubnt if not adopted

$ ssh ubnt@192.168.1.1
Welcome to EdgeOS

SSH into a device with user if adopted with user/pass from controller

$ ssh user@192.168.1.1
Welcome to EdgeOS

Get device info

$ info
Model:       UAP-nanoHD
Version:     5.60.18.13041
MAC Address: b4:fb:e4:29:42:f1
IP Address:  192.168.1.103
Hostname:    UAP-nanoHD
Uptime:      2013 seconds

Status:      Connected (http://192.168.1.10:8080/inform)

Get device logs

$ tail -f /var/log/messages
Nov 15 16:37:04 ubnt mcad: mcad[1922]: ace_reporter.reporter_fail(): Unable to resolve (http://unifi:8080/inform)

Set inform for adoption

$ set-inform http://192.168.1.10:8080/inform
Adoption request sent to 'http://192.168.1.10:8080/inform'.

Factory reset device AP

$ syswrapper.sh restore-default
The system is going down for reboot NOW!

Factory reset device switch

$ set-default
The system is going down for reboot NOW!

BGP

Show BGP peers

$ show ip bgp

Show summary of BGP peers

$ show ip bgp summary

Show BGP peers for a specific neighbor

$ show ip bgp neighbors 192.168.1.10

Setting peers manually

$ configure
# set protocols bgp 64501 parameters router-id 192.168.1.1
# set protocols bgp 64501 neighbor 192.168.1.10 remote-as 64500
# show protocols bgp
# commit
# save
# exit

Setting peers with config.gateway.json

{
  "protocols": {
    "bgp": {
      "64501": {
        "neighbor": {
          "192.168.1.10": { "remote-as": "64500" }
        },
        "parameters": {
          "router-id": "192.168.1.1"
        }
      }
    }
  }
}

DHCP

Show DHCP leases

$ show dhcp leases
IP address      Hardware Address   Lease expiration     Pool       Client Name
----------      ----------------   ----------------     ----       -----------

Clear DHCP leases

$ clear dhcp leases
Stopping DHCP server daemon...
Starting DHCP server daemon...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment