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 * Terminal Mode Commands:: Common commands used in a VTY
19 * Config Commands:: Commands used in config files
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.
121 @deffn Command {log syslog} {}
122 @deffnx Command {log syslog @var{level}} {}
123 @deffnx Command {no log syslog} {}
124 Enable logging output to syslog.
125 If the optional second argument specifying the
126 logging level is not present, the default logging level (typically debugging,
127 but can be changed using the deprecated @code{log trap} command) will be used.
128 The @code{no} form of the command disables logging to syslog.
131 @deffn Command {log monitor} {}
132 @deffnx Command {log monitor @var{level}} {}
133 @deffnx Command {no log monitor} {}
134 Enable logging output to vty terminals that have enabled logging
135 using the @code{terminal monitor} command.
136 By default, monitor logging is enabled at the debugging level, but this
137 command (or the deprecated @code{log trap} command) can be used to change
138 the monitor logging level.
139 If the optional second argument specifying the
140 logging level is not present, the default logging level (typically debugging,
141 but can be changed using the deprecated @code{log trap} command) will be used.
142 The @code{no} form of the command disables logging to terminal monitors.
145 @deffn Command {log facility @var{facility}} {}
146 @deffnx Command {no log facility} {}
147 This command changes the facility used in syslog messages. The default
148 facility is @code{daemon}. The @code{no} form of the command resets
149 the facility to the default @code{daemon} facility.
152 @deffn Command {log record-priority} {}
153 @deffnx Command {no log record-priority} {}
154 To include the severity in all messages logged to a file, to stdout, or to
155 a terminal monitor (i.e. anything except syslog),
156 use the @code{log record-priority} global configuration command.
157 To disable this option, use the @code{no} form of the command. By default,
158 the severity level is not included in logged messages. Note: some
159 versions of syslogd (including Solaris) can be configured to include
160 the facility and level in the messages emitted.
163 @deffn Command {service password-encryption} {}
167 @deffn Command {service advanced-vty} {}
168 Enable advanced mode VTY.
171 @deffn Command {service terminal-length @var{<0-512>}} {}
172 Set system wide line configuration. This configuration command applies
173 to all VTY interfaces.
176 @deffn Command {line vty} {}
177 Enter vty configuration mode.
180 @deffn Command {banner motd default} {}
181 Set default motd string.
184 @deffn Command {no banner motd} {}
185 No motd banner string will be printed.
188 @deffn {Line Command} {exec-timeout @var{minute}} {}
189 @deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {}
190 Set VTY connection timeout value. When only one argument is specified
191 it is used for timeout value in minutes. Optional second argument is
192 used for timeout value in seconds. Default timeout value is 10 minutes.
193 When timeout value is zero, it means no timeout.
196 @deffn {Line Command} {no exec-timeout} {}
197 Do not perform timeout at all. This command is as same as
198 @command{exec-timeout 0 0}.
201 @deffn {Line Command} {access-class @var{access-list}} {}
202 Restrict vty connections with an access list.
205 @node Sample Config File
206 @subsection Sample Config File
209 Below is a sample configuration file for the zebra daemon.
214 ! Zebra configuration file
218 enable password zebra
226 '!' and '#' are comment characters. If the first character of the word
227 is one of the comment characters then from the rest of the line forward
228 will be ignored as a comment.
231 password zebra!password
234 If a comment character is not the first character of the word, it's a
235 normal character. So in the above example '!' will not be regarded as a
236 comment and the password is set to 'zebra!password'.
240 @node Terminal Mode Commands
241 @section Terminal Mode Commands
243 @deffn Command {write terminal} {}
244 Displays the current configuration to the vty interface.
247 @deffn Command {write file} {}
248 Write current configuration to configuration file.
251 @deffn Command {configure terminal} {}
252 Change to configuration mode. This command is the first step to
256 @deffn Command {terminal length @var{<0-512>}} {}
257 Set terminal display length to @var{<0-512>}. If length is 0, no
258 display control is performed.
261 @deffn Command {who} {}
262 Show a list of currently connected vty sessions.
265 @deffn Command {list} {}
266 List all available commands.
269 @deffn Command {show version} {}
270 Show the current version of @value{PACKAGE_NAME} and its build host information.
273 @deffn Command {show logging} {}
274 Shows the current configuration of the logging system. This includes
275 the status of all logging destinations.
278 @deffn Command {logmsg @var{level} @var{message}} {}
279 Send a message to all logging destinations that are enabled for messages
280 of the given severity.
286 @node Common Invocation Options
287 @section Common Invocation Options
289 @c OPTIONS section of the man page
291 These options apply to all @value{PACKAGE_NAME} daemons.
300 @itemx --config_file=@var{file}
301 Set configuration file name.
305 Display this help and exit.
308 @itemx --pid_file=@var{file}
310 Upon startup the process identifier of the daemon is written to a file,
311 typically in @file{/var/run}. This file can be used by the init system
312 to implement commands such as @command{@dots{}/init.d/zebra status},
313 @command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra
316 The file name is an run-time option rather than a configure-time option
317 so that multiple routing daemons can be run simultaneously. This is
318 useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One
319 machine can be used to collect differing routing views from differing
320 points in the network.
322 @item -A @var{address}
323 @itemx --vty_addr=@var{address}
324 Set the VTY local address to bind to. If set, the VTY socket will only
325 be bound to this address.
328 @itemx --vty_port=@var{port}
329 Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
333 @itemx --vty_addr=@var{user}
334 Set the user and group to run as.
338 Print program version.
344 @node Virtual Terminal Interfaces
345 @section Virtual Terminal Interfaces
347 VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
348 interface (CLI) for user interaction with the routing daemon.
351 * VTY Overview:: Basics about VTYs
352 * VTY Modes:: View, Enable, and Other VTY modes
353 * VTY CLI Commands:: Commands for movement, edition, and management
359 @subsection VTY Overview
362 VTY stands for Virtual TeletYpe interface. It means you can connect to
363 the daemon via the telnet protocol.
365 To enable a VTY interface, you have to setup a VTY password. If there
366 is no VTY password, one cannot connect to the VTY interface at all.
370 % telnet localhost 2601
372 Connected to localhost.
373 Escape character is '^]'.
375 Hello, this is @value{PACKAGE_NAME} (version @value{VERSION})
376 @value{COPYRIGHT_STR}
378 User Access Verification
382 enable Turn on privileged commands
383 exit Exit current mode and down to previous mode
384 help Description of the interactive help system
385 list Print command list
386 show Show running system information
387 who Display who is on a vty
390 Router# configure terminal
391 Router(config)# interface eth0
392 Router(config-if)# ip address 10.0.0.1/8
393 Router(config-if)# ^Z
398 '?' is very useful for looking up commands.
401 @subsection VTY Modes
403 There are three basic VTY modes:
406 * VTY View Mode:: Mode for read-only interaction
407 * VTY Enable Mode:: Mode for read-write interaction
408 * VTY Other Modes:: Special modes (tftp, etc)
411 There are commands that may be restricted to specific VTY modes.
414 @subsubsection VTY View Mode
415 @c to be written (gpoul)
418 This mode is for read-only access to the CLI. One may exit the mode by
419 leaving the system, or by entering @code{enable} mode.
421 @node VTY Enable Mode
422 @subsubsection VTY Enable Mode
424 @c to be written (gpoul)
425 This mode is for read-write access to the CLI. One may exit the mode by
426 leaving the system, or by escaping to view mode.
428 @node VTY Other Modes
429 @subsubsection VTY Other Modes
432 @c to be written (gpoul)
433 This page is for describing other modes.
435 @node VTY CLI Commands
436 @subsection VTY CLI Commands
438 Commands that you may use at the command-line are described in the following
439 three subsubsections.
442 * CLI Movement Commands:: Commands for moving the cursor about
443 * CLI Editing Commands:: Commands for changing text
444 * CLI Advanced Commands:: Other commands, session management and so on
447 @node CLI Movement Commands
448 @subsubsection CLI Movement Commands
450 These commands are used for moving the CLI cursor. The @key{C} character
451 means press the Control Key.
459 Move forward one character.
465 Move backward one character.
469 Move forward one word.
473 Move backward one word.
477 Move to the beginning of the line.
481 Move to the end of the line.
485 @node CLI Editing Commands
486 @subsubsection CLI Editing Commands
488 These commands are used for editing text on a line. The @key{C}
489 character means press the Control Key.
497 Delete the character before point.
501 Delete the character after point.
513 Kill to the end of the line.
517 Kill line from the beginning, erasing input.
525 @node CLI Advanced Commands
526 @subsubsection CLI Advanced Commands
528 There are several additional CLI commands for command line completions,
529 insta-help, and VTY session management.
535 Interrupt current input and moves to the next line.
539 End current configuration session and move to top node.
546 Move down to next line in the history buffer.
552 Move up to previous line in the history buffer.
556 Use command line completion by typing @key{TAB}.
560 You can use command line help by typing @code{help} at the beginning of
561 the line. Typing @kbd{?} at any point in the line will show possible