Mikrotik vlans discovery, v2 (#13427)

* Mikrotik vlans discovery, v2

* styleci cleanup

* added Routeros entry in mkdocs.yml

* fixed typo in mkdocs.yml

* Better Vlan Eloquent Model

* Missed one

* Use new SnmpQuery code

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Peca Nesovanovic
2021-10-27 01:31:44 +02:00
committed by GitHub
parent d211944f4e
commit 08dd8a07db
6 changed files with 4376 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
source: doc/Support/Device-Notes/Routeros.md
path: blob/master/doc/
This is attempt to get vlans information from Mikrotik RouterOS.
# Installation
Installation is very simple. On mikrotik we need:
1. one script, named "LNMS_vlans"
2. snmp community with write permission
Copy the scripts from librenms-agent/snmp/Routeros and place in /system/scripts
Set snmp community to have WRITE permission in /snmp/community
It is strongly recomended that snmp allowed address is narrowed down to /32 because write permission could allow attack on device
Theory of operation:
Mikrotik vlan discovery plugin using ability of ROS to "fire up" a script trough SNMP
At first, LibreNMS check for existence of script, and if it present, it will be started
Sript try to gather information from:
a. /interface/bridge/vlan for tagged ports inside bridge
b. /interface/bridge/vlan for currently untagged ports inside bridge
c. /interface/bridge/port for ports PVID (untagged) inside bridge
d. /interface/vlan for plain (old style) vlans
after information is gathered, it is transmitted to LibreNMS over SNMP
protocol is:
type,vlanId,ifName <cr>
i.e:
T,254,ether1 is translated to Tagged vlan 254 on port ether1
U,100,wlan2 is translated to Untagged vlan 100 on port wlan2