]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | @node Basic commands |
718e3744 | 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 | |
274a4a44 | 18 | * Terminal Mode Commands:: Common commands used in a VTY |
718e3744 | 19 | * Config Commands:: Commands used in config files |
20 | * Common Invocation Options:: Starting the daemons | |
274a4a44 | 21 | * Virtual Terminal Interfaces:: Interacting with the daemons |
718e3744 | 22 | @end menu |
23 | ||
24 | ||
25 | ||
76b89b4a | 26 | @node Config Commands |
718e3744 | 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 | ||
76b89b4a | 66 | @node Basic Config Commands |
718e3744 | 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 | ||
274a4a44 | 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 | ||
718e3744 | 94 | @deffn Command {log stdout} {} |
274a4a44 | 95 | @deffnx Command {log stdout @var{level}} {} |
718e3744 | 96 | @deffnx Command {no log stdout} {} |
274a4a44 | 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}. | |
718e3744 | 105 | @end deffn |
106 | ||
107 | @deffn Command {log file @var{filename}} {} | |
274a4a44 | 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: | |
718e3744 | 112 | @example |
274a4a44 | 113 | log file /var/log/quagga/bgpd.log informational |
718e3744 | 114 | @end example |
274a4a44 | 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. | |
c70257d0 | 119 | |
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. | |
718e3744 | 125 | @end deffn |
126 | ||
127 | @deffn Command {log syslog} {} | |
274a4a44 | 128 | @deffnx Command {log syslog @var{level}} {} |
718e3744 | 129 | @deffnx Command {no log syslog} {} |
274a4a44 | 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. | |
718e3744 | 135 | @end deffn |
136 | ||
274a4a44 | 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. | |
718e3744 | 149 | @end deffn |
150 | ||
274a4a44 | 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. | |
718e3744 | 156 | @end deffn |
157 | ||
274a4a44 | 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. | |
718e3744 | 167 | @end deffn |
168 | ||
169 | @deffn Command {service password-encryption} {} | |
170 | Encrypt password. | |
171 | @end deffn | |
172 | ||
173 | @deffn Command {service advanced-vty} {} | |
174 | Enable advanced mode VTY. | |
175 | @end deffn | |
176 | ||
177 | @deffn Command {service terminal-length @var{<0-512>}} {} | |
178 | Set system wide line configuration. This configuration command applies | |
179 | to all VTY interfaces. | |
180 | @end deffn | |
181 | ||
718e3744 | 182 | @deffn Command {line vty} {} |
183 | Enter vty configuration mode. | |
184 | @end deffn | |
185 | ||
186 | @deffn Command {banner motd default} {} | |
187 | Set default motd string. | |
188 | @end deffn | |
189 | ||
190 | @deffn Command {no banner motd} {} | |
191 | No motd banner string will be printed. | |
192 | @end deffn | |
193 | ||
194 | @deffn {Line Command} {exec-timeout @var{minute}} {} | |
195 | @deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {} | |
196 | Set VTY connection timeout value. When only one argument is specified | |
197 | it is used for timeout value in minutes. Optional second argument is | |
198 | used for timeout value in seconds. Default timeout value is 10 minutes. | |
199 | When timeout value is zero, it means no timeout. | |
200 | @end deffn | |
201 | ||
202 | @deffn {Line Command} {no exec-timeout} {} | |
203 | Do not perform timeout at all. This command is as same as | |
204 | @command{exec-timeout 0 0}. | |
205 | @end deffn | |
206 | ||
207 | @deffn {Line Command} {access-class @var{access-list}} {} | |
208 | Restrict vty connections with an access list. | |
209 | @end deffn | |
210 | ||
76b89b4a | 211 | @node Sample Config File |
718e3744 | 212 | @subsection Sample Config File |
213 | ||
214 | ||
215 | Below is a sample configuration file for the zebra daemon. | |
216 | ||
217 | @example | |
218 | @group | |
219 | ! | |
220 | ! Zebra configuration file | |
221 | ! | |
222 | hostname Router | |
223 | password zebra | |
224 | enable password zebra | |
225 | ! | |
226 | log stdout | |
227 | ! | |
228 | ! | |
229 | @end group | |
230 | @end example | |
231 | ||
232 | '!' and '#' are comment characters. If the first character of the word | |
233 | is one of the comment characters then from the rest of the line forward | |
234 | will be ignored as a comment. | |
235 | ||
236 | @example | |
237 | password zebra!password | |
238 | @end example | |
239 | ||
240 | If a comment character is not the first character of the word, it's a | |
241 | normal character. So in the above example '!' will not be regarded as a | |
242 | comment and the password is set to 'zebra!password'. | |
243 | ||
244 | ||
245 | ||
274a4a44 | 246 | @node Terminal Mode Commands |
247 | @section Terminal Mode Commands | |
248 | ||
249 | @deffn Command {write terminal} {} | |
250 | Displays the current configuration to the vty interface. | |
251 | @end deffn | |
252 | ||
253 | @deffn Command {write file} {} | |
254 | Write current configuration to configuration file. | |
255 | @end deffn | |
256 | ||
257 | @deffn Command {configure terminal} {} | |
258 | Change to configuration mode. This command is the first step to | |
259 | configuration. | |
260 | @end deffn | |
261 | ||
262 | @deffn Command {terminal length @var{<0-512>}} {} | |
263 | Set terminal display length to @var{<0-512>}. If length is 0, no | |
264 | display control is performed. | |
265 | @end deffn | |
266 | ||
267 | @deffn Command {who} {} | |
268 | Show a list of currently connected vty sessions. | |
269 | @end deffn | |
270 | ||
271 | @deffn Command {list} {} | |
272 | List all available commands. | |
273 | @end deffn | |
274 | ||
275 | @deffn Command {show version} {} | |
276 | Show the current version of @value{PACKAGE_NAME} and its build host information. | |
277 | @end deffn | |
278 | ||
279 | @deffn Command {show logging} {} | |
280 | Shows the current configuration of the logging system. This includes | |
281 | the status of all logging destinations. | |
282 | @end deffn | |
283 | ||
284 | @deffn Command {logmsg @var{level} @var{message}} {} | |
285 | Send a message to all logging destinations that are enabled for messages | |
286 | of the given severity. | |
287 | @end deffn | |
288 | ||
289 | ||
290 | ||
291 | ||
76b89b4a | 292 | @node Common Invocation Options |
718e3744 | 293 | @section Common Invocation Options |
294 | @c COMMON_OPTIONS | |
295 | @c OPTIONS section of the man page | |
296 | ||
76b89b4a | 297 | These options apply to all @value{PACKAGE_NAME} daemons. |
718e3744 | 298 | |
299 | @table @samp | |
300 | ||
301 | @item -d | |
302 | @itemx --daemon | |
303 | Runs in daemon mode. | |
304 | ||
305 | @item -f @var{file} | |
306 | @itemx --config_file=@var{file} | |
307 | Set configuration file name. | |
308 | ||
309 | @item -h | |
310 | @itemx --help | |
311 | Display this help and exit. | |
312 | ||
313 | @item -i @var{file} | |
314 | @itemx --pid_file=@var{file} | |
315 | ||
316 | Upon startup the process identifier of the daemon is written to a file, | |
317 | typically in @file{/var/run}. This file can be used by the init system | |
318 | to implement commands such as @command{@dots{}/init.d/zebra status}, | |
319 | @command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra | |
320 | stop}. | |
321 | ||
322 | The file name is an run-time option rather than a configure-time option | |
323 | so that multiple routing daemons can be run simultaneously. This is | |
76b89b4a | 324 | useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One |
718e3744 | 325 | machine can be used to collect differing routing views from differing |
326 | points in the network. | |
327 | ||
971a4497 | 328 | @item -A @var{address} |
329 | @itemx --vty_addr=@var{address} | |
330 | Set the VTY local address to bind to. If set, the VTY socket will only | |
331 | be bound to this address. | |
332 | ||
718e3744 | 333 | @item -P @var{port} |
334 | @itemx --vty_port=@var{port} | |
971a4497 | 335 | Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not |
336 | be opened. | |
337 | ||
338 | @item -u @var{user} | |
339 | @itemx --vty_addr=@var{user} | |
340 | Set the user and group to run as. | |
718e3744 | 341 | |
342 | @item -v | |
343 | @itemx --version | |
344 | Print program version. | |
345 | ||
346 | @end table | |
347 | ||
348 | ||
349 | ||
76b89b4a | 350 | @node Virtual Terminal Interfaces |
718e3744 | 351 | @section Virtual Terminal Interfaces |
352 | ||
353 | VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line | |
354 | interface (CLI) for user interaction with the routing daemon. | |
355 | ||
356 | @menu | |
357 | * VTY Overview:: Basics about VTYs | |
358 | * VTY Modes:: View, Enable, and Other VTY modes | |
359 | * VTY CLI Commands:: Commands for movement, edition, and management | |
360 | @end menu | |
361 | ||
362 | ||
363 | ||
76b89b4a | 364 | @node VTY Overview |
718e3744 | 365 | @subsection VTY Overview |
366 | ||
367 | ||
368 | VTY stands for Virtual TeletYpe interface. It means you can connect to | |
369 | the daemon via the telnet protocol. | |
370 | ||
371 | To enable a VTY interface, you have to setup a VTY password. If there | |
372 | is no VTY password, one cannot connect to the VTY interface at all. | |
373 | ||
374 | @example | |
375 | @group | |
376 | % telnet localhost 2601 | |
377 | Trying 127.0.0.1... | |
378 | Connected to localhost. | |
379 | Escape character is '^]'. | |
380 | ||
76b89b4a | 381 | Hello, this is @value{PACKAGE_NAME} (version @value{VERSION}) |
382 | @value{COPYRIGHT_STR} | |
718e3744 | 383 | |
384 | User Access Verification | |
385 | ||
386 | Password: XXXXX | |
387 | Router> ? | |
388 | enable Turn on privileged commands | |
389 | exit Exit current mode and down to previous mode | |
390 | help Description of the interactive help system | |
391 | list Print command list | |
392 | show Show running system information | |
393 | who Display who is on a vty | |
394 | Router> enable | |
395 | Password: XXXXX | |
396 | Router# configure terminal | |
397 | Router(config)# interface eth0 | |
398 | Router(config-if)# ip address 10.0.0.1/8 | |
399 | Router(config-if)# ^Z | |
400 | Router# | |
401 | @end group | |
402 | @end example | |
403 | ||
404 | '?' is very useful for looking up commands. | |
405 | ||
76b89b4a | 406 | @node VTY Modes |
718e3744 | 407 | @subsection VTY Modes |
408 | ||
718e3744 | 409 | There are three basic VTY modes: |
410 | ||
411 | @menu | |
412 | * VTY View Mode:: Mode for read-only interaction | |
413 | * VTY Enable Mode:: Mode for read-write interaction | |
414 | * VTY Other Modes:: Special modes (tftp, etc) | |
415 | @end menu | |
416 | ||
417 | There are commands that may be restricted to specific VTY modes. | |
418 | ||
76b89b4a | 419 | @node VTY View Mode |
718e3744 | 420 | @subsubsection VTY View Mode |
421 | @c to be written (gpoul) | |
422 | ||
423 | ||
424 | This mode is for read-only access to the CLI. One may exit the mode by | |
425 | leaving the system, or by entering @code{enable} mode. | |
426 | ||
76b89b4a | 427 | @node VTY Enable Mode |
718e3744 | 428 | @subsubsection VTY Enable Mode |
429 | ||
718e3744 | 430 | @c to be written (gpoul) |
431 | This mode is for read-write access to the CLI. One may exit the mode by | |
432 | leaving the system, or by escaping to view mode. | |
433 | ||
76b89b4a | 434 | @node VTY Other Modes |
718e3744 | 435 | @subsubsection VTY Other Modes |
436 | ||
437 | ||
438 | @c to be written (gpoul) | |
439 | This page is for describing other modes. | |
440 | ||
76b89b4a | 441 | @node VTY CLI Commands |
718e3744 | 442 | @subsection VTY CLI Commands |
443 | ||
76b89b4a | 444 | Commands that you may use at the command-line are described in the following |
445 | three subsubsections. | |
718e3744 | 446 | |
447 | @menu | |
448 | * CLI Movement Commands:: Commands for moving the cursor about | |
449 | * CLI Editing Commands:: Commands for changing text | |
450 | * CLI Advanced Commands:: Other commands, session management and so on | |
451 | @end menu | |
452 | ||
76b89b4a | 453 | @node CLI Movement Commands |
718e3744 | 454 | @subsubsection CLI Movement Commands |
455 | ||
718e3744 | 456 | These commands are used for moving the CLI cursor. The @key{C} character |
457 | means press the Control Key. | |
458 | ||
459 | @table @kbd | |
460 | ||
461 | @item C-f | |
462 | @itemx @key{RIGHT} | |
463 | @kindex C-f | |
464 | @kindex @key{RIGHT} | |
465 | Move forward one character. | |
466 | ||
467 | @item C-b | |
468 | @itemx @key{LEFT} | |
469 | @kindex C-b | |
470 | @kindex @key{LEFT} | |
471 | Move backward one character. | |
472 | ||
473 | @item M-f | |
474 | @kindex M-f | |
475 | Move forward one word. | |
476 | ||
477 | @item M-b | |
478 | @kindex M-b | |
479 | Move backward one word. | |
480 | ||
481 | @item C-a | |
482 | @kindex C-a | |
483 | Move to the beginning of the line. | |
484 | ||
485 | @item C-e | |
486 | @kindex C-e | |
487 | Move to the end of the line. | |
488 | ||
489 | @end table | |
490 | ||
76b89b4a | 491 | @node CLI Editing Commands |
718e3744 | 492 | @subsubsection CLI Editing Commands |
493 | ||
718e3744 | 494 | These commands are used for editing text on a line. The @key{C} |
495 | character means press the Control Key. | |
496 | ||
497 | @table @kbd | |
498 | ||
499 | @item C-h | |
500 | @itemx @key{DEL} | |
501 | @kindex C-h | |
502 | @kindex @key{DEL} | |
503 | Delete the character before point. | |
504 | ||
505 | @item C-d | |
506 | @kindex C-d | |
507 | Delete the character after point. | |
508 | ||
509 | @item M-d | |
510 | @kindex M-d | |
511 | Forward kill word. | |
512 | ||
513 | @item C-w | |
514 | @kindex C-w | |
515 | Backward kill word. | |
516 | ||
517 | @item C-k | |
518 | @kindex C-k | |
519 | Kill to the end of the line. | |
520 | ||
521 | @item C-u | |
522 | @kindex C-u | |
523 | Kill line from the beginning, erasing input. | |
524 | ||
525 | @item C-t | |
526 | @kindex C-t | |
527 | Transpose character. | |
528 | ||
529 | @end table | |
530 | ||
76b89b4a | 531 | @node CLI Advanced Commands |
718e3744 | 532 | @subsubsection CLI Advanced Commands |
533 | ||
718e3744 | 534 | There are several additional CLI commands for command line completions, |
535 | insta-help, and VTY session management. | |
536 | ||
537 | @table @kbd | |
538 | ||
539 | @item C-c | |
540 | @kindex C-c | |
541 | Interrupt current input and moves to the next line. | |
542 | ||
543 | @item C-z | |
544 | @kindex C-z | |
545 | End current configuration session and move to top node. | |
546 | ||
547 | ||
548 | @item C-n | |
549 | @itemx @key{DOWN} | |
550 | @kindex C-n | |
551 | @kindex @key{DOWN} | |
552 | Move down to next line in the history buffer. | |
553 | ||
554 | @item C-p | |
555 | @itemx @key{UP} | |
556 | @kindex C-p | |
557 | @kindex @key{UP} | |
558 | Move up to previous line in the history buffer. | |
559 | ||
560 | @item TAB | |
561 | @kindex @key{TAB} | |
562 | Use command line completion by typing @key{TAB}. | |
563 | ||
564 | @item | |
565 | @kindex ? | |
566 | You can use command line help by typing @code{help} at the beginning of | |
567 | the line. Typing @kbd{?} at any point in the line will show possible | |
568 | completions. | |
569 | ||
570 | @end table |