]> git.proxmox.com Git - mirror_frr.git/blob - doc/basic.texi
2003-08-12 Paul Jakma <paul@dishone.st>
[mirror_frr.git] / doc / basic.texi
1 @node Basic commands
2 @comment node-name, next, previous, up
3 @chapter Basic commands
4
5 There are five routing daemons in use, and there is one manager daemon.
6 These daemons may be located on separate machines from the manager
7 daemon. Each of these daemons will listen on a particular port for
8 incoming VTY connections. The routing daemons are:
9
10 @itemize @bullet
11 @item @command{ripd}, @command{ripngd}, @command{ospfd}, @command{ospf6d}, @command{bgpd}
12 @item @command{zebra}
13 @end itemize
14
15 The following sections discuss commands common to all the routing
16 daemons.
17
18 @menu
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, Common Invocation Options, Basic commands, Basic commands
27 @comment node-name, next, previous, up
28 @section Config Commands
29
30 @cindex Configuration files for running the software
31 @c A -not configuration files for installing the software
32 @cindex Files for running configurations
33 @cindex Modifying the herd's behavior
34 @cindex Getting the herd running
35
36
37 @menu
38 * Basic Config Commands:: Some of the generic config commands
39 * Sample Config File:: An example config file
40 @end menu
41
42
43 In a config file, you can write the debugging options, a vty's password,
44 routing daemon configurations, a log file name, and so forth. This
45 information forms the initial command set for a routing beast as it is
46 starting.
47
48 Config files are generally found in:
49
50 @itemize @asis
51 @item @file{@value{INSTALL_PREFIX_ETC}/*.conf}
52 @end itemize
53
54 Each of the daemons has its own
55 config file. For example, zebra's default config file name is:
56
57 @itemize @asis
58 @item @file{@value{INSTALL_PREFIX_ETC}/zebra.conf}
59 @end itemize
60
61 The daemon name plus @file{.conf} is the default config file name. You
62 can specify a config file using the @kbd{-f} or @kbd{--config-file}
63 options when starting the daemon.
64
65
66
67 @node Basic Config Commands, Sample Config File, Config Commands, Config Commands
68 @comment node-name, next, previous, up
69 @subsection Basic Config Commands
70
71 @deffn Command {hostname @var{hostname}} {}
72 Set hostname of the router.
73 @end deffn
74
75 @deffn Command {password @var{password}} {}
76 Set password for vty interface. If there is no password, a vty won't
77 accept connections.
78 @end deffn
79
80 @deffn Command {enable password @var{password}} {}
81 Set enable password.
82 @end deffn
83
84 @deffn Command {log stdout} {}
85 @deffnx Command {no log stdout} {}
86 Set logging output to stdout.
87 @end deffn
88
89 @deffn Command {log file @var{filename}} {}
90 If you want to log into a file please specify @code{filename} as
91 follows.
92 @example
93 log file /usr/local/etc/bgpd.log
94 @end example
95 @end deffn
96
97 @deffn Command {log syslog} {}
98 @deffnx Command {no log syslog} {}
99 Set logging output to syslog.
100 @end deffn
101
102 @deffn Command {write terminal} {}
103 Displays the current configuration to the vty interface.
104 @end deffn
105
106 @deffn Command {write file} {}
107 Write current configuration to configuration file.
108 @end deffn
109
110 @deffn Command {configure terminal} {}
111 Change to configuration mode. This command is the first step to
112 configuration.
113 @end deffn
114
115 @deffn Command {terminal length @var{<0-512>}} {}
116 Set terminal display length to @var{<0-512>}. If length is 0, no
117 display control is performed.
118 @end deffn
119
120 @deffn Command {who} {}
121 @end deffn
122
123 @deffn Command {list} {}
124 List commands.
125 @end deffn
126
127 @deffn Command {service password-encryption} {}
128 Encrypt password.
129 @end deffn
130
131 @deffn Command {service advanced-vty} {}
132 Enable advanced mode VTY.
133 @end deffn
134
135 @deffn Command {service terminal-length @var{<0-512>}} {}
136 Set system wide line configuration. This configuration command applies
137 to all VTY interfaces.
138 @end deffn
139
140 @deffn Command {show version} {}
141 Show the current version of the Quagga and its build host information.
142 @end deffn
143
144 @deffn Command {line vty} {}
145 Enter vty configuration mode.
146 @end deffn
147
148 @deffn Command {banner motd default} {}
149 Set default motd string.
150 @end deffn
151
152 @deffn Command {no banner motd} {}
153 No motd banner string will be printed.
154 @end deffn
155
156 @deffn {Line Command} {exec-timeout @var{minute}} {}
157 @deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {}
158 Set VTY connection timeout value. When only one argument is specified
159 it is used for timeout value in minutes. Optional second argument is
160 used for timeout value in seconds. Default timeout value is 10 minutes.
161 When timeout value is zero, it means no timeout.
162 @end deffn
163
164 @deffn {Line Command} {no exec-timeout} {}
165 Do not perform timeout at all. This command is as same as
166 @command{exec-timeout 0 0}.
167 @end deffn
168
169 @deffn {Line Command} {access-class @var{access-list}} {}
170 Restrict vty connections with an access list.
171 @end deffn
172
173
174
175 @node Sample Config File, , Basic Config Commands, Config Commands
176 @comment node-name, next, previous, up
177 @subsection Sample Config File
178
179
180 Below is a sample configuration file for the zebra daemon.
181
182 @example
183 @group
184 !
185 ! Zebra configuration file
186 !
187 hostname Router
188 password zebra
189 enable password zebra
190 !
191 log stdout
192 !
193 !
194 @end group
195 @end example
196
197 '!' and '#' are comment characters. If the first character of the word
198 is one of the comment characters then from the rest of the line forward
199 will be ignored as a comment.
200
201 @example
202 password zebra!password
203 @end example
204
205 If a comment character is not the first character of the word, it's a
206 normal character. So in the above example '!' will not be regarded as a
207 comment and the password is set to 'zebra!password'.
208
209
210
211 @node Common Invocation Options, Virtual Terminal Interfaces, Config Commands, Basic commands
212 @comment node-name, next, previous, up
213 @section Common Invocation Options
214 @c COMMON_OPTIONS
215 @c OPTIONS section of the man page
216
217 These options apply to all Quagga daemons.
218
219 @table @samp
220
221 @item -d
222 @itemx --daemon
223 Runs in daemon mode.
224
225 @item -f @var{file}
226 @itemx --config_file=@var{file}
227 Set configuration file name.
228
229 @item -h
230 @itemx --help
231 Display this help and exit.
232
233 @item -i @var{file}
234 @itemx --pid_file=@var{file}
235
236 Upon startup the process identifier of the daemon is written to a file,
237 typically in @file{/var/run}. This file can be used by the init system
238 to implement commands such as @command{@dots{}/init.d/zebra status},
239 @command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra
240 stop}.
241
242 The file name is an run-time option rather than a configure-time option
243 so that multiple routing daemons can be run simultaneously. This is
244 useful when using Quagga to implement a routing looking glass. One
245 machine can be used to collect differing routing views from differing
246 points in the network.
247
248 @item -A @var{address}
249 @itemx --vty_addr=@var{address}
250 Set the VTY local address to bind to. If set, the VTY socket will only
251 be bound to this address.
252
253 @item -P @var{port}
254 @itemx --vty_port=@var{port}
255 Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
256 be opened.
257
258 @item -u @var{user}
259 @itemx --vty_addr=@var{user}
260 Set the user and group to run as.
261
262 @item -v
263 @itemx --version
264 Print program version.
265
266 @end table
267
268
269
270 @node Virtual Terminal Interfaces, , Common Invocation Options, Basic commands
271 @comment node-name, next, previous, up
272 @section Virtual Terminal Interfaces
273
274 VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
275 interface (CLI) for user interaction with the routing daemon.
276
277 @menu
278 * VTY Overview:: Basics about VTYs
279 * VTY Modes:: View, Enable, and Other VTY modes
280 * VTY CLI Commands:: Commands for movement, edition, and management
281 @end menu
282
283
284
285 @node VTY Overview, VTY Modes, Virtual Terminal Interfaces, Virtual Terminal Interfaces
286 @comment node-name, next, previous, up
287 @subsection VTY Overview
288
289
290 VTY stands for Virtual TeletYpe interface. It means you can connect to
291 the daemon via the telnet protocol.
292
293 To enable a VTY interface, you have to setup a VTY password. If there
294 is no VTY password, one cannot connect to the VTY interface at all.
295
296 @example
297 @group
298 % telnet localhost 2601
299 Trying 127.0.0.1...
300 Connected to localhost.
301 Escape character is '^]'.
302
303 Hello, this is zebra (version @value{VERSION})
304 Copyright 1997-2000 Kunihiro Ishiguro
305
306
307 User Access Verification
308
309 Password: XXXXX
310 Router> ?
311 enable Turn on privileged commands
312 exit Exit current mode and down to previous mode
313 help Description of the interactive help system
314 list Print command list
315 show Show running system information
316 who Display who is on a vty
317 Router> enable
318 Password: XXXXX
319 Router# configure terminal
320 Router(config)# interface eth0
321 Router(config-if)# ip address 10.0.0.1/8
322 Router(config-if)# ^Z
323 Router#
324 @end group
325 @end example
326
327 '?' is very useful for looking up commands.
328
329
330
331 @node VTY Modes, VTY CLI Commands, VTY Overview, Virtual Terminal Interfaces
332 @comment node-name, next, previous, up
333 @subsection VTY Modes
334
335
336 There are three basic VTY modes:
337
338 @menu
339 * VTY View Mode:: Mode for read-only interaction
340 * VTY Enable Mode:: Mode for read-write interaction
341 * VTY Other Modes:: Special modes (tftp, etc)
342 @end menu
343
344 There are commands that may be restricted to specific VTY modes.
345
346
347
348 @node VTY View Mode, VTY Enable Mode, VTY Modes, VTY Modes
349 @comment node-name, next, previous, up
350 @subsubsection VTY View Mode
351 @c to be written (gpoul)
352
353
354 This mode is for read-only access to the CLI. One may exit the mode by
355 leaving the system, or by entering @code{enable} mode.
356
357
358
359 @node VTY Enable Mode, VTY Other Modes, VTY View Mode, VTY Modes
360 @comment node-name, next, previous, up
361 @subsubsection VTY Enable Mode
362
363
364 @c to be written (gpoul)
365 This mode is for read-write access to the CLI. One may exit the mode by
366 leaving the system, or by escaping to view mode.
367
368
369
370 @node VTY Other Modes, , VTY Enable Mode, VTY Modes
371 @comment node-name, next, previous, up
372 @subsubsection VTY Other Modes
373
374
375 @c to be written (gpoul)
376 This page is for describing other modes.
377
378 @node VTY CLI Commands, , VTY Modes, Virtual Terminal Interfaces
379 @comment node-name, next, previous, up
380 @subsection VTY CLI Commands
381
382
383 Commands that you may use at the command-line are described in the following three subsubsections.
384
385 @menu
386 * CLI Movement Commands:: Commands for moving the cursor about
387 * CLI Editing Commands:: Commands for changing text
388 * CLI Advanced Commands:: Other commands, session management and so on
389 @end menu
390
391
392
393 @node CLI Movement Commands, CLI Editing Commands, VTY CLI Commands, VTY CLI Commands
394 @comment node-name, next, previous, up
395 @subsubsection CLI Movement Commands
396
397
398 These commands are used for moving the CLI cursor. The @key{C} character
399 means press the Control Key.
400
401 @table @kbd
402
403 @item C-f
404 @itemx @key{RIGHT}
405 @kindex C-f
406 @kindex @key{RIGHT}
407 Move forward one character.
408
409 @item C-b
410 @itemx @key{LEFT}
411 @kindex C-b
412 @kindex @key{LEFT}
413 Move backward one character.
414
415 @item M-f
416 @kindex M-f
417 Move forward one word.
418
419 @item M-b
420 @kindex M-b
421 Move backward one word.
422
423 @item C-a
424 @kindex C-a
425 Move to the beginning of the line.
426
427 @item C-e
428 @kindex C-e
429 Move to the end of the line.
430
431 @end table
432
433
434
435 @node CLI Editing Commands, CLI Advanced Commands, CLI Movement Commands, VTY CLI Commands
436 @comment node-name, next, previous, up
437 @subsubsection CLI Editing Commands
438
439
440 These commands are used for editing text on a line. The @key{C}
441 character means press the Control Key.
442
443 @table @kbd
444
445 @item C-h
446 @itemx @key{DEL}
447 @kindex C-h
448 @kindex @key{DEL}
449 Delete the character before point.
450
451 @item C-d
452 @kindex C-d
453 Delete the character after point.
454
455 @item M-d
456 @kindex M-d
457 Forward kill word.
458
459 @item C-w
460 @kindex C-w
461 Backward kill word.
462
463 @item C-k
464 @kindex C-k
465 Kill to the end of the line.
466
467 @item C-u
468 @kindex C-u
469 Kill line from the beginning, erasing input.
470
471 @item C-t
472 @kindex C-t
473 Transpose character.
474
475 @end table
476
477
478
479 @node CLI Advanced Commands, , CLI Editing Commands, VTY CLI Commands
480 @comment node-name, next, previous, up
481 @subsubsection CLI Advanced Commands
482
483
484 There are several additional CLI commands for command line completions,
485 insta-help, and VTY session management.
486
487 @table @kbd
488
489 @item C-c
490 @kindex C-c
491 Interrupt current input and moves to the next line.
492
493 @item C-z
494 @kindex C-z
495 End current configuration session and move to top node.
496
497
498 @item C-n
499 @itemx @key{DOWN}
500 @kindex C-n
501 @kindex @key{DOWN}
502 Move down to next line in the history buffer.
503
504 @item C-p
505 @itemx @key{UP}
506 @kindex C-p
507 @kindex @key{UP}
508 Move up to previous line in the history buffer.
509
510 @item TAB
511 @kindex @key{TAB}
512 Use command line completion by typing @key{TAB}.
513
514 @item
515 @kindex ?
516 You can use command line help by typing @code{help} at the beginning of
517 the line. Typing @kbd{?} at any point in the line will show possible
518 completions.
519
520 @end table