]> git.proxmox.com Git - mirror_frr.git/blob - doc/basic.texi
2004-12-07 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
[mirror_frr.git] / doc / basic.texi
1 @node Basic commands
2 @chapter Basic commands
3
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:
8
9 @itemize @bullet
10 @item @command{ripd}, @command{ripngd}, @command{ospfd}, @command{ospf6d}, @command{bgpd}
11 @item @command{zebra}
12 @end itemize
13
14 The following sections discuss commands common to all the routing
15 daemons.
16
17 @menu
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
22 @end menu
23
24
25
26 @node Config Commands
27 @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
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
45 starting.
46
47 Config files are generally found in:
48
49 @itemize @asis
50 @item @file{@value{INSTALL_PREFIX_ETC}/*.conf}
51 @end itemize
52
53 Each of the daemons has its own
54 config 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
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.
63
64
65
66 @node Basic Config Commands
67 @subsection Basic Config Commands
68
69 @deffn Command {hostname @var{hostname}} {}
70 Set hostname of the router.
71 @end deffn
72
73 @deffn Command {password @var{password}} {}
74 Set password for vty interface. If there is no password, a vty won't
75 accept connections.
76 @end deffn
77
78 @deffn Command {enable password @var{password}} {}
79 Set enable password.
80 @end deffn
81
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.
91 @end deffn
92
93
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}.
105 @end deffn
106
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
111 in this example:
112 @example
113 log file /var/log/quagga/bgpd.log informational
114 @end example
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.
119 @end deffn
120
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.
129 @end deffn
130
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.
143 @end deffn
144
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.
150 @end deffn
151
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.
161 @end deffn
162
163 @deffn Command {service password-encryption} {}
164 Encrypt password.
165 @end deffn
166
167 @deffn Command {service advanced-vty} {}
168 Enable advanced mode VTY.
169 @end deffn
170
171 @deffn Command {service terminal-length @var{<0-512>}} {}
172 Set system wide line configuration. This configuration command applies
173 to all VTY interfaces.
174 @end deffn
175
176 @deffn Command {line vty} {}
177 Enter vty configuration mode.
178 @end deffn
179
180 @deffn Command {banner motd default} {}
181 Set default motd string.
182 @end deffn
183
184 @deffn Command {no banner motd} {}
185 No 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}} {}
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.
194 @end deffn
195
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}.
199 @end deffn
200
201 @deffn {Line Command} {access-class @var{access-list}} {}
202 Restrict vty connections with an access list.
203 @end deffn
204
205 @node Sample Config File
206 @subsection Sample Config File
207
208
209 Below is a sample configuration file for the zebra daemon.
210
211 @example
212 @group
213 !
214 ! Zebra configuration file
215 !
216 hostname Router
217 password zebra
218 enable password zebra
219 !
220 log stdout
221 !
222 !
223 @end group
224 @end example
225
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.
229
230 @example
231 password zebra!password
232 @end example
233
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'.
237
238
239
240 @node Terminal Mode Commands
241 @section Terminal Mode Commands
242
243 @deffn Command {write terminal} {}
244 Displays the current configuration to the vty interface.
245 @end deffn
246
247 @deffn Command {write file} {}
248 Write current configuration to configuration file.
249 @end deffn
250
251 @deffn Command {configure terminal} {}
252 Change to configuration mode. This command is the first step to
253 configuration.
254 @end deffn
255
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.
259 @end deffn
260
261 @deffn Command {who} {}
262 Show a list of currently connected vty sessions.
263 @end deffn
264
265 @deffn Command {list} {}
266 List all available commands.
267 @end deffn
268
269 @deffn Command {show version} {}
270 Show the current version of @value{PACKAGE_NAME} and its build host information.
271 @end deffn
272
273 @deffn Command {show logging} {}
274 Shows the current configuration of the logging system. This includes
275 the status of all logging destinations.
276 @end deffn
277
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.
281 @end deffn
282
283
284
285
286 @node Common Invocation Options
287 @section Common Invocation Options
288 @c COMMON_OPTIONS
289 @c OPTIONS section of the man page
290
291 These options apply to all @value{PACKAGE_NAME} daemons.
292
293 @table @samp
294
295 @item -d
296 @itemx --daemon
297 Runs in daemon mode.
298
299 @item -f @var{file}
300 @itemx --config_file=@var{file}
301 Set configuration file name.
302
303 @item -h
304 @itemx --help
305 Display this help and exit.
306
307 @item -i @var{file}
308 @itemx --pid_file=@var{file}
309
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
314 stop}.
315
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.
321
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.
326
327 @item -P @var{port}
328 @itemx --vty_port=@var{port}
329 Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
330 be opened.
331
332 @item -u @var{user}
333 @itemx --vty_addr=@var{user}
334 Set the user and group to run as.
335
336 @item -v
337 @itemx --version
338 Print program version.
339
340 @end table
341
342
343
344 @node Virtual Terminal Interfaces
345 @section Virtual Terminal Interfaces
346
347 VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
348 interface (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
358 @node VTY Overview
359 @subsection VTY Overview
360
361
362 VTY stands for Virtual TeletYpe interface. It means you can connect to
363 the daemon via the telnet protocol.
364
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.
367
368 @example
369 @group
370 % telnet localhost 2601
371 Trying 127.0.0.1...
372 Connected to localhost.
373 Escape character is '^]'.
374
375 Hello, this is @value{PACKAGE_NAME} (version @value{VERSION})
376 @value{COPYRIGHT_STR}
377
378 User Access Verification
379
380 Password: XXXXX
381 Router> ?
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
388 Router> enable
389 Password: XXXXX
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
394 Router#
395 @end group
396 @end example
397
398 '?' is very useful for looking up commands.
399
400 @node VTY Modes
401 @subsection VTY Modes
402
403 There 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
411 There are commands that may be restricted to specific VTY modes.
412
413 @node VTY View Mode
414 @subsubsection VTY View Mode
415 @c to be written (gpoul)
416
417
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.
420
421 @node VTY Enable Mode
422 @subsubsection VTY Enable Mode
423
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.
427
428 @node VTY Other Modes
429 @subsubsection VTY Other Modes
430
431
432 @c to be written (gpoul)
433 This page is for describing other modes.
434
435 @node VTY CLI Commands
436 @subsection VTY CLI Commands
437
438 Commands that you may use at the command-line are described in the following
439 three subsubsections.
440
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
447 @node CLI Movement Commands
448 @subsubsection CLI Movement Commands
449
450 These commands are used for moving the CLI cursor. The @key{C} character
451 means 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}
459 Move forward one character.
460
461 @item C-b
462 @itemx @key{LEFT}
463 @kindex C-b
464 @kindex @key{LEFT}
465 Move backward one character.
466
467 @item M-f
468 @kindex M-f
469 Move forward one word.
470
471 @item M-b
472 @kindex M-b
473 Move backward one word.
474
475 @item C-a
476 @kindex C-a
477 Move to the beginning of the line.
478
479 @item C-e
480 @kindex C-e
481 Move to the end of the line.
482
483 @end table
484
485 @node CLI Editing Commands
486 @subsubsection CLI Editing Commands
487
488 These commands are used for editing text on a line. The @key{C}
489 character 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}
497 Delete the character before point.
498
499 @item C-d
500 @kindex C-d
501 Delete the character after point.
502
503 @item M-d
504 @kindex M-d
505 Forward kill word.
506
507 @item C-w
508 @kindex C-w
509 Backward kill word.
510
511 @item C-k
512 @kindex C-k
513 Kill to the end of the line.
514
515 @item C-u
516 @kindex C-u
517 Kill line from the beginning, erasing input.
518
519 @item C-t
520 @kindex C-t
521 Transpose character.
522
523 @end table
524
525 @node CLI Advanced Commands
526 @subsubsection CLI Advanced Commands
527
528 There are several additional CLI commands for command line completions,
529 insta-help, and VTY session management.
530
531 @table @kbd
532
533 @item C-c
534 @kindex C-c
535 Interrupt current input and moves to the next line.
536
537 @item C-z
538 @kindex C-z
539 End 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}
546 Move 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}
552 Move up to previous line in the history buffer.
553
554 @item TAB
555 @kindex @key{TAB}
556 Use command line completion by typing @key{TAB}.
557
558 @item
559 @kindex ?
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
562 completions.
563
564 @end table