Geräte Übersetzer

Dieses Modul ermöglicht die automatisierte Migration der Konfiguration von alten Geräten zu neuen Modellen.
  1. Es werden Regeln hinzugefügt, auf welche Weise Konfigurations-Blöcke für neue Geräte übersetzt werden sollen
  2. In Devices-Status oder Devices-Config auf klicken bereitet die aktuelle Übersetzung vor
  3. Auswahl der Zielgruppe(n) erzeugt die gewünschte Konfiguration.
  4. Schreiben der Konfiguration in das TFTP-Verzeichnis (kann zuvor in System-Dateien editiert werden)

Übersetzungsregeln

Feld Beschreibung
Quelltyp Exakter Gerätetyp, um nach den passenden Regeln für das existierende Gerät zu filtern
Zielgruppe
  • Sollte das neue Gerät beschreiben
  • Eine Gruppe besteht in der Regel aus vielen Regeln
  • Eine oder mehrere von diesen werden selektiert, wenn die Übersetzung vorbereitet, um eine flexible Übersetzung in Echtzeit zu ermöglichen
Kontext Zum Beispiel "interface" oder "vlan" um kontext-spezifische Treffer einzuschräncken
Quelle
  • Ein regulärer Ausdruck, der auf eine bestehende Zeile der Konfiguration passt, wie beispielsweise "/interface (\d)$/" (wenn "interface" als Kontext in anderen Regeln verwendet wird, dann werden diese nach dieser Regel hinzugefügt)
  • Das Zeichen * kann verwendet werden, um alle nicht-passenden Zeilen zu kopieren
  • Durch Setzen einer Zahl kann eine Anzahl von Zeilen innerhalb des Kontexts kopiert werden (beispielsweise um die default Interface-Konfiguratuin zu ersetzen)
  • Durch Voranstellen von _&&_regexp kann der Name des Kontexts verwendet werden. Beispielsweise durch das Hinzufügen von _&&_/Fa([1-9]|1[0-9]|2[0-2])$/ trifft lediglich für die Interfaces Fa1-9,Fa10-19 und Fa20-22 zu
  • Durch das Anfügen von _&&_USEPRI wird anstatt der Priorität des Kontext diejenige der Regel genutzt. Dies ist nützlich um beispielsweise eine Zeile aus einem Kontext in die globale Konfiguration zu verschieben
Ziel Ein Ersetzungsstring wie beispielsweise "interface Fa0/$1" wobei $1,$2,$3 Treffer in der Quelle ersetzen
Priorit&aul;t Durch Eingabe eines Buchstabens von A-Z kann definiert werden, an welcher Stelle in der Ausgabe die resultierende Konfiguration gestz werden soll
Benutzer Der in NeDi angemeldete Benutzer, der die jeweilige Regel aktualisiert hat. Zusätzlich kann der Zeitstempel verwendet werden, um nach Regeln zu filtern)

Special Methods

Here are some useful additions for settings that can't be extracted from the source config or have been mapped to other values by NeDi (e.g. location). If necessary the function ProTrans() at the bottom of Devices-Translator.php can be customized even further.
Use Case Description
Device IP address from DB The placeholder %DEVIP% in the destination is replaced by devip from the devices table
Device location from DB The placeholder %LOCATION% in the destination is replaced by location from the devices table
Device contact from DB The placeholder %CONTACT% in the destination is replaced by contact from the devices table
Device group from DB The placeholder %DEVGROUP% in the destination is replaced by devgroup from the devices table
Get Vlans from DB Use "VLANNAMES" as source and something like "VLAN %VLID% name %VLANNAME%" as destination to list vlans from vlans table (e.g. if the source config is unusable)
Get interface Vlans from DB Use "VLPORT-TAG" (or "VLPORT-UNTAG") as source and specify an interface context. Enter something like "switchport allowed vlan add %VLID% tagged" as destination to list tagged vlans from DB on that interface
Get tagged vlans from a vlan context and apply to an interface context This method is able to extract statements like "tagged 1-10" within a vlan context and map it to interface based configs (e.g. translate from HP ProCurve to Cisco IOS)
  • Use a match like "/ tagged (.*)/" as source and "VLCONTEXT-TAG-ADD" as destination to add tagged vlans to list
  • Use a match like "/ untag (.*)/" as source and "VLCONTEXT-TAG-DEL" as destination to remove
  • Then in the "interface" (or similar) context use "VLCONTEXT-TAG" as source and something like "switchport allowed vlan add %VLID% tagged
Copy tagged Vlans from an interface to another
  • Enter VLPORT-TAG-COPY (source interface) in source
  • Comma separated interface list in destination
  • Add VLCONTEXT-TAG as described above, if you haven't done so already
This only works with numeric interface names at the moment. The reason behind, it was specifally developed to understand Zyxel configs.