Main features
Generating configuration files
This module can be used to auto-generate configuration files for the switches registered in Re2o. Here is an example of an HPE configuration:
% cat generated/batt-0.conf
; J9776A Configuration Editor; Created on release #YA.16.05.0004
hostname "batt-0"
; Generated on by re2o`
;--- IP du switch ---
no ip default-gateway
max-vlans 256
vlan 1
name "Adh"
tagged 2,13
ip igmp
ipv6 mld version 1
ipv6 mld enable
no ip address
exit
vlan 2
name "Adm"
tagged 2
untagged 13
no ip address
...
Provisioning those configuration files to switches, via backup-restore.
The provisioning can be done via TFTP or SFTP with credentials registered in Preferences.
Only HPE/Aruba switches are currently supported.
Setup
All the information about the switches and their configuration is located on the main website. The only setting required for this script to work is to specify, in the config.ini file, the URL of this server and credentials to access the information.
Configuring all the information about the switches
Registering the switches
For each switch you want to generate configuration files for, register it in Topology > Switches. You may also need to register the corresponding models and constructors in Topology > Models & Constructors. This information is mandatory, in order for this script to know which configuration template to apply. For example: type "HP" or "Aruba" for HPE/Aruba switches.
Configuring the ports
Configure and select the correct options for each port profile in Topology > Switch ports. Make sure that you will be able to contact the switch and manage it remotely after applying the configuration. Otherwise you will have to move and connect through the serial port to the switch. For that reason, we recommend not using security options on the up-link ports (dhcp-snooping, arp-protect, etc).
Optional: Configuring the radius key
If you want to use radius authentication, make sure that a radius key is defined in Preferences, otherwise, your switches can't contact radius server... You can't specify a key for a individual radius server.
Defining roles
Define role and match servers in Machines > Role , for dhcp-server for example, to make re2o able to make a good config, for example here, lists of dhcp-server's IP.
Activating the provisioning
Important : using provisioning will enable REST and web management in plain-text. If you DON'T want to use it, set no switches on preferences/ "provisionned switchs"
General settings :
Go to Preferences and fill the following fields:
- automatic configured switchs list: The list of switches that will be provisioned with this script,
- ip management subnet: The subnet the switches are in,
- config switchs server: The list of servers from which the switches can get their configuration,
- provision mode: The protocol to use for the provisioning (TFTP or SFTP) (Note: using SFTP require to register SFTP credentials),
- Management creds: Management login and password, in order for the main server to authenticate against the switches.
On topologie/index_port_profile/
- Make sure that the "switch-conf-server" is defined. Make sure that this server has an interface registered on Re2o, on the switches vlan. Otherwise, the switches can't get their config. This server should be the server where re2o/switches is setup.
When all settings are ok, the preferences "provisioning" pannel will turn green :
How to use the script
In the shell, (or in a cron job) simply run:
python3 main.py
All the configuration files are generated in a subfolder generated
. The filename used is the name of the switch with the extension .conf
.
% ls generated
backbone.conf bata-0.conf batt-0.conf