2 @chapter Basic commands
4 There are five routing daemons in use, and there is one manager daemon.
5 These daemons may be located on separate machines from the manager
6 daemon. Each of these daemons will listen on a particular port for
7 incoming VTY connections. The routing daemons are:
10 @item @command{ripd}, @command{ripngd}, @command{ospfd}, @command{ospf6d}, @command{bgpd}
14 The following sections discuss commands common to all the routing
18 * Config Commands:: Commands used in config files
19 * Terminal Mode Commands:: Common commands used in a VTY
20 * Common Invocation Options:: Starting the daemons
21 * Virtual Terminal Interfaces:: Interacting with the daemons
27 @section Config Commands
29 @cindex Configuration files for running the software
30 @c A -not configuration files for installing the software
31 @cindex Files for running configurations
32 @cindex Modifying the herd's behavior
33 @cindex Getting the herd running
37 * Basic Config Commands:: Some of the generic config commands
38 * Sample Config File:: An example config file
42 In a config file, you can write the debugging options, a vty's password,
43 routing daemon configurations, a log file name, and so forth. This
44 information forms the initial command set for a routing beast as it is
47 Config files are generally found in:
50 @item @file{@value{INSTALL_PREFIX_ETC}/*.conf}
53 Each of the daemons has its own
54 config file. For example, zebra's default config file name is:
57 @item @file{@value{INSTALL_PREFIX_ETC}/zebra.conf}
60 The daemon name plus @file{.conf} is the default config file name. You
61 can specify a config file using the @kbd{-f} or @kbd{--config-file}
62 options when starting the daemon.
66 @node Basic Config Commands
67 @subsection Basic Config Commands
69 @deffn Command {hostname @var{hostname}} {}
70 Set hostname of the router.
73 @deffn Command {password @var{password}} {}
74 Set password for vty interface. If there is no password, a vty won't
78 @deffn Command {enable password @var{password}} {}
82 @deffn Command {log trap @var{level}} {}
83 @deffnx Command {no log trap} {}
84 These commands are deprecated and are present only for historical compatibility.
85 The log trap command sets the current logging level for all enabled
86 logging destinations, and it sets the default for all future logging commands
87 that do not specify a level. The normal default
88 logging level is debugging. The @code{no} form of the command resets
89 the default level for future logging commands to debugging, but it does
90 not change the logging level of existing logging destinations.
94 @deffn Command {log stdout} {}
95 @deffnx Command {log stdout @var{level}} {}
96 @deffnx Command {no log stdout} {}
97 Enable logging output to stdout.
98 If the optional second argument specifying the
99 logging level is not present, the default logging level (typically debugging,
100 but can be changed using the deprecated @code{log trap} command) will be used.
101 The @code{no} form of the command disables logging to stdout.
102 The @code{level} argument must have one of these values:
103 emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging. Note that the existing code logs its most important messages
104 with severity @code{errors}.
107 @deffn Command {log file @var{filename}} {}
108 @deffnx Command {log file @var{filename} @var{level}} {}
109 @deffnx Command {no log file} {}
110 If you want to log into a file, please specify @code{filename} as
113 log file /var/log/quagga/bgpd.log informational
115 If the optional second argument specifying the
116 logging level is not present, the default logging level (typically debugging,
117 but can be changed using the deprecated @code{log trap} command) will be used.
118 The @code{no} form of the command disables logging to a file.
120 Note: if you do not configure any file logging, and a daemon crashes due
121 to a signal or an assertion failure, it will attempt to save the crash
122 information in a file named /var/tmp/quagga.<daemon name>.crashlog.
123 For security reasons, this will not happen if the file exists already, so
124 it is important to delete the file after reporting the crash information.
127 @deffn Command {log syslog} {}
128 @deffnx Command {log syslog @var{level}} {}
129 @deffnx Command {no log syslog} {}
130 Enable logging output to syslog.
131 If the optional second argument specifying the
132 logging level is not present, the default logging level (typically debugging,
133 but can be changed using the deprecated @code{log trap} command) will be used.
134 The @code{no} form of the command disables logging to syslog.
137 @deffn Command {log monitor} {}
138 @deffnx Command {log monitor @var{level}} {}
139 @deffnx Command {no log monitor} {}
140 Enable logging output to vty terminals that have enabled logging
141 using the @code{terminal monitor} command.
142 By default, monitor logging is enabled at the debugging level, but this
143 command (or the deprecated @code{log trap} command) can be used to change
144 the monitor logging level.
145 If the optional second argument specifying the
146 logging level is not present, the default logging level (typically debugging,
147 but can be changed using the deprecated @code{log trap} command) will be used.
148 The @code{no} form of the command disables logging to terminal monitors.
151 @deffn Command {log facility @var{facility}} {}
152 @deffnx Command {no log facility} {}
153 This command changes the facility used in syslog messages. The default
154 facility is @code{daemon}. The @code{no} form of the command resets
155 the facility to the default @code{daemon} facility.
158 @deffn Command {log record-priority} {}
159 @deffnx Command {no log record-priority} {}
160 To include the severity in all messages logged to a file, to stdout, or to
161 a terminal monitor (i.e. anything except syslog),
162 use the @code{log record-priority} global configuration command.
163 To disable this option, use the @code{no} form of the command. By default,
164 the severity level is not included in logged messages. Note: some
165 versions of syslogd (including Solaris) can be configured to include
166 the facility and level in the messages emitted.
169 @deffn Command {log timestamp precision @var{<0-6>}} {}
170 @deffnx Command {no log timestamp precision} {}
171 This command sets the precision of log message timestamps to the
172 given number of digits after the decimal point. Currently,
173 the value must be in the range 0 to 6 (i.e. the maximum precision
175 To restore the default behavior (1-second accuracy), use the
176 @code{no} form of the command, or set the precision explicitly to 0.
180 log timestamp precision 3
184 In this example, the precision is set to provide timestamps with
185 millisecond accuracy.
188 @deffn Command {log commands} {}
189 This command enables the logging of all commands typed by a user to
190 all enabled log destinations. The note that logging includes full
191 command lines, including passwords. Once set, command logging can only
192 be turned off by restarting the daemon.
195 @deffn Command {service password-encryption} {}
199 @deffn Command {service advanced-vty} {}
200 Enable advanced mode VTY.
203 @deffn Command {service terminal-length @var{<0-512>}} {}
204 Set system wide line configuration. This configuration command applies
205 to all VTY interfaces.
208 @deffn Command {line vty} {}
209 Enter vty configuration mode.
212 @deffn Command {banner motd default} {}
213 Set default motd string.
216 @deffn Command {no banner motd} {}
217 No motd banner string will be printed.
220 @deffn {Line Command} {exec-timeout @var{minute}} {}
221 @deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {}
222 Set VTY connection timeout value. When only one argument is specified
223 it is used for timeout value in minutes. Optional second argument is
224 used for timeout value in seconds. Default timeout value is 10 minutes.
225 When timeout value is zero, it means no timeout.
228 @deffn {Line Command} {no exec-timeout} {}
229 Do not perform timeout at all. This command is as same as
230 @command{exec-timeout 0 0}.
233 @deffn {Line Command} {access-class @var{access-list}} {}
234 Restrict vty connections with an access list.
237 @node Sample Config File
238 @subsection Sample Config File
241 Below is a sample configuration file for the zebra daemon.
246 ! Zebra configuration file
250 enable password zebra
258 '!' and '#' are comment characters. If the first character of the word
259 is one of the comment characters then from the rest of the line forward
260 will be ignored as a comment.
263 password zebra!password
266 If a comment character is not the first character of the word, it's a
267 normal character. So in the above example '!' will not be regarded as a
268 comment and the password is set to 'zebra!password'.
272 @node Terminal Mode Commands
273 @section Terminal Mode Commands
275 @deffn Command {write terminal} {}
276 Displays the current configuration to the vty interface.
279 @deffn Command {write file} {}
280 Write current configuration to configuration file.
283 @deffn Command {configure terminal} {}
284 Change to configuration mode. This command is the first step to
288 @deffn Command {terminal length @var{<0-512>}} {}
289 Set terminal display length to @var{<0-512>}. If length is 0, no
290 display control is performed.
293 @deffn Command {who} {}
294 Show a list of currently connected vty sessions.
297 @deffn Command {list} {}
298 List all available commands.
301 @deffn Command {show version} {}
302 Show the current version of @value{PACKAGE_NAME} and its build host information.
305 @deffn Command {show logging} {}
306 Shows the current configuration of the logging system. This includes
307 the status of all logging destinations.
310 @deffn Command {logmsg @var{level} @var{message}} {}
311 Send a message to all logging destinations that are enabled for messages
312 of the given severity.
318 @node Common Invocation Options
319 @section Common Invocation Options
321 @c OPTIONS section of the man page
323 These options apply to all @value{PACKAGE_NAME} daemons.
332 @itemx --config_file=@var{file}
333 Set configuration file name.
337 Display this help and exit.
340 @itemx --pid_file=@var{file}
342 Upon startup the process identifier of the daemon is written to a file,
343 typically in @file{/var/run}. This file can be used by the init system
344 to implement commands such as @command{@dots{}/init.d/zebra status},
345 @command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra
348 The file name is an run-time option rather than a configure-time option
349 so that multiple routing daemons can be run simultaneously. This is
350 useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One
351 machine can be used to collect differing routing views from differing
352 points in the network.
354 @item -A @var{address}
355 @itemx --vty_addr=@var{address}
356 Set the VTY local address to bind to. If set, the VTY socket will only
357 be bound to this address.
360 @itemx --vty_port=@var{port}
361 Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
365 @itemx --vty_addr=@var{user}
366 Set the user and group to run as.
370 Print program version.
376 @node Virtual Terminal Interfaces
377 @section Virtual Terminal Interfaces
379 VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
380 interface (CLI) for user interaction with the routing daemon.
383 * VTY Overview:: Basics about VTYs
384 * VTY Modes:: View, Enable, and Other VTY modes
385 * VTY CLI Commands:: Commands for movement, edition, and management
391 @subsection VTY Overview
394 VTY stands for Virtual TeletYpe interface. It means you can connect to
395 the daemon via the telnet protocol.
397 To enable a VTY interface, you have to setup a VTY password. If there
398 is no VTY password, one cannot connect to the VTY interface at all.
402 % telnet localhost 2601
404 Connected to localhost.
405 Escape character is '^]'.
407 Hello, this is @value{PACKAGE_NAME} (version @value{VERSION})
408 @value{COPYRIGHT_STR}
410 User Access Verification
414 enable Turn on privileged commands
415 exit Exit current mode and down to previous mode
416 help Description of the interactive help system
417 list Print command list
418 show Show running system information
419 who Display who is on a vty
422 Router# configure terminal
423 Router(config)# interface eth0
424 Router(config-if)# ip address 10.0.0.1/8
425 Router(config-if)# ^Z
430 '?' is very useful for looking up commands.
433 @subsection VTY Modes
435 There are three basic VTY modes:
438 * VTY View Mode:: Mode for read-only interaction
439 * VTY Enable Mode:: Mode for read-write interaction
440 * VTY Other Modes:: Special modes (tftp, etc)
443 There are commands that may be restricted to specific VTY modes.
446 @subsubsection VTY View Mode
447 @c to be written (gpoul)
450 This mode is for read-only access to the CLI. One may exit the mode by
451 leaving the system, or by entering @code{enable} mode.
453 @node VTY Enable Mode
454 @subsubsection VTY Enable Mode
456 @c to be written (gpoul)
457 This mode is for read-write access to the CLI. One may exit the mode by
458 leaving the system, or by escaping to view mode.
460 @node VTY Other Modes
461 @subsubsection VTY Other Modes
464 @c to be written (gpoul)
465 This page is for describing other modes.
467 @node VTY CLI Commands
468 @subsection VTY CLI Commands
470 Commands that you may use at the command-line are described in the following
471 three subsubsections.
474 * CLI Movement Commands:: Commands for moving the cursor about
475 * CLI Editing Commands:: Commands for changing text
476 * CLI Advanced Commands:: Other commands, session management and so on
479 @node CLI Movement Commands
480 @subsubsection CLI Movement Commands
482 These commands are used for moving the CLI cursor. The @key{C} character
483 means press the Control Key.
491 Move forward one character.
497 Move backward one character.
501 Move forward one word.
505 Move backward one word.
509 Move to the beginning of the line.
513 Move to the end of the line.
517 @node CLI Editing Commands
518 @subsubsection CLI Editing Commands
520 These commands are used for editing text on a line. The @key{C}
521 character means press the Control Key.
529 Delete the character before point.
533 Delete the character after point.
545 Kill to the end of the line.
549 Kill line from the beginning, erasing input.
557 Interpret following character literally. Do not treat it specially.
558 This can be used to, e.g., type in a literal @kbd{?} rather than do
563 @node CLI Advanced Commands
564 @subsubsection CLI Advanced Commands
566 There are several additional CLI commands for command line completions,
567 insta-help, and VTY session management.
573 Interrupt current input and moves to the next line.
577 End current configuration session and move to top node.
584 Move down to next line in the history buffer.
590 Move up to previous line in the history buffer.
594 Use command line completion by typing @key{TAB}.
598 You can use command line help by typing @code{help} at the beginning of
599 the line. Typing @kbd{?} at any point in the line will show possible
602 To enter an actual @kbd{?} character rather show completions, e.g. to
603 enter into a regexp, use @kbd{@key{C}-v ?}.