Configuration Translator

This module allows for automated migration from an old device to a new model.
  1. Add rules on how configuration blocks should be translated to a new device
  2. In Devices-Status or Devices-Config click to prepare actual translation
  3. Select target group(s) to generate desired config.
  4. Write config to tftp folder (can be edited before in System-Files)

Translation Rules

Field Description
Source Type Exact device type to filter apropriate rules for the existing device
Target Group
  • Should describe the new devices
  • A group usually contains many rules
  • One or more are selected when preparing the translation, to enable flexible translations on the fly
Context For example "interface" or "vlan" to limit context specific matches
Source
  • Regular expression to match an existing config line like "/interface (\d)$/" (if "interface" is used as context in other rules, they'll be added after this rule)
  • Put a * to copy unmatched lines to the destination
  • Put a number to match on number of lines within a context (e.g. to replace a default interface config)
  • Append _&&_regexp to match context names, e.g. adding _&&_/Fa([1-9]|1[0-9]|2[0-2])$/ matches only Fa1-9,Fa10-19 and Fa20-22
  • If you append _&&_USEPRI the priority of the rule is used (not the one from the context), useful to move a line from a context to the global config
Destination A replacement string like "interface Fa0/$1" where as $1,$2,$3 replace Source matches in ()
Priority Can be A-Z to define where the resulting config should be placed in the output
User NeDi user who updated rule (a timestamp is available for filtering rules as well)

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.