There are five routing daemons in use, and there is one manager daemon. These daemons may be located on separate machines from the manager daemon. Each of these daemons will listen on a particular port for incoming VTY connections. The routing daemons are:
The following sections discuss commands common to all the routing daemons.
In a config file, you can write the debugging options, a vty’s password, routing daemon configurations, a log file name, and so forth. This information forms the initial command set for a routing beast as it is starting.
Config files are generally found in /etc/frr.
Each of the daemons has its own config file. The daemon name plus
the default config file name. For example, zebra’s default config file name is
zebra.conf. You can specify a config file using the
--config_file options when starting the daemon.
Basic Config Commands¶
Set hostname of the router.
[no] password PASSWORD¶
Set password for vty interface. The
noform of the command deletes the password. If there is no password, a vty won’t accept connections.
[no] enable password PASSWORD¶
Set enable password. The
noform of the command deletes the enable password.
[no] log trap LEVEL¶
These commands are deprecated and are present only for historical compatibility. The log trap command sets the current logging level for all enabled logging destinations, and it sets the default for all future logging commands that do not specify a level. The normal default logging level is debugging. The
noform of the command resets the default level for future logging commands to debugging, but it does not change the logging level of existing logging destinations.
[no] log stdout LEVEL¶
Enable logging output to stdout. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. The
noform of the command disables logging to stdout. The
LEVELargument must have one of these values: emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging. Note that the existing code logs its most important messages with severity
[no] log file [FILENAME [LEVEL]]¶
If you want to log into a file, please specify
filenameas in this example:
log file /var/log/frr/bgpd.log informational
If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. The
noform of the command disables logging to a file. Note: if you do not configure any file logging, and a daemon crashes due to a signal or an assertion failure, it will attempt to save the crash information in a file named /var/tmp/frr.<daemon name>.crashlog. For security reasons, this will not happen if the file exists already, so it is important to delete the file after reporting the crash information.
[no] log syslog [LEVEL]¶
Enable logging output to syslog. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. The
noform of the command disables logging to syslog.
[no] log monitor [LEVEL]¶
Enable logging output to vty terminals that have enabled logging using the
terminal monitorcommand. By default, monitor logging is enabled at the debugging level, but this command (or the deprecated
log trapcommand) can be used to change the monitor logging level. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. The
noform of the command disables logging to terminal monitors.
[no] log facility [FACILITY]¶
This command changes the facility used in syslog messages. The default facility is
noform of the command resets the facility to the default
[no] log record-priority¶
To include the severity in all messages logged to a file, to stdout, or to a terminal monitor (i.e. anything except syslog), use the
log record-priorityglobal configuration command. To disable this option, use the
noform of the command. By default, the severity level is not included in logged messages. Note: some versions of syslogd (including Solaris) can be configured to include the facility and level in the messages emitted.
[no] log timestamp precision [(0-6)]¶
This command sets the precision of log message timestamps to the given number of digits after the decimal point. Currently, the value must be in the range 0 to 6 (i.e. the maximum precision is microseconds). To restore the default behavior (1-second accuracy), use the
noform of the command, or set the precision explicitly to 0.
log timestamp precision 3 In this example, the precision is set to provide timestamps with millisecond accuracy.
This command enables the logging of all commands typed by a user to all enabled log destinations. The note that logging includes full command lines, including passwords. Once set, command logging can only be turned off by restarting the daemon.
Enable advanced mode VTY.
service terminal-length (0-512)¶
Set system wide line configuration. This configuration command applies to all VTY interfaces.
Enter vty configuration mode.
Set default motd string.
No motd banner string will be printed.
exec-timeout MINUTE [SECOND]¶
Set VTY connection timeout value. When only one argument is specified it is used for timeout value in minutes. Optional second argument is used for timeout value in seconds. Default timeout value is 10 minutes. When timeout value is zero, it means no timeout.
Do not perform timeout at all. This command is as same as exec-timeout 0 0.
Restrict vty connections with an access list.
Sample Config File¶
Below is a sample configuration file for the zebra daemon.
! ! Zebra configuration file ! hostname Router password zebra enable password zebra ! log stdout ! !
‘!’ and ‘#’ are comment characters. If the first character of the word is one of the comment characters then from the rest of the line forward will be ignored as a comment.
If a comment character is not the first character of the word, it’s a normal character. So in the above example ‘!’ will not be regarded as a comment and the password is set to ‘zebra!password’.
Terminal Mode Commands¶
Displays the current configuration to the vty interface.
Write current configuration to configuration file.
Change to configuration mode. This command is the first step to configuration.
terminal length (0-512)¶
Set terminal display length to
(0-512). If length is 0, no display control is performed.
Show a list of currently connected vty sessions.
List all available commands.
Show the current version of frr and its build host information.
Shows the current configuration of the logging system. This includes the status of all logging destinations.
logmsg LEVEL MESSAGE¶
Send a message to all logging destinations that are enabled for messages of the given severity.
Common Invocation Options¶
These options apply to all frr daemons.
Run in daemon mode.
Set configuration file name.
Display this help and exit.
Upon startup the process identifier of the daemon is written to a file, typically in
/var/run. This file can be used by the init system to implement commands such as
The file name is an run-time option rather than a configure-time option so that multiple routing daemons can be run simultaneously. This is useful when using frr to implement a routing looking glass. One machine can be used to collect differing routing views from differing points in the network.
Set the VTY local address to bind to. If set, the VTY socket will only be bound to this address.
Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not be opened.
Set the user and group to run as.
Print program version.
Loadable Module Support¶
FRR supports loading extension modules at startup. Loading, reloading or unloading modules at runtime is not supported (yet). To load a module, use the following command line option at daemon startup:
Load the specified module, optionally passing options to it. If the module name contains a slash (/), it is assumed to be a full pathname to a file to be loaded. If it does not contain a slash, the /usr/lib/frr/modules directory is searched for a module of the given name; first with the daemon name prepended (e.g.
mod), then without the daemon name prepended.
This option is available on all daemons, though some daemons may not have any modules available to be loaded.
The SNMP Module¶
If SNMP is enabled during compile-time and installed as part of the package,
snmp module can be loaded for the zebra, bgpd, ospfd, ospf6d
and ripd daemons.
The module ignores any options passed to it. Refer to SNMP Support for information on its usage.
The FPM Module¶
If FPM is enabled during compile-time and installed as part of the package, the
fpm module can be loaded for the zebra daemon. This provides the
Forwarding Plane Manager (“FPM”) API.
The module expects its argument to be either
specifying the encapsulation to use.
Netlink is the default, and
protobuf may not be available if the module was built without protobuf
support. Refer to zebra FIB push interface for more information.
Virtual Terminal Interfaces¶
VTY – Virtual Terminal [aka TeletYpe] Interface is a command line interface (CLI) for user interaction with the routing daemon.
VTY stands for Virtual TeletYpe interface. It means you can connect to the daemon via the telnet protocol.
To enable a VTY interface, you have to setup a VTY password. If there is no VTY password, one cannot connect to the VTY interface at all.
% telnet localhost 2601 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Hello, this is |PACKAGE_NAME| (version |PACKAGE_VERSION|) |COPYRIGHT_STR| User Access Verification Password: XXXXX Router> ? enable . . . Turn on privileged commands exit . . . Exit current mode and down to previous mode help . . . Description of the interactive help system list . . . Print command list show . . . Show system inform wh. . . Display who is on a vty Router> enable Password: XXXXX Router# configure terminal Router(config)# interface eth0 Router(config-if)# ip address 10.0.0.1/8 Router(config-if)# ^Z Router#
? and the
find command are very useful for looking up commands.
There are three basic VTY modes:
There are commands that may be restricted to specific VTY modes.
VTY View Mode¶
This mode is for read-only access to the CLI. One may exit the mode by leaving the system, or by entering enable mode.
VTY Enable Mode¶
This mode is for read-write access to the CLI. One may exit the mode by leaving the system, or by escaping to view mode.
VTY Other Modes¶
This page is for describing other modes.
VTY CLI Commands¶
Commands that you may use at the command-line are described in the following three subsubsections.
CLI Movement Commands¶
These commands are used for moving the CLI cursor. The C character means press the Control Key.
- C-f / LEFT
- Move forward one character.
- C-b / RIGHT
- Move backward one character.
- Move forward one word.
- Move backward one word.
- Move to the beginning of the line.
- Move to the end of the line.
CLI Editing Commands¶
These commands are used for editing text on a line. The C character means press the Control Key.
- C-h / DEL
- Delete the character before point.
- Delete the character after point.
- Forward kill word.
- Backward kill word.
- Kill to the end of the line.
- Kill line from the beginning, erasing input.
- Transpose character.
CLI Advanced Commands¶
There are several additional CLI commands for command line completions, insta-help, and VTY session management.
- Interrupt current input and moves to the next line.
- End current configuration session and move to top node.
- C-n / DOWN
- Move down to next line in the history buffer.
- C-p / UP
- Move up to previous line in the history buffer.
- Use command line completion by typing TAB.
- You can use command line help by typing
helpat the beginning of the line. Typing ? at any point in the line will show possible completions.