blob: ce1b94378222cc000acd004f3c9f3cae90489fa0 [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
paul971a4492003-06-20 01:18:07 +0000248@item -A @var{address}
249@itemx --vty_addr=@var{address}
250Set the VTY local address to bind to. If set, the VTY socket will only
251be bound to this address.
252
paul718e3742002-12-13 20:15:29 +0000253@item -P @var{port}
254@itemx --vty_port=@var{port}
paul971a4492003-06-20 01:18:07 +0000255Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
256be opened.
257
258@item -u @var{user}
259@itemx --vty_addr=@var{user}
260Set the user and group to run as.
paul718e3742002-12-13 20:15:29 +0000261
262@item -v
263@itemx --version
264Print 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
274VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
275interface (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
290VTY stands for Virtual TeletYpe interface. It means you can connect to
291the daemon via the telnet protocol.
292
293To enable a VTY interface, you have to setup a VTY password. If there
294is no VTY password, one cannot connect to the VTY interface at all.
295
296@example
297@group
298% telnet localhost 2601
299Trying 127.0.0.1...
300Connected to localhost.
301Escape character is '^]'.
302
303Hello, this is zebra (version @value{VERSION})
304Copyright 1997-2000 Kunihiro Ishiguro
305
306
307User Access Verification
308
309Password: XXXXX
310Router> ?
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
317Router> enable
318Password: XXXXX
319Router# configure terminal
320Router(config)# interface eth0
321Router(config-if)# ip address 10.0.0.1/8
322Router(config-if)# ^Z
323Router#
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
336There 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
344There 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
354This mode is for read-only access to the CLI. One may exit the mode by
355leaving 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)
365This mode is for read-write access to the CLI. One may exit the mode by
366leaving 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)
376This 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
383Commands 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
398These commands are used for moving the CLI cursor. The @key{C} character
399means 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}
407Move forward one character.
408
409@item C-b
410@itemx @key{LEFT}
411@kindex C-b
412@kindex @key{LEFT}
413Move backward one character.
414
415@item M-f
416@kindex M-f
417Move forward one word.
418
419@item M-b
420@kindex M-b
421Move backward one word.
422
423@item C-a
424@kindex C-a
425Move to the beginning of the line.
426
427@item C-e
428@kindex C-e
429Move 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
440These commands are used for editing text on a line. The @key{C}
441character 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}
449Delete the character before point.
450
451@item C-d
452@kindex C-d
453Delete the character after point.
454
455@item M-d
456@kindex M-d
457Forward kill word.
458
459@item C-w
460@kindex C-w
461Backward kill word.
462
463@item C-k
464@kindex C-k
465Kill to the end of the line.
466
467@item C-u
468@kindex C-u
469Kill line from the beginning, erasing input.
470
471@item C-t
472@kindex C-t
473Transpose 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
484There are several additional CLI commands for command line completions,
485insta-help, and VTY session management.
486
487@table @kbd
488
489@item C-c
490@kindex C-c
491Interrupt current input and moves to the next line.
492
493@item C-z
494@kindex C-z
495End 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}
502Move 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}
508Move up to previous line in the history buffer.
509
510@item TAB
511@kindex @key{TAB}
512Use command line completion by typing @key{TAB}.
513
514@item
515@kindex ?
516You can use command line help by typing @code{help} at the beginning of
517the line. Typing @kbd{?} at any point in the line will show possible
518completions.
519
520@end table