paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | @node Basic commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 2 | @chapter Basic commands |
| 3 | |
| 4 | There are five routing daemons in use, and there is one manager daemon. |
| 5 | These daemons may be located on separate machines from the manager |
| 6 | daemon. Each of these daemons will listen on a particular port for |
| 7 | incoming 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 | |
| 14 | The following sections discuss commands common to all the routing |
| 15 | daemons. |
| 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 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 25 | @node Config Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 26 | @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 | |
| 41 | In a config file, you can write the debugging options, a vty's password, |
| 42 | routing daemon configurations, a log file name, and so forth. This |
| 43 | information forms the initial command set for a routing beast as it is |
| 44 | starting. |
| 45 | |
| 46 | Config files are generally found in: |
| 47 | |
| 48 | @itemize @asis |
| 49 | @item @file{@value{INSTALL_PREFIX_ETC}/*.conf} |
| 50 | @end itemize |
| 51 | |
| 52 | Each of the daemons has its own |
| 53 | config 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 | |
| 59 | The daemon name plus @file{.conf} is the default config file name. You |
| 60 | can specify a config file using the @kbd{-f} or @kbd{--config-file} |
| 61 | options when starting the daemon. |
| 62 | |
| 63 | |
| 64 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 65 | @node Basic Config Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 66 | @subsection Basic Config Commands |
| 67 | |
| 68 | @deffn Command {hostname @var{hostname}} {} |
| 69 | Set hostname of the router. |
| 70 | @end deffn |
| 71 | |
| 72 | @deffn Command {password @var{password}} {} |
| 73 | Set password for vty interface. If there is no password, a vty won't |
| 74 | accept connections. |
| 75 | @end deffn |
| 76 | |
| 77 | @deffn Command {enable password @var{password}} {} |
| 78 | Set enable password. |
| 79 | @end deffn |
| 80 | |
| 81 | @deffn Command {log stdout} {} |
| 82 | @deffnx Command {no log stdout} {} |
| 83 | Set logging output to stdout. |
| 84 | @end deffn |
| 85 | |
| 86 | @deffn Command {log file @var{filename}} {} |
| 87 | If you want to log into a file please specify @code{filename} as |
| 88 | follows. |
| 89 | @example |
| 90 | log file /usr/local/etc/bgpd.log |
| 91 | @end example |
| 92 | @end deffn |
| 93 | |
| 94 | @deffn Command {log syslog} {} |
| 95 | @deffnx Command {no log syslog} {} |
| 96 | Set logging output to syslog. |
| 97 | @end deffn |
| 98 | |
| 99 | @deffn Command {write terminal} {} |
| 100 | Displays the current configuration to the vty interface. |
| 101 | @end deffn |
| 102 | |
| 103 | @deffn Command {write file} {} |
| 104 | Write current configuration to configuration file. |
| 105 | @end deffn |
| 106 | |
| 107 | @deffn Command {configure terminal} {} |
| 108 | Change to configuration mode. This command is the first step to |
| 109 | configuration. |
| 110 | @end deffn |
| 111 | |
| 112 | @deffn Command {terminal length @var{<0-512>}} {} |
| 113 | Set terminal display length to @var{<0-512>}. If length is 0, no |
| 114 | display control is performed. |
| 115 | @end deffn |
| 116 | |
| 117 | @deffn Command {who} {} |
| 118 | @end deffn |
| 119 | |
| 120 | @deffn Command {list} {} |
| 121 | List commands. |
| 122 | @end deffn |
| 123 | |
| 124 | @deffn Command {service password-encryption} {} |
| 125 | Encrypt password. |
| 126 | @end deffn |
| 127 | |
| 128 | @deffn Command {service advanced-vty} {} |
| 129 | Enable advanced mode VTY. |
| 130 | @end deffn |
| 131 | |
| 132 | @deffn Command {service terminal-length @var{<0-512>}} {} |
| 133 | Set system wide line configuration. This configuration command applies |
| 134 | to all VTY interfaces. |
| 135 | @end deffn |
| 136 | |
| 137 | @deffn Command {show version} {} |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 138 | Show the current version of @value{PACKAGE_NAME} and its build host information. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 139 | @end deffn |
| 140 | |
| 141 | @deffn Command {line vty} {} |
| 142 | Enter vty configuration mode. |
| 143 | @end deffn |
| 144 | |
| 145 | @deffn Command {banner motd default} {} |
| 146 | Set default motd string. |
| 147 | @end deffn |
| 148 | |
| 149 | @deffn Command {no banner motd} {} |
| 150 | No 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}} {} |
| 155 | Set VTY connection timeout value. When only one argument is specified |
| 156 | it is used for timeout value in minutes. Optional second argument is |
| 157 | used for timeout value in seconds. Default timeout value is 10 minutes. |
| 158 | When timeout value is zero, it means no timeout. |
| 159 | @end deffn |
| 160 | |
| 161 | @deffn {Line Command} {no exec-timeout} {} |
| 162 | Do 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}} {} |
| 167 | Restrict vty connections with an access list. |
| 168 | @end deffn |
| 169 | |
| 170 | |
| 171 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 172 | @node Sample Config File |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 173 | @subsection Sample Config File |
| 174 | |
| 175 | |
| 176 | Below is a sample configuration file for the zebra daemon. |
| 177 | |
| 178 | @example |
| 179 | @group |
| 180 | ! |
| 181 | ! Zebra configuration file |
| 182 | ! |
| 183 | hostname Router |
| 184 | password zebra |
| 185 | enable password zebra |
| 186 | ! |
| 187 | log stdout |
| 188 | ! |
| 189 | ! |
| 190 | @end group |
| 191 | @end example |
| 192 | |
| 193 | '!' and '#' are comment characters. If the first character of the word |
| 194 | is one of the comment characters then from the rest of the line forward |
| 195 | will be ignored as a comment. |
| 196 | |
| 197 | @example |
| 198 | password zebra!password |
| 199 | @end example |
| 200 | |
| 201 | If a comment character is not the first character of the word, it's a |
| 202 | normal character. So in the above example '!' will not be regarded as a |
| 203 | comment and the password is set to 'zebra!password'. |
| 204 | |
| 205 | |
| 206 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 207 | @node Common Invocation Options |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 208 | @section Common Invocation Options |
| 209 | @c COMMON_OPTIONS |
| 210 | @c OPTIONS section of the man page |
| 211 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 212 | These options apply to all @value{PACKAGE_NAME} daemons. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 213 | |
| 214 | @table @samp |
| 215 | |
| 216 | @item -d |
| 217 | @itemx --daemon |
| 218 | Runs in daemon mode. |
| 219 | |
| 220 | @item -f @var{file} |
| 221 | @itemx --config_file=@var{file} |
| 222 | Set configuration file name. |
| 223 | |
| 224 | @item -h |
| 225 | @itemx --help |
| 226 | Display this help and exit. |
| 227 | |
| 228 | @item -i @var{file} |
| 229 | @itemx --pid_file=@var{file} |
| 230 | |
| 231 | Upon startup the process identifier of the daemon is written to a file, |
| 232 | typically in @file{/var/run}. This file can be used by the init system |
| 233 | to implement commands such as @command{@dots{}/init.d/zebra status}, |
| 234 | @command{@dots{}/init.d/zebra restart} or @command{@dots{}/init.d/zebra |
| 235 | stop}. |
| 236 | |
| 237 | The file name is an run-time option rather than a configure-time option |
| 238 | so that multiple routing daemons can be run simultaneously. This is |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 239 | useful when using @value{PACKAGE_NAME} to implement a routing looking glass. One |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 240 | machine can be used to collect differing routing views from differing |
| 241 | points in the network. |
| 242 | |
paul | 971a449 | 2003-06-20 01:18:07 +0000 | [diff] [blame] | 243 | @item -A @var{address} |
| 244 | @itemx --vty_addr=@var{address} |
| 245 | Set the VTY local address to bind to. If set, the VTY socket will only |
| 246 | be bound to this address. |
| 247 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 248 | @item -P @var{port} |
| 249 | @itemx --vty_port=@var{port} |
paul | 971a449 | 2003-06-20 01:18:07 +0000 | [diff] [blame] | 250 | Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not |
| 251 | be opened. |
| 252 | |
| 253 | @item -u @var{user} |
| 254 | @itemx --vty_addr=@var{user} |
| 255 | Set the user and group to run as. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 256 | |
| 257 | @item -v |
| 258 | @itemx --version |
| 259 | Print program version. |
| 260 | |
| 261 | @end table |
| 262 | |
| 263 | |
| 264 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 265 | @node Virtual Terminal Interfaces |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 266 | @section Virtual Terminal Interfaces |
| 267 | |
| 268 | VTY -- Virtual Terminal [aka TeletYpe] Interface is a command line |
| 269 | interface (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 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 279 | @node VTY Overview |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 280 | @subsection VTY Overview |
| 281 | |
| 282 | |
| 283 | VTY stands for Virtual TeletYpe interface. It means you can connect to |
| 284 | the daemon via the telnet protocol. |
| 285 | |
| 286 | To enable a VTY interface, you have to setup a VTY password. If there |
| 287 | is no VTY password, one cannot connect to the VTY interface at all. |
| 288 | |
| 289 | @example |
| 290 | @group |
| 291 | % telnet localhost 2601 |
| 292 | Trying 127.0.0.1... |
| 293 | Connected to localhost. |
| 294 | Escape character is '^]'. |
| 295 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 296 | Hello, this is @value{PACKAGE_NAME} (version @value{VERSION}) |
| 297 | @value{COPYRIGHT_STR} |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 298 | |
| 299 | User Access Verification |
| 300 | |
| 301 | Password: XXXXX |
| 302 | Router> ? |
| 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 |
| 309 | Router> enable |
| 310 | Password: XXXXX |
| 311 | Router# configure terminal |
| 312 | Router(config)# interface eth0 |
| 313 | Router(config-if)# ip address 10.0.0.1/8 |
| 314 | Router(config-if)# ^Z |
| 315 | Router# |
| 316 | @end group |
| 317 | @end example |
| 318 | |
| 319 | '?' is very useful for looking up commands. |
| 320 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 321 | @node VTY Modes |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 322 | @subsection VTY Modes |
| 323 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 324 | There 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 | |
| 332 | There are commands that may be restricted to specific VTY modes. |
| 333 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 334 | @node VTY View Mode |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 335 | @subsubsection VTY View Mode |
| 336 | @c to be written (gpoul) |
| 337 | |
| 338 | |
| 339 | This mode is for read-only access to the CLI. One may exit the mode by |
| 340 | leaving the system, or by entering @code{enable} mode. |
| 341 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 342 | @node VTY Enable Mode |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 343 | @subsubsection VTY Enable Mode |
| 344 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 345 | @c to be written (gpoul) |
| 346 | This mode is for read-write access to the CLI. One may exit the mode by |
| 347 | leaving the system, or by escaping to view mode. |
| 348 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 349 | @node VTY Other Modes |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 350 | @subsubsection VTY Other Modes |
| 351 | |
| 352 | |
| 353 | @c to be written (gpoul) |
| 354 | This page is for describing other modes. |
| 355 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 356 | @node VTY CLI Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 357 | @subsection VTY CLI Commands |
| 358 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 359 | Commands that you may use at the command-line are described in the following |
| 360 | three subsubsections. |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 361 | |
| 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 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 368 | @node CLI Movement Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 369 | @subsubsection CLI Movement Commands |
| 370 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 371 | These commands are used for moving the CLI cursor. The @key{C} character |
| 372 | means 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} |
| 380 | Move forward one character. |
| 381 | |
| 382 | @item C-b |
| 383 | @itemx @key{LEFT} |
| 384 | @kindex C-b |
| 385 | @kindex @key{LEFT} |
| 386 | Move backward one character. |
| 387 | |
| 388 | @item M-f |
| 389 | @kindex M-f |
| 390 | Move forward one word. |
| 391 | |
| 392 | @item M-b |
| 393 | @kindex M-b |
| 394 | Move backward one word. |
| 395 | |
| 396 | @item C-a |
| 397 | @kindex C-a |
| 398 | Move to the beginning of the line. |
| 399 | |
| 400 | @item C-e |
| 401 | @kindex C-e |
| 402 | Move to the end of the line. |
| 403 | |
| 404 | @end table |
| 405 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 406 | @node CLI Editing Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 407 | @subsubsection CLI Editing Commands |
| 408 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 409 | These commands are used for editing text on a line. The @key{C} |
| 410 | character 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} |
| 418 | Delete the character before point. |
| 419 | |
| 420 | @item C-d |
| 421 | @kindex C-d |
| 422 | Delete the character after point. |
| 423 | |
| 424 | @item M-d |
| 425 | @kindex M-d |
| 426 | Forward kill word. |
| 427 | |
| 428 | @item C-w |
| 429 | @kindex C-w |
| 430 | Backward kill word. |
| 431 | |
| 432 | @item C-k |
| 433 | @kindex C-k |
| 434 | Kill to the end of the line. |
| 435 | |
| 436 | @item C-u |
| 437 | @kindex C-u |
| 438 | Kill line from the beginning, erasing input. |
| 439 | |
| 440 | @item C-t |
| 441 | @kindex C-t |
| 442 | Transpose character. |
| 443 | |
| 444 | @end table |
| 445 | |
paul | 76b89b4 | 2004-11-06 17:13:09 +0000 | [diff] [blame] | 446 | @node CLI Advanced Commands |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 447 | @subsubsection CLI Advanced Commands |
| 448 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 449 | There are several additional CLI commands for command line completions, |
| 450 | insta-help, and VTY session management. |
| 451 | |
| 452 | @table @kbd |
| 453 | |
| 454 | @item C-c |
| 455 | @kindex C-c |
| 456 | Interrupt current input and moves to the next line. |
| 457 | |
| 458 | @item C-z |
| 459 | @kindex C-z |
| 460 | End 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} |
| 467 | Move 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} |
| 473 | Move up to previous line in the history buffer. |
| 474 | |
| 475 | @item TAB |
| 476 | @kindex @key{TAB} |
| 477 | Use command line completion by typing @key{TAB}. |
| 478 | |
| 479 | @item |
| 480 | @kindex ? |
| 481 | You can use command line help by typing @code{help} at the beginning of |
| 482 | the line. Typing @kbd{?} at any point in the line will show possible |
| 483 | completions. |
| 484 | |
| 485 | @end table |