blob: cbbdea49b6b753cfe48f8e89345c2d5ec36715f5 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@node Basic commands
paul718e3742002-12-13 20:15:29 +00002@chapter Basic commands
3
4There are five routing daemons in use, and there is one manager daemon.
5These daemons may be located on separate machines from the manager
6daemon. Each of these daemons will listen on a particular port for
7incoming VTY connections. The routing daemons are:
8
9@itemize @bullet
10@item @command{ripd}, @command{ripngd}, @command{ospfd}, @command{ospf6d}, @command{bgpd}
11@item @command{zebra}
12@end itemize
13
14The following sections discuss commands common to all the routing
15daemons.
16
17@menu
ajs274a4a42004-12-07 15:39:31 +000018* Terminal Mode Commands:: Common commands used in a VTY
paul718e3742002-12-13 20:15:29 +000019* Config Commands:: Commands used in config files
20* Common Invocation Options:: Starting the daemons
ajs274a4a42004-12-07 15:39:31 +000021* Virtual Terminal Interfaces:: Interacting with the daemons
paul718e3742002-12-13 20:15:29 +000022@end menu
23
24
25
paul76b89b42004-11-06 17:13:09 +000026@node Config Commands
paul718e3742002-12-13 20:15:29 +000027@section Config Commands
28
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
34
35
36@menu
37* Basic Config Commands:: Some of the generic config commands
38* Sample Config File:: An example config file
39@end menu
40
41
42In a config file, you can write the debugging options, a vty's password,
43routing daemon configurations, a log file name, and so forth. This
44information forms the initial command set for a routing beast as it is
45starting.
46
47Config files are generally found in:
48
49@itemize @asis
50@item @file{@value{INSTALL_PREFIX_ETC}/*.conf}
51@end itemize
52
53Each of the daemons has its own
54config file. For example, zebra's default config file name is:
55
56@itemize @asis
57@item @file{@value{INSTALL_PREFIX_ETC}/zebra.conf}
58@end itemize
59
60The daemon name plus @file{.conf} is the default config file name. You
61can specify a config file using the @kbd{-f} or @kbd{--config-file}
62options when starting the daemon.
63
64
65
paul76b89b42004-11-06 17:13:09 +000066@node Basic Config Commands
paul718e3742002-12-13 20:15:29 +000067@subsection Basic Config Commands
68
69@deffn Command {hostname @var{hostname}} {}
70Set hostname of the router.
71@end deffn
72
73@deffn Command {password @var{password}} {}
74Set password for vty interface. If there is no password, a vty won't
75accept connections.
76@end deffn
77
78@deffn Command {enable password @var{password}} {}
79Set enable password.
80@end deffn
81
ajs274a4a42004-12-07 15:39:31 +000082@deffn Command {log trap @var{level}} {}
83@deffnx Command {no log trap} {}
84These commands are deprecated and are present only for historical compatibility.
85The log trap command sets the current logging level for all enabled
86logging destinations, and it sets the default for all future logging commands
87that do not specify a level. The normal default
88logging level is debugging. The @code{no} form of the command resets
89the default level for future logging commands to debugging, but it does
90not change the logging level of existing logging destinations.
91@end deffn
92
93
paul718e3742002-12-13 20:15:29 +000094@deffn Command {log stdout} {}
ajs274a4a42004-12-07 15:39:31 +000095@deffnx Command {log stdout @var{level}} {}
paul718e3742002-12-13 20:15:29 +000096@deffnx Command {no log stdout} {}
ajs274a4a42004-12-07 15:39:31 +000097Enable logging output to stdout.
98If the optional second argument specifying the
99logging level is not present, the default logging level (typically debugging,
100but can be changed using the deprecated @code{log trap} command) will be used.
101The @code{no} form of the command disables logging to stdout.
102The @code{level} argument must have one of these values:
103emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging. Note that the existing code logs its most important messages
104with severity @code{errors}.
paul718e3742002-12-13 20:15:29 +0000105@end deffn
106
107@deffn Command {log file @var{filename}} {}
ajs274a4a42004-12-07 15:39:31 +0000108@deffnx Command {log file @var{filename} @var{level}} {}
109@deffnx Command {no log file} {}
110If you want to log into a file, please specify @code{filename} as
111in this example:
paul718e3742002-12-13 20:15:29 +0000112@example
ajs274a4a42004-12-07 15:39:31 +0000113log file /var/log/quagga/bgpd.log informational
paul718e3742002-12-13 20:15:29 +0000114@end example
ajs274a4a42004-12-07 15:39:31 +0000115If the optional second argument specifying the
116logging level is not present, the default logging level (typically debugging,
117but can be changed using the deprecated @code{log trap} command) will be used.
118The @code{no} form of the command disables logging to a file.
paul718e3742002-12-13 20:15:29 +0000119@end deffn
120
121@deffn Command {log syslog} {}
ajs274a4a42004-12-07 15:39:31 +0000122@deffnx Command {log syslog @var{level}} {}
paul718e3742002-12-13 20:15:29 +0000123@deffnx Command {no log syslog} {}
ajs274a4a42004-12-07 15:39:31 +0000124Enable logging output to syslog.
125If the optional second argument specifying the
126logging level is not present, the default logging level (typically debugging,
127but can be changed using the deprecated @code{log trap} command) will be used.
128The @code{no} form of the command disables logging to syslog.
paul718e3742002-12-13 20:15:29 +0000129@end deffn
130
ajs274a4a42004-12-07 15:39:31 +0000131@deffn Command {log monitor} {}
132@deffnx Command {log monitor @var{level}} {}
133@deffnx Command {no log monitor} {}
134Enable logging output to vty terminals that have enabled logging
135using the @code{terminal monitor} command.
136By default, monitor logging is enabled at the debugging level, but this
137command (or the deprecated @code{log trap} command) can be used to change
138the monitor logging level.
139If the optional second argument specifying the
140logging level is not present, the default logging level (typically debugging,
141but can be changed using the deprecated @code{log trap} command) will be used.
142The @code{no} form of the command disables logging to terminal monitors.
paul718e3742002-12-13 20:15:29 +0000143@end deffn
144
ajs274a4a42004-12-07 15:39:31 +0000145@deffn Command {log facility @var{facility}} {}
146@deffnx Command {no log facility} {}
147This command changes the facility used in syslog messages. The default
148facility is @code{daemon}. The @code{no} form of the command resets
149the facility to the default @code{daemon} facility.
paul718e3742002-12-13 20:15:29 +0000150@end deffn
151
ajs274a4a42004-12-07 15:39:31 +0000152@deffn Command {log record-priority} {}
153@deffnx Command {no log record-priority} {}
154To include the severity in all messages logged to a file, to stdout, or to
155a terminal monitor (i.e. anything except syslog),
156use the @code{log record-priority} global configuration command.
157To disable this option, use the @code{no} form of the command. By default,
158the severity level is not included in logged messages. Note: some
159versions of syslogd (including Solaris) can be configured to include
160the facility and level in the messages emitted.
paul718e3742002-12-13 20:15:29 +0000161@end deffn
162
163@deffn Command {service password-encryption} {}
164Encrypt password.
165@end deffn
166
167@deffn Command {service advanced-vty} {}
168Enable advanced mode VTY.
169@end deffn
170
171@deffn Command {service terminal-length @var{<0-512>}} {}
172Set system wide line configuration. This configuration command applies
173to all VTY interfaces.
174@end deffn
175
paul718e3742002-12-13 20:15:29 +0000176@deffn Command {line vty} {}
177Enter vty configuration mode.
178@end deffn
179
180@deffn Command {banner motd default} {}
181Set default motd string.
182@end deffn
183
184@deffn Command {no banner motd} {}
185No motd banner string will be printed.
186@end deffn
187
188@deffn {Line Command} {exec-timeout @var{minute}} {}
189@deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {}
190Set VTY connection timeout value. When only one argument is specified
191it is used for timeout value in minutes. Optional second argument is
192used for timeout value in seconds. Default timeout value is 10 minutes.
193When timeout value is zero, it means no timeout.
194@end deffn
195
196@deffn {Line Command} {no exec-timeout} {}
197Do not perform timeout at all. This command is as same as
198@command{exec-timeout 0 0}.
199@end deffn
200
201@deffn {Line Command} {access-class @var{access-list}} {}
202Restrict vty connections with an access list.
203@end deffn
204
paul76b89b42004-11-06 17:13:09 +0000205@node Sample Config File
paul718e3742002-12-13 20:15:29 +0000206@subsection Sample Config File
207
208
209Below is a sample configuration file for the zebra daemon.
210
211@example
212@group
213!
214! Zebra configuration file
215!
216hostname Router
217password zebra
218enable password zebra
219!
220log stdout
221!
222!
223@end group
224@end example
225
226'!' and '#' are comment characters. If the first character of the word
227is one of the comment characters then from the rest of the line forward
228will be ignored as a comment.
229
230@example
231password zebra!password
232@end example
233
234If a comment character is not the first character of the word, it's a
235normal character. So in the above example '!' will not be regarded as a
236comment and the password is set to 'zebra!password'.
237
238
239
ajs274a4a42004-12-07 15:39:31 +0000240@node Terminal Mode Commands
241@section Terminal Mode Commands
242
243@deffn Command {write terminal} {}
244Displays the current configuration to the vty interface.
245@end deffn
246
247@deffn Command {write file} {}
248Write current configuration to configuration file.
249@end deffn
250
251@deffn Command {configure terminal} {}
252Change to configuration mode. This command is the first step to
253configuration.
254@end deffn
255
256@deffn Command {terminal length @var{<0-512>}} {}
257Set terminal display length to @var{<0-512>}. If length is 0, no
258display control is performed.
259@end deffn
260
261@deffn Command {who} {}
262Show a list of currently connected vty sessions.
263@end deffn
264
265@deffn Command {list} {}
266List all available commands.
267@end deffn
268
269@deffn Command {show version} {}
270Show the current version of @value{PACKAGE_NAME} and its build host information.
271@end deffn
272
273@deffn Command {show logging} {}
274Shows the current configuration of the logging system. This includes
275the status of all logging destinations.
276@end deffn
277
278@deffn Command {logmsg @var{level} @var{message}} {}
279Send a message to all logging destinations that are enabled for messages
280of the given severity.
281@end deffn
282
283
284
285
paul76b89b42004-11-06 17:13:09 +0000286@node Common Invocation Options
paul718e3742002-12-13 20:15:29 +0000287@section Common Invocation Options
288@c COMMON_OPTIONS
289@c OPTIONS section of the man page
290
paul76b89b42004-11-06 17:13:09 +0000291These options apply to all @value{PACKAGE_NAME} daemons.
paul718e3742002-12-13 20:15:29 +0000292
293@table @samp
294
295@item -d
296@itemx --daemon
297Runs in daemon mode.
298
299@item -f @var{file}
300@itemx --config_file=@var{file}
301Set configuration file name.
302
303@item -h
304@itemx --help
305Display this help and exit.
306
307@item -i @var{file}
308@itemx --pid_file=@var{file}
309
310Upon startup the process identifier of the daemon is written to a file,
311typically in @file{/var/run}. This file can be used by the init system
312to implement commands such as @command{@dots{}/init.d/zebra status},
313@command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra
314stop}.
315
316The file name is an run-time option rather than a configure-time option
317so that multiple routing daemons can be run simultaneously. This is
paul76b89b42004-11-06 17:13:09 +0000318useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One
paul718e3742002-12-13 20:15:29 +0000319machine can be used to collect differing routing views from differing
320points in the network.
321
paul971a4492003-06-20 01:18:07 +0000322@item -A @var{address}
323@itemx --vty_addr=@var{address}
324Set the VTY local address to bind to. If set, the VTY socket will only
325be bound to this address.
326
paul718e3742002-12-13 20:15:29 +0000327@item -P @var{port}
328@itemx --vty_port=@var{port}
paul971a4492003-06-20 01:18:07 +0000329Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
330be opened.
331
332@item -u @var{user}
333@itemx --vty_addr=@var{user}
334Set the user and group to run as.
paul718e3742002-12-13 20:15:29 +0000335
336@item -v
337@itemx --version
338Print program version.
339
340@end table
341
342
343
paul76b89b42004-11-06 17:13:09 +0000344@node Virtual Terminal Interfaces
paul718e3742002-12-13 20:15:29 +0000345@section Virtual Terminal Interfaces
346
347VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
348interface (CLI) for user interaction with the routing daemon.
349
350@menu
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
354@end menu
355
356
357
paul76b89b42004-11-06 17:13:09 +0000358@node VTY Overview
paul718e3742002-12-13 20:15:29 +0000359@subsection VTY Overview
360
361
362VTY stands for Virtual TeletYpe interface. It means you can connect to
363the daemon via the telnet protocol.
364
365To enable a VTY interface, you have to setup a VTY password. If there
366is no VTY password, one cannot connect to the VTY interface at all.
367
368@example
369@group
370% telnet localhost 2601
371Trying 127.0.0.1...
372Connected to localhost.
373Escape character is '^]'.
374
paul76b89b42004-11-06 17:13:09 +0000375Hello, this is @value{PACKAGE_NAME} (version @value{VERSION})
376@value{COPYRIGHT_STR}
paul718e3742002-12-13 20:15:29 +0000377
378User Access Verification
379
380Password: XXXXX
381Router> ?
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
388Router> enable
389Password: XXXXX
390Router# configure terminal
391Router(config)# interface eth0
392Router(config-if)# ip address 10.0.0.1/8
393Router(config-if)# ^Z
394Router#
395@end group
396@end example
397
398'?' is very useful for looking up commands.
399
paul76b89b42004-11-06 17:13:09 +0000400@node VTY Modes
paul718e3742002-12-13 20:15:29 +0000401@subsection VTY Modes
402
paul718e3742002-12-13 20:15:29 +0000403There are three basic VTY modes:
404
405@menu
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)
409@end menu
410
411There are commands that may be restricted to specific VTY modes.
412
paul76b89b42004-11-06 17:13:09 +0000413@node VTY View Mode
paul718e3742002-12-13 20:15:29 +0000414@subsubsection VTY View Mode
415@c to be written (gpoul)
416
417
418This mode is for read-only access to the CLI. One may exit the mode by
419leaving the system, or by entering @code{enable} mode.
420
paul76b89b42004-11-06 17:13:09 +0000421@node VTY Enable Mode
paul718e3742002-12-13 20:15:29 +0000422@subsubsection VTY Enable Mode
423
paul718e3742002-12-13 20:15:29 +0000424@c to be written (gpoul)
425This mode is for read-write access to the CLI. One may exit the mode by
426leaving the system, or by escaping to view mode.
427
paul76b89b42004-11-06 17:13:09 +0000428@node VTY Other Modes
paul718e3742002-12-13 20:15:29 +0000429@subsubsection VTY Other Modes
430
431
432@c to be written (gpoul)
433This page is for describing other modes.
434
paul76b89b42004-11-06 17:13:09 +0000435@node VTY CLI Commands
paul718e3742002-12-13 20:15:29 +0000436@subsection VTY CLI Commands
437
paul76b89b42004-11-06 17:13:09 +0000438Commands that you may use at the command-line are described in the following
439three subsubsections.
paul718e3742002-12-13 20:15:29 +0000440
441@menu
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
445@end menu
446
paul76b89b42004-11-06 17:13:09 +0000447@node CLI Movement Commands
paul718e3742002-12-13 20:15:29 +0000448@subsubsection CLI Movement Commands
449
paul718e3742002-12-13 20:15:29 +0000450These commands are used for moving the CLI cursor. The @key{C} character
451means press the Control Key.
452
453@table @kbd
454
455@item C-f
456@itemx @key{RIGHT}
457@kindex C-f
458@kindex @key{RIGHT}
459Move forward one character.
460
461@item C-b
462@itemx @key{LEFT}
463@kindex C-b
464@kindex @key{LEFT}
465Move backward one character.
466
467@item M-f
468@kindex M-f
469Move forward one word.
470
471@item M-b
472@kindex M-b
473Move backward one word.
474
475@item C-a
476@kindex C-a
477Move to the beginning of the line.
478
479@item C-e
480@kindex C-e
481Move to the end of the line.
482
483@end table
484
paul76b89b42004-11-06 17:13:09 +0000485@node CLI Editing Commands
paul718e3742002-12-13 20:15:29 +0000486@subsubsection CLI Editing Commands
487
paul718e3742002-12-13 20:15:29 +0000488These commands are used for editing text on a line. The @key{C}
489character means press the Control Key.
490
491@table @kbd
492
493@item C-h
494@itemx @key{DEL}
495@kindex C-h
496@kindex @key{DEL}
497Delete the character before point.
498
499@item C-d
500@kindex C-d
501Delete the character after point.
502
503@item M-d
504@kindex M-d
505Forward kill word.
506
507@item C-w
508@kindex C-w
509Backward kill word.
510
511@item C-k
512@kindex C-k
513Kill to the end of the line.
514
515@item C-u
516@kindex C-u
517Kill line from the beginning, erasing input.
518
519@item C-t
520@kindex C-t
521Transpose character.
522
523@end table
524
paul76b89b42004-11-06 17:13:09 +0000525@node CLI Advanced Commands
paul718e3742002-12-13 20:15:29 +0000526@subsubsection CLI Advanced Commands
527
paul718e3742002-12-13 20:15:29 +0000528There are several additional CLI commands for command line completions,
529insta-help, and VTY session management.
530
531@table @kbd
532
533@item C-c
534@kindex C-c
535Interrupt current input and moves to the next line.
536
537@item C-z
538@kindex C-z
539End current configuration session and move to top node.
540
541
542@item C-n
543@itemx @key{DOWN}
544@kindex C-n
545@kindex @key{DOWN}
546Move down to next line in the history buffer.
547
548@item C-p
549@itemx @key{UP}
550@kindex C-p
551@kindex @key{UP}
552Move up to previous line in the history buffer.
553
554@item TAB
555@kindex @key{TAB}
556Use command line completion by typing @key{TAB}.
557
558@item
559@kindex ?
560You can use command line help by typing @code{help} at the beginning of
561the line. Typing @kbd{?} at any point in the line will show possible
562completions.
563
564@end table