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