]> git.proxmox.com Git - mirror_frr.git/blame - doc/user/basic.rst
Merge pull request #3286 from donaldsharp/late_registration
[mirror_frr.git] / doc / user / basic.rst
CommitLineData
0efdf0fe 1.. _basic-commands:
42fc5d26
QY
2
3**************
db910447 4Basic Commands
42fc5d26
QY
5**************
6
2da6ccc3 7The following sections discuss commands common to all the routing daemons.
42fc5d26 8
0efdf0fe 9.. _config-commands:
42fc5d26
QY
10
11Config Commands
12===============
13
14.. index:: Configuration files for running the software
15
16.. index:: Files for running configurations
17
18.. index:: Modifying the herd's behavior
19
20.. index:: Getting the herd running
21
22In a config file, you can write the debugging options, a vty's password,
2da6ccc3
QY
23routing daemon configurations, a log file name, and so forth. This information
24forms the initial command set for a routing beast as it is starting.
42fc5d26 25
dc5564c7 26Config files are generally found in |INSTALL_PREFIX_ETC|.
42fc5d26 27
d1a242fd
QY
28Each of the daemons has its own config file. The daemon name plus ``.conf`` is
29the default config file name. For example, zebra's default config file name is
30:file:`zebra.conf`. You can specify a config file using the :option:`-f` or
9eb95b3b 31:option:`--config_file` options when starting the daemon.
42fc5d26 32
0efdf0fe 33.. _basic-config-commands:
42fc5d26
QY
34
35Basic Config Commands
36---------------------
37
8d209861 38.. index:: hostname HOSTNAME
29adcd50
QY
39.. clicmd:: hostname HOSTNAME
40
41 Set hostname of the router.
42fc5d26 42
322e2d5c
PM
43.. index::
44 single: no password PASSWORD
45 single: password PASSWORD
42fc5d26 46
322e2d5c 47.. clicmd:: [no] password PASSWORD
29adcd50 48
322e2d5c
PM
49 Set password for vty interface. The ``no`` form of the command deletes the
50 password. If there is no password, a vty won't accept connections.
42fc5d26 51
322e2d5c
PM
52.. index::
53 single: no enable password PASSWORD
54 single: enable password PASSWORD
42fc5d26 55
322e2d5c 56.. clicmd:: [no] enable password PASSWORD
29adcd50 57
322e2d5c
PM
58 Set enable password. The ``no`` form of the command deletes the enable
59 password.
42fc5d26 60
8d209861 61.. index::
d1a242fd
QY
62 single: no log trap [LEVEL]
63 single: log trap LEVEL
29adcd50
QY
64
65.. clicmd:: [no] log trap LEVEL
66
67 These commands are deprecated and are present only for historical
68 compatibility. The log trap command sets the current logging level for all
69 enabled logging destinations, and it sets the default for all future logging
70 commands that do not specify a level. The normal default logging level is
2da6ccc3
QY
71 debugging. The ``no`` form of the command resets the default level for
72 future logging commands to debugging, but it does not change the logging
73 level of existing logging destinations.
8d209861
QY
74
75.. index::
d1a242fd
QY
76 single: no log stdout [LEVEL]
77 single: log stdout [LEVEL]
29adcd50
QY
78
79.. clicmd:: [no] log stdout LEVEL
80
81 Enable logging output to stdout. If the optional second argument specifying
82 the logging level is not present, the default logging level (typically
2da6ccc3
QY
83 debugging) will be used. The ``no`` form of the command disables logging to
84 stdout. The ``LEVEL`` argument must have one of these values: emergencies,
85 alerts, critical, errors, warnings, notifications, informational, or
86 debugging. Note that the existing code logs its most important messages with
87 severity ``errors``.
8d209861
QY
88
89.. index::
d1a242fd
QY
90 single: no log file [FILENAME [LEVEL]]
91 single: log file FILENAME [LEVEL]
29adcd50
QY
92
93.. clicmd:: [no] log file [FILENAME [LEVEL]]
8d209861 94
29adcd50 95 If you want to log into a file, please specify ``filename`` as
2da6ccc3 96 in this example:
8d209861 97
2da6ccc3
QY
98 ::
99
100 log file /var/log/frr/bgpd.log informational
8d209861 101
29adcd50
QY
102 If the optional second argument specifying the logging level is not present,
103 the default logging level (typically debugging, but can be changed using the
104 deprecated ``log trap`` command) will be used. The ``no`` form of the command
2da6ccc3
QY
105 disables logging to a file.
106
107 .. note::
108
109 If you do not configure any file logging, and a daemon crashes due to a
110 signal or an assertion failure, it will attempt to save the crash
111 information in a file named :file:`/var/tmp/frr.<daemon name>.crashlog`.
112 For security reasons, this will not happen if the file exists already, so
113 it is important to delete the file after reporting the crash information.
8d209861
QY
114
115.. index::
d1a242fd
QY
116 single: no log syslog [LEVEL]
117 single: log syslog [LEVEL]
29adcd50
QY
118
119.. clicmd:: [no] log syslog [LEVEL]
8d209861 120
29adcd50
QY
121 Enable logging output to syslog. If the optional second argument specifying
122 the logging level is not present, the default logging level (typically
123 debugging, but can be changed using the deprecated ``log trap`` command) will
124 be used. The ``no`` form of the command disables logging to syslog.
8d209861
QY
125
126.. index::
d1a242fd
QY
127 single: no log monitor [LEVEL]
128 single: log monitor [LEVEL]
29adcd50
QY
129
130.. clicmd:: [no] log monitor [LEVEL]
131
132 Enable logging output to vty terminals that have enabled logging using the
133 ``terminal monitor`` command. By default, monitor logging is enabled at the
2da6ccc3
QY
134 debugging level, but this command (or the deprecated ``log trap`` command)
135 can be used to change the monitor logging level. If the optional second
136 argument specifying the logging level is not present, the default logging
137 level (typically debugging) will be used. The ``no`` form of the command
138 disables logging to terminal monitors.
8d209861
QY
139
140.. index::
d1a242fd
QY
141 single: no log facility [FACILITY]
142 single: log facility [FACILITY]
8d209861 143
29adcd50
QY
144.. clicmd:: [no] log facility [FACILITY]
145
146 This command changes the facility used in syslog messages. The default
2da6ccc3
QY
147 facility is ``daemon``. The ``no`` form of the command resets the facility
148 to the default ``daemon`` facility.
8d209861
QY
149
150.. index::
d1a242fd
QY
151 single: no log record-priority
152 single: log record-priority
29adcd50
QY
153
154.. clicmd:: [no] log record-priority
155
156 To include the severity in all messages logged to a file, to stdout, or to
157 a terminal monitor (i.e. anything except syslog),
158 use the ``log record-priority`` global configuration command.
159 To disable this option, use the ``no`` form of the command. By default,
160 the severity level is not included in logged messages. Note: some
161 versions of syslogd (including Solaris) can be configured to include
162 the facility and level in the messages emitted.
8d209861
QY
163
164.. index::
d1a242fd
QY
165 single: log timestamp precision (0-6)
166 single: [no] log timestamp precision (0-6)
8d209861 167
29adcd50
QY
168.. clicmd:: [no] log timestamp precision [(0-6)]
169
2da6ccc3
QY
170 This command sets the precision of log message timestamps to the given
171 number of digits after the decimal point. Currently, the value must be in
172 the range 0 to 6 (i.e. the maximum precision is microseconds). To restore
173 the default behavior (1-second accuracy), use the ``no`` form of the
174 command, or set the precision explicitly to 0.
42fc5d26 175
2da6ccc3 176 ::
42fc5d26 177
2da6ccc3 178 log timestamp precision 3
42fc5d26 179
29adcd50
QY
180 In this example, the precision is set to provide timestamps with
181 millisecond accuracy.
42fc5d26 182
8d209861 183.. index:: log commands
29adcd50
QY
184.. clicmd:: log commands
185
2da6ccc3
QY
186 This command enables the logging of all commands typed by a user to all
187 enabled log destinations. The note that logging includes full command lines,
188 including passwords. Once set, command logging can only be turned off by
189 restarting the daemon.
42fc5d26 190
8d209861 191.. index:: service password-encryption
29adcd50
QY
192.. clicmd:: service password-encryption
193
194 Encrypt password.
42fc5d26 195
8d209861 196.. index:: service advanced-vty
29adcd50 197.. clicmd:: service advanced-vty
42fc5d26 198
29adcd50 199 Enable advanced mode VTY.
42fc5d26 200
29adcd50 201.. index:: service terminal-length (0-512)
29adcd50
QY
202.. clicmd:: service terminal-length (0-512)
203
2da6ccc3
QY
204 Set system wide line configuration. This configuration command applies to
205 all VTY interfaces.
42fc5d26 206
8d209861 207.. index:: line vty
29adcd50
QY
208.. clicmd:: line vty
209
210 Enter vty configuration mode.
42fc5d26 211
8d209861 212.. index:: banner motd default
29adcd50
QY
213.. clicmd:: banner motd default
214
215 Set default motd string.
42fc5d26 216
8d209861 217.. index:: no banner motd
29adcd50
QY
218.. clicmd:: no banner motd
219
220 No motd banner string will be printed.
42fc5d26 221
8d209861 222.. index:: exec-timeout MINUTE [SECOND]
29adcd50
QY
223.. clicmd:: exec-timeout MINUTE [SECOND]
224
225 Set VTY connection timeout value. When only one argument is specified
226 it is used for timeout value in minutes. Optional second argument is
227 used for timeout value in seconds. Default timeout value is 10 minutes.
228 When timeout value is zero, it means no timeout.
42fc5d26 229
8d209861 230.. index:: no exec-timeout
29adcd50
QY
231.. clicmd:: no exec-timeout
232
2da6ccc3
QY
233 Do not perform timeout at all. This command is as same as
234 ``exec-timeout 0 0``.
42fc5d26 235
8d209861 236.. index:: access-class ACCESS-LIST
29adcd50
QY
237.. clicmd:: access-class ACCESS-LIST
238
239 Restrict vty connections with an access list.
42fc5d26 240
2da6ccc3 241
0efdf0fe 242.. _sample-config-file:
42fc5d26
QY
243
244Sample Config File
245------------------
246
247Below is a sample configuration file for the zebra daemon.
248
9eb95b3b 249.. code-block:: frr
42fc5d26 250
9eb95b3b
QY
251 !
252 ! Zebra configuration file
253 !
254 hostname Router
255 password zebra
256 enable password zebra
257 !
258 log stdout
259 !
260 !
42fc5d26 261
8d209861 262
2da6ccc3
QY
263``!`` and ``#`` are comment characters. If the first character of the word is
264one of the comment characters then from the rest of the line forward will be
265ignored as a comment.
42fc5d26 266
9eb95b3b 267.. code-block:: frr
42fc5d26 268
9eb95b3b 269 password zebra!password
42fc5d26 270
2da6ccc3
QY
271If a comment character is not the first character of the word, it's a normal
272character. So in the above example ``!`` will not be regarded as a comment and
273the password is set to ``zebra!password``.
42fc5d26 274
0efdf0fe 275.. _terminal-mode-commands:
42fc5d26
QY
276
277Terminal Mode Commands
278======================
279
8d209861 280.. index:: write terminal
29adcd50
QY
281.. clicmd:: write terminal
282
d1a242fd 283 Displays the current configuration to the vty interface.
42fc5d26 284
8d209861 285.. index:: write file
29adcd50
QY
286.. clicmd:: write file
287
d1a242fd 288 Write current configuration to configuration file.
42fc5d26 289
8d209861 290.. index:: configure terminal
29adcd50
QY
291.. clicmd:: configure terminal
292
d1a242fd
QY
293 Change to configuration mode. This command is the first step to
294 configuration.
42fc5d26 295
29adcd50 296.. index:: terminal length (0-512)
29adcd50
QY
297.. clicmd:: terminal length (0-512)
298
2da6ccc3
QY
299 Set terminal display length to ``(0-512)``. If length is 0, no display
300 control is performed.
42fc5d26 301
8d209861 302.. index:: who
29adcd50
QY
303.. clicmd:: who
304
d1a242fd 305 Show a list of currently connected vty sessions.
42fc5d26 306
8d209861 307.. index:: list
29adcd50
QY
308.. clicmd:: list
309
d1a242fd 310 List all available commands.
42fc5d26 311
8d209861 312.. index:: show version
29adcd50
QY
313.. clicmd:: show version
314
d1a242fd 315 Show the current version of |PACKAGE_NAME| and its build host information.
42fc5d26 316
8d209861 317.. index:: show logging
29adcd50
QY
318.. clicmd:: show logging
319
2da6ccc3
QY
320 Shows the current configuration of the logging system. This includes the
321 status of all logging destinations.
42fc5d26 322
0a62b873
DL
323.. index:: show memory
324.. clicmd:: show memory
325
326 Show information on how much memory is used for which specific things in
327 |PACKAGE_NAME|. Output may vary depending on system capabilities but will
328 generally look something like this:
329
330 ::
331
332 frr# show memory
333 System allocator statistics:
334 Total heap allocated: 1584 KiB
335 Holding block headers: 0 bytes
336 Used small blocks: 0 bytes
337 Used ordinary blocks: 1484 KiB
338 Free small blocks: 2096 bytes
339 Free ordinary blocks: 100 KiB
340 Ordinary blocks: 2
341 Small blocks: 60
342 Holding blocks: 0
343 (see system documentation for 'mallinfo' for meaning)
344 --- qmem libfrr ---
345 Buffer : 3 24 72
346 Buffer data : 1 4120 4120
347 Host config : 3 (variably sized) 72
348 Command Tokens : 3427 72 247160
349 Command Token Text : 2555 (variably sized) 83720
350 Command Token Help : 2555 (variably sized) 61720
351 Command Argument : 2 (variably sized) 48
352 Command Argument Name : 641 (variably sized) 15672
353 [...]
354 --- qmem Label Manager ---
355 --- qmem zebra ---
356 ZEBRA VRF : 1 912 920
357 Route Entry : 11 80 968
358 Static route : 1 192 200
359 RIB destination : 8 48 448
360 RIB table info : 4 16 96
361 Nexthop tracking object : 1 200 200
362 Zebra Name Space : 1 312 312
363 --- qmem Table Manager ---
364
365 To understand system allocator statistics, refer to your system's
366 :manpage:`mallinfo(3)` man page.
367
368 Below these statistics, statistics on individual memory allocation types
369 in |PACKAGE_NAME| (so-called `MTYPEs`) is printed:
370
371 * the first column of numbers is the current count of allocations made for
372 the type (the number decreases when items are freed.)
373 * the second column is the size of each item. This is only available if
374 allocations on a type are always made with the same size.
375 * the third column is the total amount of memory allocated for the
376 particular type, including padding applied by malloc. This means that
377 the number may be larger than the first column multiplied by the second.
378 Overhead incurred by malloc's bookkeeping is not included in this, and
379 the column may be missing if system support is not available.
380
381 When executing this command from ``vtysh``, each of the daemons' memory
382 usage is printed sequentially.
383
8d209861 384.. index:: logmsg LEVEL MESSAGE
29adcd50
QY
385.. clicmd:: logmsg LEVEL MESSAGE
386
2da6ccc3
QY
387 Send a message to all logging destinations that are enabled for messages of
388 the given severity.
389
8421b140
QY
390.. index:: find COMMAND...
391.. clicmd:: find COMMAND...
392
393 This commmand performs a simple substring search across all defined commands
394 in all modes. As an example, suppose you're in enable mode and can't
395 remember where the command to turn OSPF segment routing on is:
396
397 ::
398
399 frr# find segment-routing on
400 (ospf) segment-routing on
401
402 The CLI mode is displayed next to each command. In this example,
403 :clicmd:`segment-routing on` is under the `router ospf` mode.
404
405 Similarly, suppose you want a listing of all commands that contain "l2vpn":
406
407 ::
408
409 frr# find l2vpn
410 (view) show [ip] bgp l2vpn evpn [json]
411 (view) show [ip] bgp l2vpn evpn all <A.B.C.D|A.B.C.D/M> [json]
412 (view) show [ip] bgp l2vpn evpn all neighbors A.B.C.D advertised-routes [json]
413 (view) show [ip] bgp l2vpn evpn all neighbors A.B.C.D routes [json]
414 (view) show [ip] bgp l2vpn evpn all overlay
415 ...
416
42fc5d26 417
0efdf0fe 418.. _common-invocation-options:
42fc5d26
QY
419
420Common Invocation Options
421=========================
422
be46d288 423These options apply to all |PACKAGE_NAME| daemons.
42fc5d26
QY
424
425
c9365894 426.. option:: -d, --daemon
42fc5d26 427
d1a242fd 428 Run in daemon mode.
29adcd50 429
c9365894 430.. option:: -f, --config_file <file>
42fc5d26 431
d1a242fd 432 Set configuration file name.
42fc5d26 433
d1a242fd 434.. option:: -h, --help
42fc5d26 435
d1a242fd 436 Display this help and exit.
29adcd50 437
c9365894 438.. option:: -i, --pid_file <file>
42fc5d26 439
d1a242fd
QY
440 Upon startup the process identifier of the daemon is written to a file,
441 typically in :file:`/var/run`. This file can be used by the init system
442 to implement commands such as ``.../init.d/zebra status``,
443 ``.../init.d/zebra restart`` or ``.../init.d/zebra stop``.
42fc5d26 444
2da6ccc3
QY
445 The file name is an run-time option rather than a configure-time option so
446 that multiple routing daemons can be run simultaneously. This is useful when
447 using |PACKAGE_NAME| to implement a routing looking glass. One machine can
448 be used to collect differing routing views from differing points in the
449 network.
29adcd50 450
c9365894 451.. option:: -A, --vty_addr <address>
42fc5d26 452
2da6ccc3
QY
453 Set the VTY local address to bind to. If set, the VTY socket will only be
454 bound to this address.
42fc5d26 455
c9365894 456.. option:: -P, --vty_port <port>
29adcd50 457
d1a242fd
QY
458 Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not
459 be opened.
42fc5d26 460
d1a242fd 461.. option:: -u <user>
42fc5d26 462
d1a242fd 463 Set the user and group to run as.
29adcd50 464
c9365894 465.. option:: -v, --version
42fc5d26 466
d1a242fd 467 Print program version.
42fc5d26 468
ed74ddf4
DS
469.. option:: --log <stdout|syslog|file:/path/to/log/file>
470
471 When initializing the daemon, setup the log to go to either stdout,
472 syslog or to a file. These values will be displayed as part of
473 a show run. Additionally they can be overridden at runtime if
474 desired via the normal log commands.
475
3cf3e018
DS
476.. option:: --log-level <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>
477
478 When initializing the daemon, allow the specification of a default
479 log level at startup from one of the specified levels.
480
1c2facd1
RW
481.. option:: --tcli
482
483 Enable the transactional CLI mode.
484
0efdf0fe 485.. _loadable-module-support:
42fc5d26
QY
486
487Loadable Module Support
488=======================
489
8d209861
QY
490FRR supports loading extension modules at startup. Loading, reloading or
491unloading modules at runtime is not supported (yet). To load a module, use
42fc5d26
QY
492the following command line option at daemon startup:
493
494
c9365894 495.. option:: -M, --module <module:options>
29adcd50 496
d1a242fd
QY
497 Load the specified module, optionally passing options to it. If the module
498 name contains a slash (/), it is assumed to be a full pathname to a file to
499 be loaded. If it does not contain a slash, the |INSTALL_PREFIX_MODULES|
500 directory is searched for a module of the given name; first with the daemon
501 name prepended (e.g. ``zebra_mod`` for ``mod``), then without the daemon
502 name prepended.
42fc5d26 503
d1a242fd
QY
504 This option is available on all daemons, though some daemons may not have
505 any modules available to be loaded.
42fc5d26 506
2da6ccc3 507
42fc5d26
QY
508The SNMP Module
509---------------
510
511If SNMP is enabled during compile-time and installed as part of the package,
2da6ccc3 512the ``snmp`` module can be loaded for the *Zebra*, *bgpd*, *ospfd*, *ospf6d*
8d209861 513and *ripd* daemons.
42fc5d26 514
2da6ccc3
QY
515The module ignores any options passed to it. Refer to :ref:`snmp-support` for
516information on its usage.
517
42fc5d26
QY
518
519The FPM Module
520--------------
521
d1a242fd
QY
522If FPM is enabled during compile-time and installed as part of the package, the
523``fpm`` module can be loaded for the *zebra* daemon. This provides the
524Forwarding Plane Manager ("FPM") API.
42fc5d26 525
d1e7591e
QY
526The module expects its argument to be either ``Netlink`` or ``protobuf``,
527specifying the encapsulation to use. ``Netlink`` is the default, and
d1a242fd 528``protobuf`` may not be available if the module was built without protobuf
0efdf0fe 529support. Refer to :ref:`zebra-fib-push-interface` for more information.
42fc5d26 530
2da6ccc3 531
0efdf0fe 532.. _virtual-terminal-interfaces:
42fc5d26
QY
533
534Virtual Terminal Interfaces
535===========================
536
537VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line
538interface (CLI) for user interaction with the routing daemon.
539
2da6ccc3 540
0efdf0fe 541.. _vty-overview:
42fc5d26
QY
542
543VTY Overview
544------------
545
8d209861 546VTY stands for Virtual TeletYpe interface. It means you can connect to
42fc5d26
QY
547the daemon via the telnet protocol.
548
8d209861 549To enable a VTY interface, you have to setup a VTY password. If there
42fc5d26
QY
550is no VTY password, one cannot connect to the VTY interface at all.
551
552::
553
9eb95b3b
QY
554 % telnet localhost 2601
555 Trying 127.0.0.1...
556 Connected to localhost.
557 Escape character is '^]'.
42fc5d26 558
9eb95b3b
QY
559 Hello, this is |PACKAGE_NAME| (version |PACKAGE_VERSION|)
560 |COPYRIGHT_STR|
42fc5d26 561
9eb95b3b 562 User Access Verification
42fc5d26 563
9eb95b3b
QY
564 Password: XXXXX
565 Router> ?
566 enable . . . Turn on privileged commands
567 exit . . . Exit current mode and down to previous mode
568 help . . . Description of the interactive help system
569 list . . . Print command list
570 show . . . Show system inform
8d209861 571
9eb95b3b
QY
572 wh. . . Display who is on a vty
573 Router> enable
574 Password: XXXXX
575 Router# configure terminal
576 Router(config)# interface eth0
577 Router(config-if)# ip address 10.0.0.1/8
578 Router(config-if)# ^Z
579 Router#
42fc5d26 580
8d209861 581
0efdf0fe 582.. _vty-modes:
42fc5d26
QY
583
584VTY Modes
585---------
586
587There are three basic VTY modes:
588
589There are commands that may be restricted to specific VTY modes.
590
0efdf0fe 591.. _vty-view-mode:
42fc5d26
QY
592
593VTY View Mode
594^^^^^^^^^^^^^
595
596This mode is for read-only access to the CLI. One may exit the mode by
597leaving the system, or by entering `enable` mode.
598
0efdf0fe 599.. _vty-enable-mode:
42fc5d26
QY
600
601VTY Enable Mode
602^^^^^^^^^^^^^^^
603
604This mode is for read-write access to the CLI. One may exit the mode by
605leaving the system, or by escaping to view mode.
606
0efdf0fe 607.. _vty-other-modes:
42fc5d26
QY
608
609VTY Other Modes
610^^^^^^^^^^^^^^^
611
612This page is for describing other modes.
613
0efdf0fe 614.. _vty-cli-commands:
42fc5d26
QY
615
616VTY CLI Commands
617----------------
618
619Commands that you may use at the command-line are described in the following
620three subsubsections.
621
0efdf0fe 622.. _cli-movement-commands:
42fc5d26
QY
623
624CLI Movement Commands
625^^^^^^^^^^^^^^^^^^^^^
626
627These commands are used for moving the CLI cursor. The :kbd:`C` character
628means press the Control Key.
629
8d209861 630:kbd:`C-f` / :kbd:`LEFT`
9eb95b3b 631 Move forward one character.
42fc5d26 632
8d209861 633:kbd:`C-b` / :kbd:`RIGHT`
9eb95b3b 634 Move backward one character.
42fc5d26 635
8d209861 636:kbd:`M-f`
9eb95b3b 637 Move forward one word.
42fc5d26 638
8d209861 639:kbd:`M-b`
9eb95b3b 640 Move backward one word.
42fc5d26 641
8d209861 642:kbd:`C-a`
9eb95b3b 643 Move to the beginning of the line.
42fc5d26 644
8d209861 645:kbd:`C-e`
9eb95b3b 646 Move to the end of the line.
42fc5d26
QY
647
648
0efdf0fe 649.. _cli-editing-commands:
42fc5d26
QY
650
651CLI Editing Commands
652^^^^^^^^^^^^^^^^^^^^
653
654These commands are used for editing text on a line. The :kbd:`C`
655character means press the Control Key.
656
657
8d209861 658:kbd:`C-h` / :kbd:`DEL`
9eb95b3b 659 Delete the character before point.
42fc5d26
QY
660
661
8d209861 662:kbd:`C-d`
9eb95b3b 663 Delete the character after point.
42fc5d26
QY
664
665
8d209861 666:kbd:`M-d`
9eb95b3b 667 Forward kill word.
42fc5d26
QY
668
669
8d209861 670:kbd:`C-w`
9eb95b3b 671 Backward kill word.
42fc5d26
QY
672
673
8d209861 674:kbd:`C-k`
9eb95b3b 675 Kill to the end of the line.
42fc5d26
QY
676
677
8d209861 678:kbd:`C-u`
9eb95b3b 679 Kill line from the beginning, erasing input.
42fc5d26
QY
680
681
8d209861 682:kbd:`C-t`
9eb95b3b 683 Transpose character.
42fc5d26
QY
684
685
686CLI Advanced Commands
687^^^^^^^^^^^^^^^^^^^^^
688
689There are several additional CLI commands for command line completions,
690insta-help, and VTY session management.
691
692
8d209861 693:kbd:`C-c`
9eb95b3b 694 Interrupt current input and moves to the next line.
42fc5d26
QY
695
696
8d209861 697:kbd:`C-z`
9eb95b3b 698 End current configuration session and move to top node.
42fc5d26
QY
699
700
8d209861 701:kbd:`C-n` / :kbd:`DOWN`
9eb95b3b 702 Move down to next line in the history buffer.
42fc5d26
QY
703
704
8d209861 705:kbd:`C-p` / :kbd:`UP`
9eb95b3b 706 Move up to previous line in the history buffer.
42fc5d26
QY
707
708
8d209861 709:kbd:`TAB`
9eb95b3b 710 Use command line completion by typing :kbd:`TAB`.
42fc5d26
QY
711
712
8d209861 713:kbd:`?`
9eb95b3b
QY
714 You can use command line help by typing ``help`` at the beginning of the
715 line. Typing :kbd:`?` at any point in the line will show possible
716 completions.
42fc5d26 717
4c54343f
QY
718Pipe Actions
719^^^^^^^^^^^^
720
721VTY supports optional modifiers at the end of commands that perform
722postprocessing on command output or modify the action of commands. These do not
723show up in the :kbd:`?` or :kbd:`TAB` suggestion lists.
724
725``... | include REGEX``
726 Filters the output of the preceding command, including only lines which
727 match the POSIX Extended Regular Expression ``REGEX``. Do not put the regex
728 in quotes.
729
730 Examples:
731
732 ::
733
734 frr# show ip bgp sum json | include remoteAs
735 "remoteAs":0,
736 "remoteAs":455,
737 "remoteAs":99,
738
739 ::
740
741 frr# show run | include neigh.*[0-9]{2}\.0\.[2-4]\.[0-9]*
742 neighbor 10.0.2.106 remote-as 99
743 neighbor 10.0.2.107 remote-as 99
744 neighbor 10.0.2.108 remote-as 99
745 neighbor 10.0.2.109 remote-as 99
746 neighbor 10.0.2.110 remote-as 99
747 neighbor 10.0.3.111 remote-as 111
748