Configuration, configuration files and command files

This chapter describes how to manage user configurations, configuration files and command files.

Overview

Turbo Router CLI handles files, named configurations. A configuration may be considered as a file describing an expected global state of the equipment.

Editing a configuration file does not change Turbo Router state. A specific command (apply or addrunning) must be invoked to actually apply parameters stored in a configuration.

Turbo Router may be configured in two ways:

apply mode
Consists in stopping all running services, reinitializing Turbo Router and globally applying a configuration (via the apply command). If apply succeeds, the running configuration will exactly reflect the applied configuration.
delta mode
consists in directly editing the running configuration and commiting changes (via the addrunning command). Only modifications will be applied, to avoid stopping services.

Configuration relationships

The figure below details the relationships between configurations and actions that can be performed.

../../../_images/actions.svg

Configuration relationships

Command files

Command file extension

File extension is not required for command files but it is recommended to use a dedicated extension (.6cd, for instance).

Editing a command file

Note

You cannot edit a command file on Turbo Router.

To edit a command file, you must export and edit it on a remote machine. After edition, the file can be imported from the remote machine.

Displaying a command file

The display file command, without other parameters, lists the names of all the command files available on Turbo Router.

Example

router{}display file
changeroutes
addtestaddr
router{}

Using the display file command with a file name displays the contents of the file.

router{}display file mycommand

Example

router{}display file addroutes.6cd
edit conf running
rtg
delete route 192.168.25.0/24
route 192.168.25.0/24 10.18.18.27
route default-ipv4 10.18.18.1
exit
addrunning
exit
router{}

Appending commands to an existing command file

router{}append file mycommand

Commands entered after an append file command will be appended to the mycommand file until the close file command is entered. If the mycommand file does not exist, it is created.

(+) is added to the prompt when the user is in append mode.

Note

  • You can not nest append file commands.
  • append file and close file commands can only be used at the root level.

Example

router{}append file mycommand
router{}(+)edit conf myconfig
router{myconfig}(+)sec
router{myconfig-sec}(+)vpn myvpn cer_lite 192.0.0.1 192.0.0.2 certificate myca
router{myconfig-sec}(+)exit
router{myconfig}(+)exit
router{}(+)close file
router{}

The commands between append file and close file commands will be inserted in the mycommand file.

Executing a command file in batch mode

router{}exec file mycommand

Exporting, importing configuration and command files

Exporting a file

The following command exports a configuration or a command file. The command has to be entered in the root context.

router{}export [conf|file] FILENAME URL
conf
Specify that a configuration file will be exported.
file
Specify that a command file will be exported.
FILENAME
Name of an existing local file.
URL
URL of the remote destination file. TFTP, FTP or SCP protocols can be used to export files. The remote file name must be specified in the URL when using FTP of TFTP. The remote file name is optional with SCP.

Note

Most TFTP server implementations require an empty file to be created on the server with read and write privileges before the file can be exported.

Example

router{}export conf myconfig tftp://server/remconfig.6cf
router{}export file mycommand ftp://user:pass@10.0.0.1//var/export_dir/remcmdfile.6cd
router{}export conf myconfig scp://user@server/export_dir/remconfig.6cf

Importing a file

The following command imports a configuration or a command file. The command must be entered in the root context.

router{}import [conf|file] URL [FILENAME]
conf
Specify that a configuration file will be imported.
file
Specify that a command file will be imported.
URL
URL of the remote file. TFTP, FTP or SCP protocols can be used to export files. The remote file name must be specified in the URL.
FILENAME
Name of the local file. This argument is optional. If it is not specified, the local file name will be the same as the remote one.

Caution

Switching Turbo Router off while importing a configuration file could seriously damage the equipment software.

Example

router{}import conf tftp://server/myconfig.6cf myconfig