Merge branch 'Teaman-ND' into Teaman-RT
[tomato.git] / release / src / router / zebra / doc / basic.texi
blob8812b78ce011d9e5880b14d1af19a346326a2cc5
1 @node Basic commands
2 @comment  node-name,  next,  previous,  up
3 @chapter Basic commands
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:
10 @itemize @bullet
11 @item @command{ripd}, @command{ripngd}, @command{ospfd}, @command{ospf6d}, @command{bgpd}
12 @item @command{zebra}
13 @end itemize
15 The following sections discuss commands common to all the routing
16 daemons.
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
26 @node Config Commands, Common Invocation Options, Basic commands, Basic commands
27 @comment  node-name,  next,  previous,  up
28 @section Config Commands
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
37 @menu
38 * Basic Config Commands::       Some of the generic config commands
39 * Sample Config File::          An example config file
40 @end menu
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.
48 Config files are generally found in:
50 @itemize @asis
51 @item @file{@value{INSTALL_PREFIX_ETC}/*.conf}
52 @end itemize
54 Each of the daemons has its own
55 config file.  For example, zebra's default config file name is:
57 @itemize @asis
58 @item @file{@value{INSTALL_PREFIX_ETC}/zebra.conf}
59 @end itemize
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.
67 @node Basic Config Commands, Sample Config File, Config Commands, Config Commands
68 @comment  node-name,  next,  previous,  up
69 @subsection Basic Config Commands
71 @deffn Command {hostname @var{hostname}} {}
72 Set hostname of the router.
73 @end deffn
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
80 @deffn Command {enable password @var{password}} {}
81 Set enable password.
82 @end deffn
84 @deffn Command {log stdout} {}
85 @deffnx Command {no log stdout} {}
86 Set logging output to stdout.
87 @end deffn
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
97 @deffn Command {log syslog} {}
98 @deffnx Command {no log syslog} {}
99 Set logging output to syslog.
100 @end deffn
102 @deffn Command {write terminal} {}
103 Displays the current configuration to the vty interface.
104 @end deffn
106 @deffn Command {write file} {}
107 Write current configuration to configuration file.
108 @end deffn
110 @deffn Command {configure terminal} {}
111 Change to configuration mode.  This command is the first step to
112 configuration.
113 @end deffn
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
120 @deffn Command {who} {}
121 @end deffn
123 @deffn Command {list} {}
124 List commands.
125 @end deffn
127 @deffn Command {service password-encryption} {}
128 Encrypt password.
129 @end deffn
131 @deffn Command {service advanced-vty} {}
132 Enable advanced mode VTY.
133 @end deffn
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
140 @deffn Command {show version} {}
141 Show the current version of the Zebra and its build host information.
142 @end deffn
144 @deffn Command {line vty} {}
145 Enter vty configuration mode.
146 @end deffn
148 @deffn Command {banner motd default} {}
149 Set default motd string.
150 @end deffn
152 @deffn Command {no banner motd} {}
153 No motd banner string will be printed.
154 @end deffn
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
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
169 @deffn {Line Command} {access-class @var{access-list}} {}
170 Restrict vty connections with an access list.
171 @end deffn
175 @node   Sample Config File,  , Basic Config Commands, Config Commands
176 @comment  node-name,  next,  previous,  up
177 @subsection Sample Config File
180 Below is a sample configuration file for the zebra daemon.
182 @example
183 @group
185 ! Zebra configuration file
187 hostname Router
188 password zebra
189 enable password zebra
191 log stdout
194 @end group
195 @end example
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.
201 @example
202 password zebra!password
203 @end example
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'.
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
217 These options apply to all Zebra daemons.
219 @table @samp
221 @item -d
222 @itemx --daemon
223 Runs in daemon mode.
225 @item -f @var{file}
226 @itemx --config_file=@var{file}
227 Set configuration file name.
229 @item -h
230 @itemx --help
231 Display this help and exit.
233 @item -i @var{file}
234 @itemx --pid_file=@var{file}
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}.
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 Zebra to implement a routing looking glass.  One
245 machine can be used to collect differing routing views from differing
246 points in the network.
248 @item -P @var{port}
249 @itemx --vty_port=@var{port}
250 Set the VTY port number.
252 @item -v
253 @itemx --version
254 Print program version.
256 @end table
260 @node  Virtual Terminal Interfaces,  , Common Invocation Options, Basic commands
261 @comment  node-name,  next,  previous,  up
262 @section Virtual Terminal Interfaces
264 VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
265 interface (CLI) for user interaction with the routing daemon.
267 @menu
268 * VTY Overview::                Basics about VTYs                
269 * VTY Modes::                   View, Enable, and Other VTY modes
270 * VTY CLI Commands::            Commands for movement, edition, and management
271 @end menu
275 @node  VTY Overview, VTY Modes, Virtual Terminal Interfaces, Virtual Terminal Interfaces
276 @comment  node-name,  next,  previous,  up
277 @subsection VTY Overview
280 VTY stands for Virtual TeletYpe interface.  It means you can connect to
281 the daemon via the telnet protocol.
283 To enable a VTY interface, you have to setup a VTY password.  If there
284 is no VTY password, one cannot connect to the VTY interface at all.
286 @example
287 @group
288 % telnet localhost 2601
289 Trying 127.0.0.1...
290 Connected to localhost.
291 Escape character is '^]'.
293 Hello, this is zebra (version @value{VERSION})
294 Copyright 1997-2000 Kunihiro Ishiguro
297 User Access Verification
299 Password: XXXXX
300 Router> ?
301   enable            Turn on privileged commands
302   exit              Exit current mode and down to previous mode
303   help              Description of the interactive help system
304   list              Print command list
305   show              Show running system information
306   who               Display who is on a vty
307 Router> enable
308 Password: XXXXX
309 Router# configure terminal
310 Router(config)# interface eth0
311 Router(config-if)# ip address 10.0.0.1/8
312 Router(config-if)# ^Z
313 Router#
314 @end group
315 @end example
317 '?' is very useful for looking up commands.
321 @node  VTY Modes, VTY CLI Commands, VTY Overview, Virtual Terminal Interfaces
322 @comment  node-name,  next,  previous,  up
323 @subsection VTY Modes
326 There are three basic VTY modes:
328 @menu
329 * VTY View Mode::               Mode for read-only interaction               
330 * VTY Enable Mode::             Mode for read-write interaction
331 * VTY Other Modes::             Special modes (tftp, etc)
332 @end menu
334 There are commands that may be restricted to specific VTY modes. 
338 @node VTY View Mode, VTY Enable Mode, VTY Modes, VTY Modes
339 @comment  node-name,  next,  previous,  up
340 @subsubsection VTY View Mode
341 @c to be written (gpoul)
344 This mode is for read-only access to the CLI. One may exit the mode by
345 leaving the system, or by entering @code{enable} mode.
349 @node VTY Enable Mode, VTY Other Modes, VTY View Mode, VTY Modes
350 @comment  node-name,  next,  previous,  up
351 @subsubsection VTY Enable Mode
354 @c to be written (gpoul)
355 This mode is for read-write access to the CLI. One may exit the mode by
356 leaving the system, or by escaping to view mode.
360 @node VTY Other Modes,  , VTY Enable Mode, VTY Modes
361 @comment  node-name,  next,  previous,  up
362 @subsubsection VTY Other Modes
365 @c to be written (gpoul)
366 This page is for describing other modes.
368 @node VTY CLI Commands,  , VTY Modes, Virtual Terminal Interfaces
369 @comment  node-name,  next,  previous,  up
370 @subsection VTY CLI Commands
373 Commands that you may use at the command-line are described in the following three subsubsections.
375 @menu
376 * CLI Movement Commands::       Commands for moving the cursor about
377 * CLI Editing Commands::        Commands for changing text
378 * CLI Advanced Commands::       Other commands, session management and so on
379 @end menu
383 @node CLI Movement Commands, CLI Editing Commands, VTY CLI Commands, VTY CLI Commands
384 @comment  node-name,  next,  previous,  up
385 @subsubsection CLI Movement Commands
388 These commands are used for moving the CLI cursor. The @key{C} character
389 means press the Control Key.
391 @table @kbd
393 @item C-f
394 @itemx @key{RIGHT}
395 @kindex C-f
396 @kindex @key{RIGHT}
397 Move forward one character.
399 @item C-b
400 @itemx @key{LEFT}
401 @kindex C-b
402 @kindex @key{LEFT}
403 Move backward one character.
405 @item M-f
406 @kindex M-f
407 Move forward one word.
409 @item M-b
410 @kindex M-b
411 Move backward one word.
413 @item C-a
414 @kindex C-a
415 Move to the beginning of the line.
417 @item C-e
418 @kindex C-e
419 Move to the end of the line.
421 @end table
425 @node CLI Editing Commands, CLI Advanced Commands, CLI Movement Commands, VTY CLI Commands
426 @comment  node-name,  next,  previous,  up
427 @subsubsection CLI Editing Commands
430 These commands are used for editing text on a line. The @key{C}
431 character means press the Control Key.
433 @table @kbd
435 @item C-h
436 @itemx @key{DEL}
437 @kindex C-h
438 @kindex @key{DEL}
439 Delete the character before point.
441 @item C-d
442 @kindex C-d
443 Delete the character after point.
445 @item M-d
446 @kindex M-d
447 Forward kill word.
449 @item C-w
450 @kindex C-w
451 Backward kill word.
453 @item C-k
454 @kindex C-k
455 Kill to the end of the line.
457 @item C-u
458 @kindex C-u
459 Kill line from the beginning, erasing input.
461 @item C-t
462 @kindex C-t
463 Transpose character.
465 @end table
469 @node CLI Advanced Commands,  , CLI Editing Commands, VTY CLI Commands
470 @comment  node-name,  next,  previous,  up
471 @subsubsection CLI Advanced Commands
474 There are several additional CLI commands for command line completions,
475 insta-help, and VTY session management.
477 @table @kbd
479 @item C-c
480 @kindex C-c
481 Interrupt current input and moves to the next line.
483 @item C-z
484 @kindex C-z
485 End current configuration session and move to top node.
488 @item C-n
489 @itemx @key{DOWN}
490 @kindex C-n
491 @kindex @key{DOWN}
492 Move down to next line in the history buffer.
494 @item C-p
495 @itemx @key{UP}
496 @kindex C-p
497 @kindex @key{UP}
498 Move up to previous line in the history buffer.
500 @item TAB
501 @kindex @key{TAB}
502 Use command line completion by typing @key{TAB}.
504 @item
505 @kindex ?
506 You can use command line help by typing @code{help} at the beginning of
507 the line.  Typing @kbd{?} at any point in the line will show possible
508 completions.
510 @end table