]> git.proxmox.com Git - mirror_frr.git/blame - doc/basic.texi
ospf6d: Intra-prefix LSA update after frr restart
[mirror_frr.git] / doc / basic.texi
CommitLineData
718e3744 1@node Basic commands
718e3744 2@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
77817120 19* Terminal Mode Commands:: Common commands used in a VTY
718e3744 20* Common Invocation Options:: Starting the daemons
6b0275ac 21* Loadable Module Support:: Using extension modules
274a4a44 22* Virtual Terminal Interfaces:: Interacting with the daemons
718e3744 23@end menu
24
25
26
76b89b4a 27@node Config Commands
718e3744 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
a20a4060 50@itemize @w{}
718e3744 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
a20a4060 57@itemize @w{}
718e3744 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
76b89b4a 67@node Basic Config Commands
718e3744 68@subsection Basic Config Commands
69
70@deffn Command {hostname @var{hostname}} {}
71Set hostname of the router.
72@end deffn
73
74@deffn Command {password @var{password}} {}
75Set password for vty interface. If there is no password, a vty won't
76accept connections.
77@end deffn
78
79@deffn Command {enable password @var{password}} {}
80Set enable password.
81@end deffn
82
274a4a44 83@deffn Command {log trap @var{level}} {}
84@deffnx Command {no log trap} {}
85These commands are deprecated and are present only for historical compatibility.
86The log trap command sets the current logging level for all enabled
87logging destinations, and it sets the default for all future logging commands
88that do not specify a level. The normal default
89logging level is debugging. The @code{no} form of the command resets
90the default level for future logging commands to debugging, but it does
91not change the logging level of existing logging destinations.
92@end deffn
93
94
718e3744 95@deffn Command {log stdout} {}
274a4a44 96@deffnx Command {log stdout @var{level}} {}
718e3744 97@deffnx Command {no log stdout} {}
274a4a44 98Enable logging output to stdout.
99If the optional second argument specifying the
100logging level is not present, the default logging level (typically debugging,
101but can be changed using the deprecated @code{log trap} command) will be used.
102The @code{no} form of the command disables logging to stdout.
103The @code{level} argument must have one of these values:
104emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging. Note that the existing code logs its most important messages
105with severity @code{errors}.
718e3744 106@end deffn
107
108@deffn Command {log file @var{filename}} {}
274a4a44 109@deffnx Command {log file @var{filename} @var{level}} {}
110@deffnx Command {no log file} {}
111If you want to log into a file, please specify @code{filename} as
112in this example:
718e3744 113@example
438f5286 114log file /var/log/frr/bgpd.log informational
718e3744 115@end example
274a4a44 116If the optional second argument specifying the
117logging level is not present, the default logging level (typically debugging,
118but can be changed using the deprecated @code{log trap} command) will be used.
119The @code{no} form of the command disables logging to a file.
c70257d0 120
121Note: if you do not configure any file logging, and a daemon crashes due
122to a signal or an assertion failure, it will attempt to save the crash
438f5286 123information in a file named /var/tmp/frr.<daemon name>.crashlog.
c70257d0 124For security reasons, this will not happen if the file exists already, so
125it is important to delete the file after reporting the crash information.
718e3744 126@end deffn
127
128@deffn Command {log syslog} {}
274a4a44 129@deffnx Command {log syslog @var{level}} {}
718e3744 130@deffnx Command {no log syslog} {}
274a4a44 131Enable logging output to syslog.
132If the optional second argument specifying the
133logging level is not present, the default logging level (typically debugging,
134but can be changed using the deprecated @code{log trap} command) will be used.
135The @code{no} form of the command disables logging to syslog.
718e3744 136@end deffn
137
274a4a44 138@deffn Command {log monitor} {}
139@deffnx Command {log monitor @var{level}} {}
140@deffnx Command {no log monitor} {}
141Enable logging output to vty terminals that have enabled logging
142using the @code{terminal monitor} command.
143By default, monitor logging is enabled at the debugging level, but this
144command (or the deprecated @code{log trap} command) can be used to change
145the monitor logging level.
146If the optional second argument specifying the
147logging level is not present, the default logging level (typically debugging,
148but can be changed using the deprecated @code{log trap} command) will be used.
149The @code{no} form of the command disables logging to terminal monitors.
718e3744 150@end deffn
151
274a4a44 152@deffn Command {log facility @var{facility}} {}
153@deffnx Command {no log facility} {}
154This command changes the facility used in syslog messages. The default
155facility is @code{daemon}. The @code{no} form of the command resets
156the facility to the default @code{daemon} facility.
718e3744 157@end deffn
158
274a4a44 159@deffn Command {log record-priority} {}
160@deffnx Command {no log record-priority} {}
161To include the severity in all messages logged to a file, to stdout, or to
162a terminal monitor (i.e. anything except syslog),
163use the @code{log record-priority} global configuration command.
164To disable this option, use the @code{no} form of the command. By default,
165the severity level is not included in logged messages. Note: some
166versions of syslogd (including Solaris) can be configured to include
167the facility and level in the messages emitted.
718e3744 168@end deffn
169
d3d7e237
AS
170@deffn Command {log timestamp precision @var{<0-6>}} {}
171@deffnx Command {no log timestamp precision} {}
172This command sets the precision of log message timestamps to the
173given number of digits after the decimal point. Currently,
174the value must be in the range 0 to 6 (i.e. the maximum precision
175is microseconds).
176To restore the default behavior (1-second accuracy), use the
177@code{no} form of the command, or set the precision explicitly to 0.
178
179@example
180@group
181log timestamp precision 3
182@end group
183@end example
184
185In this example, the precision is set to provide timestamps with
186millisecond accuracy.
187@end deffn
188
da688ecd
LB
189@deffn Command {log commands} {}
190This command enables the logging of all commands typed by a user to
191all enabled log destinations. The note that logging includes full
192command lines, including passwords. Once set, command logging can only
193be turned off by restarting the daemon.
194@end deffn
195
718e3744 196@deffn Command {service password-encryption} {}
197Encrypt password.
198@end deffn
199
200@deffn Command {service advanced-vty} {}
201Enable advanced mode VTY.
202@end deffn
203
204@deffn Command {service terminal-length @var{<0-512>}} {}
205Set system wide line configuration. This configuration command applies
206to all VTY interfaces.
207@end deffn
208
718e3744 209@deffn Command {line vty} {}
210Enter vty configuration mode.
211@end deffn
212
213@deffn Command {banner motd default} {}
214Set default motd string.
215@end deffn
216
217@deffn Command {no banner motd} {}
218No motd banner string will be printed.
219@end deffn
220
221@deffn {Line Command} {exec-timeout @var{minute}} {}
222@deffnx {Line Command} {exec-timeout @var{minute} @var{second}} {}
223Set VTY connection timeout value. When only one argument is specified
224it is used for timeout value in minutes. Optional second argument is
225used for timeout value in seconds. Default timeout value is 10 minutes.
226When timeout value is zero, it means no timeout.
227@end deffn
228
229@deffn {Line Command} {no exec-timeout} {}
230Do not perform timeout at all. This command is as same as
231@command{exec-timeout 0 0}.
232@end deffn
233
234@deffn {Line Command} {access-class @var{access-list}} {}
235Restrict vty connections with an access list.
236@end deffn
237
76b89b4a 238@node Sample Config File
718e3744 239@subsection Sample Config File
240
241
242Below is a sample configuration file for the zebra daemon.
243
244@example
245@group
246!
247! Zebra configuration file
248!
249hostname Router
250password zebra
251enable password zebra
252!
253log stdout
254!
255!
256@end group
257@end example
258
259'!' and '#' are comment characters. If the first character of the word
260is one of the comment characters then from the rest of the line forward
261will be ignored as a comment.
262
263@example
264password zebra!password
265@end example
266
267If a comment character is not the first character of the word, it's a
268normal character. So in the above example '!' will not be regarded as a
269comment and the password is set to 'zebra!password'.
270
271
272
274a4a44 273@node Terminal Mode Commands
274@section Terminal Mode Commands
275
276@deffn Command {write terminal} {}
277Displays the current configuration to the vty interface.
278@end deffn
279
280@deffn Command {write file} {}
281Write current configuration to configuration file.
282@end deffn
283
284@deffn Command {configure terminal} {}
285Change to configuration mode. This command is the first step to
286configuration.
287@end deffn
288
289@deffn Command {terminal length @var{<0-512>}} {}
290Set terminal display length to @var{<0-512>}. If length is 0, no
291display control is performed.
292@end deffn
293
294@deffn Command {who} {}
295Show a list of currently connected vty sessions.
296@end deffn
297
298@deffn Command {list} {}
299List all available commands.
300@end deffn
301
302@deffn Command {show version} {}
303Show the current version of @value{PACKAGE_NAME} and its build host information.
304@end deffn
305
306@deffn Command {show logging} {}
307Shows the current configuration of the logging system. This includes
308the status of all logging destinations.
309@end deffn
310
311@deffn Command {logmsg @var{level} @var{message}} {}
312Send a message to all logging destinations that are enabled for messages
313of the given severity.
314@end deffn
315
316
317
318
76b89b4a 319@node Common Invocation Options
718e3744 320@section Common Invocation Options
321@c COMMON_OPTIONS
322@c OPTIONS section of the man page
323
76b89b4a 324These options apply to all @value{PACKAGE_NAME} daemons.
718e3744 325
326@table @samp
327
328@item -d
329@itemx --daemon
330Runs in daemon mode.
331
332@item -f @var{file}
333@itemx --config_file=@var{file}
334Set configuration file name.
335
336@item -h
337@itemx --help
338Display this help and exit.
339
340@item -i @var{file}
341@itemx --pid_file=@var{file}
342
343Upon startup the process identifier of the daemon is written to a file,
344typically in @file{/var/run}. This file can be used by the init system
345to implement commands such as @command{@dots{}/init.d/zebra status},
346@command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra
347stop}.
348
349The file name is an run-time option rather than a configure-time option
350so that multiple routing daemons can be run simultaneously. This is
76b89b4a 351useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One
718e3744 352machine can be used to collect differing routing views from differing
353points in the network.
354
971a4497 355@item -A @var{address}
356@itemx --vty_addr=@var{address}
357Set the VTY local address to bind to. If set, the VTY socket will only
358be bound to this address.
359
718e3744 360@item -P @var{port}
361@itemx --vty_port=@var{port}
971a4497 362Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
363be opened.
364
365@item -u @var{user}
366@itemx --vty_addr=@var{user}
367Set the user and group to run as.
718e3744 368
369@item -v
370@itemx --version
371Print program version.
372
373@end table
374
375
6b0275ac
DL
376@node Loadable Module Support
377@section Loadable Module Support
378
379FRR supports loading extension modules at startup. Loading, reloading or
380unloading modules at runtime is not supported (yet). To load a module, use
381the following command line option at daemon startup:
382
383@table @samp
384@item -M @var{module:options}
385@itemx --module @var{module:options}
386
387Load the specified module, optionally passing options to it. If the module
388name contains a slash (/), it is assumed to be a full pathname to a file to
389be loaded. If it does not contain a slash, the
390@code{@value{INSTALL_PREFIX_MODULES}} directory is searched for a module of
391the given name; first with the daemon name prepended (e.g. @code{zebra_mod}
392for @code{mod}), then without the daemon name prepended.
393
394This option is available on all daemons, though some daemons may not have
395any modules available to be loaded.
396@end table
397
398
399@subsection The SNMP Module
400
401If SNMP is enabled during compile-time and installed as part of the package,
402the @code{snmp} module can be loaded for the @command{zebra},
403@command{bgpd}, @command{ospfd}, @command{ospf6d} and @command{ripd} daemons.
404
405The module ignores any options passed to it. Refer to @ref{SNMP Support}
406for information on its usage.
407
408
409@subsection The FPM Module
410
411If FPM is enabled during compile-time and installed as part of the package,
412the @code{fpm} module can be loaded for the @command{zebra} daemon. This
413provides the Forwarding Plane Manager ("FPM") API.
414
415The module expects its argument to be either @code{netlink} or
416@code{protobuf}, specifying the encapsulation to use. @code{netlink} is the
417default, and @code{protobuf} may not be available if the module was built
418without protobuf support. Refer to @ref{zebra FIB push interface} for more
419information.
420
718e3744 421
76b89b4a 422@node Virtual Terminal Interfaces
718e3744 423@section Virtual Terminal Interfaces
424
425VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
426interface (CLI) for user interaction with the routing daemon.
427
428@menu
429* VTY Overview:: Basics about VTYs
430* VTY Modes:: View, Enable, and Other VTY modes
431* VTY CLI Commands:: Commands for movement, edition, and management
432@end menu
433
434
435
76b89b4a 436@node VTY Overview
718e3744 437@subsection VTY Overview
438
439
440VTY stands for Virtual TeletYpe interface. It means you can connect to
441the daemon via the telnet protocol.
442
443To enable a VTY interface, you have to setup a VTY password. If there
444is no VTY password, one cannot connect to the VTY interface at all.
445
446@example
447@group
448% telnet localhost 2601
449Trying 127.0.0.1...
450Connected to localhost.
451Escape character is '^]'.
452
34982989 453Hello, this is @value{PACKAGE_NAME} (version @value{PACKAGE_VERSION})
76b89b4a 454@value{COPYRIGHT_STR}
718e3744 455
456User Access Verification
457
458Password: XXXXX
459Router> ?
460 enable Turn on privileged commands
461 exit Exit current mode and down to previous mode
462 help Description of the interactive help system
463 list Print command list
464 show Show running system information
465 who Display who is on a vty
466Router> enable
467Password: XXXXX
468Router# configure terminal
469Router(config)# interface eth0
470Router(config-if)# ip address 10.0.0.1/8
471Router(config-if)# ^Z
472Router#
473@end group
474@end example
475
476'?' is very useful for looking up commands.
477
76b89b4a 478@node VTY Modes
718e3744 479@subsection VTY Modes
480
718e3744 481There are three basic VTY modes:
482
483@menu
484* VTY View Mode:: Mode for read-only interaction
485* VTY Enable Mode:: Mode for read-write interaction
486* VTY Other Modes:: Special modes (tftp, etc)
487@end menu
488
489There are commands that may be restricted to specific VTY modes.
490
76b89b4a 491@node VTY View Mode
718e3744 492@subsubsection VTY View Mode
493@c to be written (gpoul)
494
495
496This mode is for read-only access to the CLI. One may exit the mode by
497leaving the system, or by entering @code{enable} mode.
498
76b89b4a 499@node VTY Enable Mode
718e3744 500@subsubsection VTY Enable Mode
501
718e3744 502@c to be written (gpoul)
503This mode is for read-write access to the CLI. One may exit the mode by
504leaving the system, or by escaping to view mode.
505
76b89b4a 506@node VTY Other Modes
718e3744 507@subsubsection VTY Other Modes
508
509
510@c to be written (gpoul)
511This page is for describing other modes.
512
76b89b4a 513@node VTY CLI Commands
718e3744 514@subsection VTY CLI Commands
515
76b89b4a 516Commands that you may use at the command-line are described in the following
517three subsubsections.
718e3744 518
519@menu
520* CLI Movement Commands:: Commands for moving the cursor about
521* CLI Editing Commands:: Commands for changing text
522* CLI Advanced Commands:: Other commands, session management and so on
523@end menu
524
76b89b4a 525@node CLI Movement Commands
718e3744 526@subsubsection CLI Movement Commands
527
718e3744 528These commands are used for moving the CLI cursor. The @key{C} character
529means press the Control Key.
530
531@table @kbd
532
533@item C-f
534@itemx @key{RIGHT}
535@kindex C-f
536@kindex @key{RIGHT}
537Move forward one character.
538
539@item C-b
540@itemx @key{LEFT}
541@kindex C-b
542@kindex @key{LEFT}
543Move backward one character.
544
545@item M-f
546@kindex M-f
547Move forward one word.
548
549@item M-b
550@kindex M-b
551Move backward one word.
552
553@item C-a
554@kindex C-a
555Move to the beginning of the line.
556
557@item C-e
558@kindex C-e
559Move to the end of the line.
560
561@end table
562
76b89b4a 563@node CLI Editing Commands
718e3744 564@subsubsection CLI Editing Commands
565
718e3744 566These commands are used for editing text on a line. The @key{C}
567character means press the Control Key.
568
569@table @kbd
570
571@item C-h
572@itemx @key{DEL}
573@kindex C-h
574@kindex @key{DEL}
575Delete the character before point.
576
577@item C-d
578@kindex C-d
579Delete the character after point.
580
581@item M-d
582@kindex M-d
583Forward kill word.
584
585@item C-w
586@kindex C-w
587Backward kill word.
588
589@item C-k
590@kindex C-k
591Kill to the end of the line.
592
593@item C-u
594@kindex C-u
595Kill line from the beginning, erasing input.
596
597@item C-t
598@kindex C-t
599Transpose character.
600
601@end table
602
76b89b4a 603@node CLI Advanced Commands
718e3744 604@subsubsection CLI Advanced Commands
605
718e3744 606There are several additional CLI commands for command line completions,
607insta-help, and VTY session management.
608
609@table @kbd
610
611@item C-c
612@kindex C-c
613Interrupt current input and moves to the next line.
614
615@item C-z
616@kindex C-z
617End current configuration session and move to top node.
618
619
620@item C-n
621@itemx @key{DOWN}
622@kindex C-n
623@kindex @key{DOWN}
624Move down to next line in the history buffer.
625
626@item C-p
627@itemx @key{UP}
628@kindex C-p
629@kindex @key{UP}
630Move up to previous line in the history buffer.
631
632@item TAB
633@kindex @key{TAB}
634Use command line completion by typing @key{TAB}.
635
77817120
DL
636@item ?
637@kindex @key{?}
718e3744 638You can use command line help by typing @code{help} at the beginning of
639the line. Typing @kbd{?} at any point in the line will show possible
640completions.
641
642@end table