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