HOWTO+-+Quagga+Tutorial

Visit the following link for the full tutorial: []

The following info is on how to setup VTYSH for quagga.

 4. VTYSH

As indicated in the [|Quagga introduction], you can access the daemons by telnetting their port number because each daemon has its own configuration file and terminal interface.

ripd: ripng: ospfd: bgpd: ospf6d: ||  || 2601 2602 2603 2604 2605 2606 || By instance, to access the ospfd daemon:
 * zebra:

As it's not very practical to configure your router by telnetting its daemons separately, vtysh has been created to configure everything in one <span class="IL_AD" style="background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: #33cc00 !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; color: #33cc00 !important; cursor: pointer !important; display: inline !important; float: none !important; font-family: verdana,arial !important; font-size: 10px !important; font-style: normal !important; font-weight: normal !important; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static;">single interface.
 * **#telnet localhost 2604** ||

To use vtysh, you must first create its configuration file as follows:


 * **#cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf** ||

///etc/quagga/vtysh.conf ! ! Sample ! ! service integrated-vtysh-config hostname quagga-router username root nopassword !//

Apply correct permissions and restart Quagga:


 * **#chown quagga.quaggavty /etc/quagga/*.conf
 * 1) chmod 640 /etc/quagga/*.conf** ||

In the example above the "//service integrated-vtysh-config//" setting has been disabled (recommended). In this case, when you save the config under vtysh, it will be stored in separate files depending on the protocols you activated. Below, an example where the Quagga configuration is saved under vtysh. (The zebra and ospfd daemons have been enabled.)
 * **#/etc/init.d/quagga restart** ||


 * **#vtysh** ||

//Configuration saved to /etc/quagga/zebra.conf Configuration saved to /etc/quagga/ospfd.conf//
 * **quagga-router#write** ||

If you activate "//service integrated-vtysh-config//", the configuration under vtysh will be saved in one file called Quagga.conf in the /etc/quagga/ directory. With this setting, when you access a daemon via telnet, the daemon will look first to the Quagga.conf file before looking for its own file. This means that, when you telnet a device, there can be a difference between what you see after the "show run" command and the content of the associated file, for examplezebra.conf.


 * **#vtysh** ||

//Configuration saved to /etc/quagga/Quagga.conf//
 * **quagga-router#write** ||

It is recommended to disable "//service integrated-vtysh-config//" because if this setting is enabled and in case of a syntax error in the Quagga.conf file, this can lead to all your daemons being unable to <span class="IL_AD" style="background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: #33cc00 !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; color: #33cc00 !important; cursor: pointer !important; display: inline !important; float: none !important; font-family: verdana,arial !important; font-size: 10px !important; font-style: normal !important; font-weight: normal !important; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static;">start up. This will not be case when "//service integrated-vtysh-config//" is disabled because the configurations are stored in separate files.

Check that the default "//vtysh_enable=yes//" setting are configured in your /etc/quagga/debian.conf file. You can read the previous paragraph about the [|debian.conf] file to get more information.

Then it's useful to add the "//VTYSH_PAGER=more//" setting in your /etc/environment file, otherwise you will see an unfriendly "(END)" blinking in the left-down corner of the screen each time your enter a command and will need to press the "q" key to continue.

Log off and log on to enable <span class="IL_AD" style="background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat repeat !important; border-bottom-color: #33cc00 !important; border-bottom-style: dotted !important; border-bottom-width: 1px !important; color: #33cc00 !important; cursor: pointer !important; display: inline !important; float: none !important; font-family: verdana,arial !important; font-size: 10px !important; font-style: normal !important; font-weight: normal !important; padding-bottom: 1px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important; position: static;">the environment setting. You can now access the Quagga router with the vtysh command:
 * **#echo VTYSH_PAGER=more > /etc/environment** ||

//Hello, this is Quagga (version 0.99.6). Copyright 1996-2005 Kunihiro Ishiguro, et al.
 * **#vtysh** ||

quagga-router#//

If you want to run a Quagga command from the Linux shell:

For instance, vtysh -c "show ip route" will display the Quagga routing table.
 * **#vtysh -c "**command**"** ||

Ping and traceroute to perform connectivity checks from the vtysh prompt. Of course, these two programs need to be installed on the Linux machine. Ping is generally installed by default but traceroute often not. To install traceroute:


 * **#apt-get install traceroute** ||