| [Top] | [Contents] | [Index] | [ ? ] |
Quagga
Quagga is an advanced routing software package that provides a suite of TCP/IP based routing protocols. This is the Manual for Quagga 0.99.4. Quagga is a fork of GNU Zebra.
Copyright © 1999-2005 Kunihiro Ishiguro, et al.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Kunihiro Ishiguro.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1. Overview
Quagga is a routing software package that provides TCP/IP based routing services with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, BGP-4, and BGP-4+ (see section Supported RFCs). Quagga also supports special BGP Route Reflector and Route Server behavior. In addition to traditional IPv4 routing protocols, Quagga also supports IPv6 routing protocols. With SNMP daemon which supports SMUX protocol, Quagga provides routing protocol MIBs (see section SNMP Support).
Quagga uses an advanced software architecture to provide you with a high quality, multi server routing engine. Quagga has an interactive user interface for each routing protocol and supports common client commands. Due to this design, you can add new protocol daemons to Quagga easily. You can use Quagga library as your program's client user interface.
Quagga is distributed under the GNU General Public License.
| 1.1 About Quagga | Basic information about Quagga | |
| 1.2 System Architecture | The Quagga system architecture | |
| 1.3 Supported Platforms | Supported platforms and future plans | |
| 1.4 Supported RFCs | ||
| 1.5 How to get Quagga | ||
| 1.6 Mailing List | Mailing list information | |
| 1.7 Bug Reports | Mail address for bug data |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.1 About Quagga
Today, TCP/IP networks are covering all of the world. The Internet has been deployed in many countries, companies, and to the home. When you connect to the Internet your packet will pass many routers which have TCP/IP routing functionality.
A system with Quagga installed acts as a dedicated router. With Quagga, your machine exchanges routing information with other routers using routing protocols. Quagga uses this information to update the kernel routing table so that the right data goes to the right place. You can dynamically change the configuration and you may view routing table information from the Quagga terminal interface.
Adding to routing protocol support, Quagga can setup interface's flags, interface's address, static routes and so on. If you have a small network, or a stub network, or xDSL connection, configuring the Quagga routing software is very easy. The only thing you have to do is to set up the interfaces and put a few commands about static routes and/or default routes. If the network is rather large, or if the network structure changes frequently, you will want to take advantage of Quagga's dynamic routing protocol support for protocols such as RIP, OSPF or BGP.
Traditionally, UNIX based router configuration is done by
ifconfig and route commands. Status of routing
table is displayed by netstat utility. Almost of these commands
work only if the user has root privileges. Quagga has a different system
administration method. There are two user modes in Quagga. One is normal
mode, the other is enable mode. Normal mode user can only view system
status, enable mode user can change system configuration. This UNIX account
independent feature will be great help to the router administrator.
Currently, Quagga supports common unicast routing protocols. Multicast routing protocols such as BGMP, PIM-SM, PIM-DM may be supported in Quagga 2.0. MPLS support is going on. In the future, TCP/IP filtering control, QoS control, diffserv configuration will be added to Quagga. Quagga project's final goal is making a productive, quality, free TCP/IP routing software.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.2 System Architecture
Traditional routing software is made as a one process program which provides all of the routing protocol functionalities. Quagga takes a different approach. It is made from a collection of several daemons that work together to build the routing table. There may be several protocol-specific routing daemons and zebra the kernel routing manager.
The ripd daemon handles the RIP protocol, while
ospfd is a daemon which supports OSPF version 2.
bgpd supports the BGP-4 protocol. For changing the kernel
routing table and for redistribution of routes between different routing
protocols, there is a kernel routing table manager zebra daemon.
It is easy to add a new routing protocol daemons to the entire routing
system without affecting any other software. You need to run only the
protocol daemon associated with routing protocols in use. Thus, user may
run a specific daemon and send routing reports to a central routing console.
There is no need for these daemons to be running on the same machine. You can even run several same protocol daemons on the same machine. This architecture creates new possibilities for the routing system.
+----+ +----+ +-----+ +-----+
|bgpd| |ripd| |ospfd| |zebra|
+----+ +----+ +-----+ +-----+
|
+---------------------------|--+
| v |
| UNIX Kernel routing table |
| |
+------------------------------+
Quagga System Architecture
|
Multi-process architecture brings extensibility, modularity and
maintainability. At the same time it also brings many configuration files
and terminal interfaces. Each daemon has it's own configuration file and
terminal interface. When you configure a static route, it must be done in
zebra configuration file. When you configure BGP network it must
be done in bgpd configuration file. This can be a very annoying
thing. To resolve the problem, Quagga provides integrated user interface
shell called vtysh. vtysh connects to each daemon with
UNIX domain socket and then works as a proxy for user input.
Quagga was planned to use multi-threaded mechanism when it runs with a
kernel that supports multi-threads. But at the moment, the thread library
which comes with GNU/Linux or FreeBSD has some problems with running
reliable services such as routing software, so we don't use threads at all.
Instead we use the select(2) system call for multiplexing the
events.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.3 Supported Platforms
Currently Quagga supports GNU/Linux, BSD and Solaris. Porting Quagga
to other platforms is not too difficult as platform dependent code should
most be limited to the zebra daemon. Protocol daemons are mostly
platform independent. Please let us know when you find out Quagga runs on a
platform which is not listed below.
The list of officially supported platforms are listed below. Note that Quagga may run correctly on other platforms, and may run with partial functionality on further platforms.
- GNU/Linux 2.4.x and higher
- FreeBSD 4.x and higher
- NetBSD 1.6 and higher
- OpenBSD 2.5 and higher
- Solaris 8 and higher
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.4 Supported RFCs
Below is the list of currently supported RFC's.
- RFC1058
Routing Information Protocol. C.L. Hedrick. Jun-01-1988.
- RF2082
RIP-2 MD5 Authentication. F. Baker, R. Atkinson. January 1997.
- RFC2453
RIP Version 2. G. Malkin. November 1998.
- RFC2080
RIPng for IPv6. G. Malkin, R. Minnear. January 1997.
- RFC2328
OSPF Version 2. J. Moy. April 1998.
- RFC2370
The OSPF Opaque LSA Option R. Coltun. July 1998.
- RFC3101
The OSPF Not-So-Stubby Area (NSSA) Option P. Murphy. January 2003.
- RFC2740
OSPF for IPv6. R. Coltun, D. Ferguson, J. Moy. December 1999.
- RFC1771
A Border Gateway Protocol 4 (BGP-4). Y. Rekhter & T. Li. March 1995.
- RFC1965
Autonomous System Confederations for BGP. P. Traina. June 1996.
- RFC1997
BGP Communities Attribute. R. Chandra, P. Traina & T. Li. August 1996.
- RFC2545
Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain Routing. P. Marques, F. Dupont. March 1999.
- RFC2796
BGP Route Reflection An alternative to full mesh IBGP. T. Bates & R. Chandrasekeran. June 1996.
- RFC2858
Multiprotocol Extensions for BGP-4. T. Bates, Y. Rekhter, R. Chandra, D. Katz. June 2000.
- RFC2842
Capabilities Advertisement with BGP-4. R. Chandra, J. Scudder. May 2000.
- RFC3137
OSPF Stub Router Advertisement, A. Retana, L. Nguyen, R. White, A. Zinin, D. McPherson. June 2001
When SNMP support is enabled, below RFC is also supported.
- RFC1227
SNMP MUX protocol and MIB. M.T. Rose. May-01-1991.
- RFC1657
Definitions of Managed Objects for the Fourth Version of the Border Gateway Protocol (BGP-4) using SMIv2. S. Willis, J. Burruss, J. Chu, Editor. July 1994.
- RFC1724
RIP Version 2 MIB Extension. G. Malkin & F. Baker. November 1994.
- RFC1850
OSPF Version 2 Management Information Base. F. Baker, R. Coltun. November 1995.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.5 How to get Quagga
The official Quagga web-site is located at:
and contains further information, as well as links to additional resources.
Quagga is a fork of GNU Zebra, whose web-site is located at:
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.6 Mailing List
There is a mailing list for discussions about Quagga. If you have any comments or suggestions to Quagga, please subscribe to:
http://lists.quagga.net/mailman/listinfo/quagga-users.
The Quagga site has further information on the available mailing lists, see:
http://www.quagga.net/lists.php
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.7 Bug Reports
If you think you have found a bug, please send a bug report to:
When you send a bug report, please be careful about the points below.
- Please note what kind of OS you are using. If you use the IPv6 stack please note that as well.
-
Please show us the results of
netstat -rnandifconfig -a. Information from zebra's VTY commandshow ip routewill also be helpful. - Please send your configuration file with the report. If you specify arguments to the configure script please note that too.
Bug reports are very important for us to improve the quality of Quagga. Quagga is still in the development stage, but please don't hesitate to send a bug report to http://bugzilla.quagga.net.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2. Installation
There are three steps for installing the software: configuration, compilation, and installation.
| 2.1 Configure the Software | ||
| 2.2 Build the Software | ||
| 2.3 Install the Software |
The easiest way to get Quagga running is to issue the following commands:
% configure % make % make install |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1 Configure the Software
| 2.1.1 The Configure script and its options | ||
| 2.1.2 Least-Privilege support | ||
| 2.1.3 Linux Notes |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1.1 The Configure script and its options
Quagga has an excellent configure script which automatically detects most host configurations. There are several additional configure options you can use to turn off IPv6 support, to disable the compilation of specific daemons, and to enable SNMP support.
- `--enable-guile'
Turn on compilation of the zebra-guile interpreter. You will need the guile library to make this. zebra-guile implementation is not yet finished. So this option is only useful for zebra-guile developers.
- `--disable-ipv6'
Turn off IPv6 related features and daemons. Quagga configure script automatically detects IPv6 stack. But sometimes you might want to disable IPv6 support of Quagga.
- `--disable-zebra'
Do not build zebra daemon.
- `--disable-ripd'
Do not build ripd.
- `--disable-ripngd'
Do not build ripngd.
- `--disable-ospfd'
Do not build ospfd.
- `--disable-ospf6d'
Do not build ospf6d.
- `--disable-bgpd'
Do not build bgpd.
- `--disable-bgp-announce'
Make
bgpdwhich does not make bgp announcements at all. This feature is good for usingbgpdas a BGP announcement listener.- `--enable-netlink'
Force to enable GNU/Linux netlink interface. Quagga configure script detects netlink interface by checking a header file. When the header file does not match to the current running kernel, configure script will not turn on netlink support.
- `--enable-snmp'
Enable SNMP support. By default, SNMP support is disabled.
- `--enable-opaque-lsa'
Enable support for Opaque LSAs (RFC2370) in ospfd.
- `--disable-ospfapi'
Disable support for OSPF-API, an API to interface directly with ospfd. OSPF-API is enabled if -enable-opaque-lsa is set.
- `--disable-ospfclient'
Disable building of the example OSPF-API client.
- `--enable-ospf-te'
Enable support for OSPF Traffic Engineering Extension (internet-draft) this requires support for Opaque LSAs.
- `--enable-multipath=ARG'
Enable support for Equal Cost Multipath. ARG is the maximum number of ECMP paths to allow, set to 0 to allow unlimited number of paths.
- `--enable-rtadv'
Enable support IPV6 router advertisement in zebra.
You may specify any combination of the above options to the configure script. By default, the executables are placed in `/usr/local/sbin' and the configuration files in `/usr/local/etc'. The `/usr/local/' installation prefix and other directories may be changed using the following options to the configuration script.
- `--prefix=prefix'
Install architecture-independent files in prefix [/usr/local].
- `--sysconfdir=dir'
Look for configuration files in dir [prefix/etc]. Note that sample configuration files will be installed here.
- `--localstatedir=dir'
Configure zebra to use dir for local state files, such as pid files and unix sockets.
% ./configure --disable-ipv6 |
This command will configure zebra and the routing daemons.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1.2 Least-Privilege support
Additionally, you may configure zebra to drop its elevated privileges shortly after startup and switch to another user. The configure script will automatically try to configure this support. There are three configure options to control the behaviour of Quagga daemons.
- `--enable-user=user'
Switch to user ARG shortly after startup, and run as user ARG in normal operation.
- `--enable-group=group'
Switch real and effective group to group shortly after startup.
- `--enable-vty-group=group'
Create Unix Vty sockets (for use with vtysh) with group owndership set to group. This allows one to create a seperate group which is restricted to accessing only the Vty sockets, hence allowing one to delegate this group to individual users, or to run vtysh setgid to this group.
The default user and group which will be configured is 'quagga' if no user or group is specified. Note that this user or group requires write access to the local state directory (see -localstatedir) and requires at least read access, and write access if you wish to allow daemons to write out their configuration, to the configuration directory (see -sysconfdir).
On systems which have the 'libcap' capabilities manipulation library (currently only linux), the quagga system will retain only minimal capabilities required, further it will only raise these capabilities for brief periods. On systems without libcap, quagga will run as the user specified and only raise its uid back to uid 0 for brief periods.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1.3 Linux Notes
There are several options available only to GNU/Linux systems: (1). If you use GNU/Linux, make sure that the current kernel configuration is what you want. Quagga will run with any kernel configuration but some recommendations do exist.
- CONFIG_NETLINK
Kernel/User netlink socket. This is a brand new feature which enables an advanced interface between the Linux kernel and zebra (see section Kernel Interface).
- CONFIG_RTNETLINK
Routing messages. This makes it possible to receive netlink routing messages. If you specify this option,
zebracan detect routing information updates directly from the kernel (see section Kernel Interface).- CONFIG_IP_MULTICAST
IP: multicasting. This option should be specified when you use
ripd(see section RIP) orospfd(see section OSPFv2) because these protocols use multicast.
IPv6 support has been added in GNU/Linux kernel version 2.2. If you try to use the Quagga IPv6 feature on a GNU/Linux kernel, please make sure the following libraries have been installed. Please note that these libraries will not be needed when you uses GNU C library 2.1 or upper.
-
inet6-apps The
inet6-appspackage includes basic IPv6 related libraries such asinet_ntopandinet_pton. Some basic IPv6 programs such asping,ftp, andinetdare also included. Theinet-appscan be found at ftp://ftp.inner.net/pub/ipv6/.-
net-tools The
net-toolspackage provides an IPv6 enabled interface and routing utility. It containsifconfig,route,netstat, and other tools.net-toolsmay be found at http://www.tazenda.demon.co.uk/phil/net-tools/.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.2 Build the Software
After configuring the software, you will need to compile it for your
system. Simply issue the command make in the root of the source
directory and the software will be compiled. If you have *any* problems
at this stage, be certain to send a bug report See section Bug Reports.
% ./configure . . . ./configure output . . . % make |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.3 Install the Software
Installing the software to your system consists of copying the compiled programs and supporting files to a standard location. After the installation process has completed, these files have been copied from your work directory to `/usr/local/bin', and `/usr/local/etc'.
To install the Quagga suite, issue the following command at your shell
prompt: make install.
% % make install % |
Quagga daemons have their own terminal interface or VTY. After installation, you have to setup each beast's port number to connect to them. Please add the following entries to `/etc/services'.
zebrasrv 2600/tcp # zebra service zebra 2601/tcp # zebra vty ripd 2602/tcp # RIPd vty ripngd 2603/tcp # RIPngd vty ospfd 2604/tcp # OSPFd vty bgpd 2605/tcp # BGPd vty ospf6d 2606/tcp # OSPF6d vty ospfapi 2607/tcp # ospfapi isisd 2608/tcp # ISISd vty |
If you use a FreeBSD newer than 2.2.8, the above entries are already added to `/etc/services' so there is no need to add it. If you specify a port number when starting the daemon, these entries may not be needed.
You may need to make changes to the config files in `/etc/quagga/*.conf'. See section Config Commands.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3. Basic commands
There are five routing daemons in use, and there is one manager daemon. These daemons may be located on separate machines from the manager daemon. Each of these daemons will listen on a particular port for incoming VTY connections. The routing daemons are:
-
ripd,ripngd,ospfd,ospf6d,bgpd -
zebra
The following sections discuss commands common to all the routing daemons.
| 3.2 Terminal Mode Commands | Common commands used in a VTY | |
| 3.1 Config Commands | Commands used in config files | |
| 3.3 Common Invocation Options | Starting the daemons | |
| 3.4 Virtual Terminal Interfaces | Interacting with the daemons |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1 Config Commands
| 3.1.1 Basic Config Commands | Some of the generic config commands | |
| 3.1.2 Sample Config File | An example config file |
In a config file, you can write the debugging options, a vty's password, routing daemon configurations, a log file name, and so forth. This information forms the initial command set for a routing beast as it is starting.
Config files are generally found in:
- `/etc/quagga/*.conf'
Each of the daemons has its own config file. For example, zebra's default config file name is:
- `/etc/quagga/zebra.conf'
The daemon name plus `.conf' is the default config file name. You can specify a config file using the -f or --config-file options when starting the daemon.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.1 Basic Config Commands
- Command: password password
Set password for vty interface. If there is no password, a vty won't accept connections.
- Command: log trap level
- Command: no log trap
These commands are deprecated and are present only for historical compatibility. The log trap command sets the current logging level for all enabled logging destinations, and it sets the default for all future logging commands that do not specify a level. The normal default logging level is debugging. The
noform of the command resets the default level for future logging commands to debugging, but it does not change the logging level of existing logging destinations.
- Command: log stdout
- Command: log stdout level
- Command: no log stdout
Enable logging output to stdout. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. Thenoform of the command disables logging to stdout. Thelevelargument must have one of these values: emergencies, alerts, critical, errors, warnings, notifications, informational, or debugging. Note that the existing code logs its most important messages with severityerrors.
- Command: log file filename
- Command: log file filename level
- Command: no log file
If you want to log into a file, please specify
filenameas in this example:log file /var/log/quagga/bgpd.log informational
If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. Thenoform of the command disables logging to a file.Note: if you do not configure any file logging, and a daemon crashes due to a signal or an assertion failure, it will attempt to save the crash information in a file named /var/tmp/quagga.<daemon name>.crashlog. For security reasons, this will not happen if the file exists already, so it is important to delete the file after reporting the crash information.
- Command: log syslog
- Command: log syslog level
- Command: no log syslog
Enable logging output to syslog. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecated
log trapcommand) will be used. Thenoform of the command disables logging to syslog.
- Command: log monitor
- Command: log monitor level
- Command: no log monitor
Enable logging output to vty terminals that have enabled logging using the
terminal monitorcommand. By default, monitor logging is enabled at the debugging level, but this command (or the deprecatedlog trapcommand) can be used to change the monitor logging level. If the optional second argument specifying the logging level is not present, the default logging level (typically debugging, but can be changed using the deprecatedlog trapcommand) will be used. Thenoform of the command disables logging to terminal monitors.
- Command: log facility facility
- Command: no log facility
This command changes the facility used in syslog messages. The default facility is
daemon. Thenoform of the command resets the facility to the defaultdaemonfacility.
- Command: log record-priority
- Command: no log record-priority
To include the severity in all messages logged to a file, to stdout, or to a terminal monitor (i.e. anything except syslog), use the
log record-priorityglobal configuration command. To disable this option, use thenoform of the command. By default, the severity level is not included in logged messages. Note: some versions of syslogd (including Solaris) can be configured to include the facility and level in the messages emitted.
- Command: service terminal-length <0-512>
Set system wide line configuration. This configuration command applies to all VTY interfaces.
- Line Command: exec-timeout minute
- Line Command: exec-timeout minute second
Set VTY connection timeout value. When only one argument is specified it is used for timeout value in minutes. Optional second argument is used for timeout value in seconds. Default timeout value is 10 minutes. When timeout value is zero, it means no timeout.
- Line Command: no exec-timeout
Do not perform timeout at all. This command is as same as
exec-timeout 0 0.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.1.2 Sample Config File
Below is a sample configuration file for the zebra daemon.
! ! Zebra configuration file ! hostname Router password zebra enable password zebra ! log stdout ! ! |
'!' and '#' are comment characters. If the first character of the word is one of the comment characters then from the rest of the line forward will be ignored as a comment.
password zebra!password |
If a comment character is not the first character of the word, it's a normal character. So in the above example '!' will not be regarded as a comment and the password is set to 'zebra!password'.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.2 Terminal Mode Commands
- Command: configure terminal
Change to configuration mode. This command is the first step to configuration.
- Command: terminal length <0-512>
Set terminal display length to <0-512>. If length is 0, no display control is performed.
- Command: show logging
Shows the current configuration of the logging system. This includes the status of all logging destinations.
- Command: logmsg level message
Send a message to all logging destinations that are enabled for messages of the given severity.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.3 Common Invocation Options
These options apply to all Quagga daemons.
- `-d'
- `--daemon'
Runs in daemon mode.
- `-f file'
- `--config_file=file'
Set configuration file name.
- `-h'
- `--help'
Display this help and exit.
- `-i file'
- `--pid_file=file'
-
Upon startup the process identifier of the daemon is written to a file, typically in `/var/run'. This file can be used by the init system to implement commands such as
…/init.d/zebra status,…/init.d/zebra restartor…/init.d/zebra stop.The file name is an run-time option rather than a configure-time option so that multiple routing daemons can be run simultaneously. This is useful when using Quagga to implement a routing looking glass. One machine can be used to collect differing routing views from differing points in the network.
- `-A address'
- `--vty_addr=address'
Set the VTY local address to bind to. If set, the VTY socket will only be bound to this address.
- `-P port'
- `--vty_port=port'
Set the VTY TCP port number. If set to 0 then the TCP VTY sockets will not be opened.
- `-u user'
- `--vty_addr=user'
Set the user and group to run as.
- `-v'
- `--version'
Print program version.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4 Virtual Terminal Interfaces
VTY - Virtual Terminal [aka TeletYpe] Interface is a command line interface (CLI) for user interaction with the routing daemon.
| 3.4.1 VTY Overview | Basics about VTYs | |
| 3.4.2 VTY Modes | View, Enable, and Other VTY modes | |
| 3.4.3 VTY CLI Commands | Commands for movement, edition, and management |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.1 VTY Overview
VTY stands for Virtual TeletYpe interface. It means you can connect to the daemon via the telnet protocol.
To enable a VTY interface, you have to setup a VTY password. If there is no VTY password, one cannot connect to the VTY interface at all.
% telnet localhost 2601 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Hello, this is Quagga (version 0.99.4) Copyright © 1999-2005 Kunihiro Ishiguro, et al. User Access Verification Password: XXXXX Router> ? enable Turn on privileged commands exit Exit current mode and down to previous mode help Description of the interactive help system list Print command list show Show running system information who Display who is on a vty Router> enable Password: XXXXX Router# configure terminal Router(config)# interface eth0 Router(config-if)# ip address 10.0.0.1/8 Router(config-if)# ^Z Router# |
'?' is very useful for looking up commands.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.2 VTY Modes
There are three basic VTY modes:
| 3.4.2.1 VTY View Mode | Mode for read-only interaction | |
| 3.4.2.2 VTY Enable Mode | Mode for read-write interaction | |
| 3.4.2.3 VTY Other Modes | Special modes (tftp, etc) |
There are commands that may be restricted to specific VTY modes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.2.1 VTY View Mode
This mode is for read-only access to the CLI. One may exit the mode by
leaving the system, or by entering enable mode.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.2.2 VTY Enable Mode
This mode is for read-write access to the CLI. One may exit the mode by leaving the system, or by escaping to view mode.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.2.3 VTY Other Modes
This page is for describing other modes.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.3 VTY CLI Commands
Commands that you may use at the command-line are described in the following three subsubsections.
| 3.4.3.1 CLI Movement Commands | Commands for moving the cursor about | |
| 3.4.3.2 CLI Editing Commands | Commands for changing text | |
| 3.4.3.3 CLI Advanced Commands | Other commands, session management and so on |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.3.1 CLI Movement Commands
These commands are used for moving the CLI cursor. The C character means press the Control Key.
- C-f
- RIGHT
-
Move forward one character.
- C-b
- LEFT
-
Move backward one character.
- M-f
-
Move forward one word.
- M-b
-
Move backward one word.
- C-a
-
Move to the beginning of the line.
- C-e
-
Move to the end of the line.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.3.2 CLI Editing Commands
These commands are used for editing text on a line. The C character means press the Control Key.
- C-h
- DEL
-
Delete the character before point.
- C-d
-
Delete the character after point.
- M-d
-
Forward kill word.
- C-w
-
Backward kill word.
- C-k
-
Kill to the end of the line.
- C-u
-
Kill line from the beginning, erasing input.
- C-t
-
Transpose character.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4.3.3 CLI Advanced Commands
There are several additional CLI commands for command line completions, insta-help, and VTY session management.
- C-c
-
Interrupt current input and moves to the next line.
- C-z
-
End current configuration session and move to top node.
- C-n
- DOWN
-
Move down to next line in the history buffer.
- C-p
- UP
-
Move up to previous line in the history buffer.
- TAB
-
Use command line completion by typing TAB.
-
You can use command line help by typing
helpat the beginning of the line. Typing ? at any point in the line will show possible completions.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4. Zebra
zebra is an IP routing manager. It provides kernel routing
table updates, interface lookups, and redistribution of routes between
different routing protocols.
| 4.1 Invoking zebra | Running the program | |
| 4.2 Interface Commands | Commands for zebra interfaces | |
| 4.3 Static Route Commands | Commands for adding static routes | |
| 4.4 zebra Terminal Mode Commands | Commands for zebra's VTY |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.1 Invoking zebra
Besides the common invocation options (see section Common Invocation Options), the
zebra specific invocation options are listed below.
- `-b'
- `--batch'
Runs in batch mode.
zebraparses configuration file and terminates immediately.- `-k'
- `--keep_kernel'
When zebra starts up, don't delete old self inserted routes.
- `-r'
- `--retain'
When program terminates, retain routes added by zebra.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.2 Interface Commands
- Interface Command: ip address address/prefix
- Interface Command: ip6 address address/prefix
- Interface Command: no ip address address/prefix
- Interface Command: no ip6 address address/prefix
Set the IPv4 or IPv6 address/prefix for the interface.
- Interface Command: ip address address/prefix secondary
- Interface Command: no ip address address/prefix secondary
Set the secondary flag for this address. This causes ospfd to not treat the address as a distinct subnet.
- Interface Command: multicast
- Interface Command: no multicast
Enable or disables multicast flag for the interface.
- Interface Command: bandwidth <1-10000000>
- Interface Command: no bandwidth <1-10000000>
Set bandwidth value of the interface in kilobits/sec. This is for calculating OSPF cost. This command does not affect the actual device configuration.
- Interface Command: link-detect
- Interface Command: no link-detect
Enable/disable link-detect on platforms which support this. Currently only Linux and Solaris, and only where network interface drivers support reporting link-state via the IFF_RUNNING flag.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.3 Static Route Commands
Static routing is a very fundamental feature of routing technology. It defines static prefix and gateway.
- Command: ip route network gateway
network is destination prefix with format of A.B.C.D/M. gateway is gateway for the prefix. When gateway is A.B.C.D format. It is taken as a IPv4 address gateway. Otherwise it is treated as an interface name. If the interface name is null0 then zebra installs a blackhole route.
ip route 10.0.0.0/8 10.0.0.2 ip route 10.0.0.0/8 ppp0 ip route 10.0.0.0/8 null0
First example defines 10.0.0.0/8 static route with gateway 10.0.0.2. Second one defines the same prefix but with gateway to interface ppp0. The third install a blackhole route.
- Command: ip route network netmask gateway
This is alternate version of above command. When network is A.B.C.D format, user must define netmask value with A.B.C.D format. gateway is same option as above command
ip route 10.0.0.0 255.255.255.0 10.0.0.2 ip route 10.0.0.0 255.255.255.0 ppp0 ip route 10.0.0.0 255.255.255.0 null0
These statements are equivalent to those in the previous example.
Multiple nexthop static route
ip route 10.0.0.1/32 10.0.0.2 ip route 10.0.0.1/32 10.0.0.3 ip route 10.0.0.1/32 eth0 |
If there is no route to 10.0.0.2 and 10.0.0.3, and interface eth0 is reachable, then the last route is installed into the kernel.
If zebra has been compiled with multipath support, and both 10.0.0.2 and 10.0.0.3 are reachable, zebra will install a multipath route via both nexthops, if the platform supports this.
zebra> show ip route
S> 10.0.0.1/32 [1/0] via 10.0.0.2 inactive
via 10.0.0.3 inactive
* is directly connected, eth0
|
ip route 10.0.0.0/8 10.0.0.2 ip route 10.0.0.0/8 10.0.0.3 ip route 10.0.0.0/8 null0 255 |
This will install a multihop route via the specified next-hops if they are reachable, as well as a high-metric blackhole route, which can be useful to prevent traffic destined for a prefix to match less-specific routes (eg default) should the specified gateways not be reachable. Eg:
zebra> show ip route 10.0.0.0/8
Routing entry for 10.0.0.0/8
Known via "static", distance 1, metric 0
10.0.0.2 inactive
10.0.0.3 inactive
Routing entry for 10.0.0.0/8
Known via "static", distance 255, metric 0
directly connected, Null0
|
- Command: ipv6 route network gateway
- Command: ipv6 route network gateway distance
These behave similarly to their ipv4 counterparts.
- Command: table tableno
Select the primary kernel routing table to be used. This only works for kernels supporting multiple routing tables (like GNU/Linux 2.2.x and later). After setting tableno with this command, static routes defined after this are added to the specified table.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.4 zebra Terminal Mode Commands
- Command: show ip route
Display current routes which zebra holds in its database.
Router# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, B - BGP * - FIB route. K* 0.0.0.0/0 203.181.89.241 S 0.0.0.0/0 203.181.89.1 C* 127.0.0.0/8 lo C* 203.181.89.240/28 eth0
- Command: show ipforward
Display whether the host's IP forwarding function is enabled or not. Almost any UNIX kernel can be configured with IP forwarding disabled. If so, the box can't work as a router.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5. RIP
RIP - Routing Information Protocol is widely deployed interior gateway protocol. RIP was developed in the 1970s at Xerox Labs as part of the XNS routing protocol. RIP is a distance-vector protocol and is based on the Bellman-Ford algorithms. As a distance-vector protocol, RIP router send updates to its neighbors periodically, thus allowing the convergence to a known topology. In each update, the distance to any given network will be broadcasted to its neighboring router.
ripd supports RIP version 2 as described in RFC2453 and RIP
version 1 as described in RFC1058.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.1 Starting and Stopping ripd
The default configuration file name of ripd's is
`ripd.conf'. When invocation ripd searches directory
/etc/quagga. If `ripd.conf' is not there next
search current directory.
RIP uses UDP port 520 to send and receive RIP packets. So the user must have
the capability to bind the port, generally this means that the user must
have superuser privileges. RIP protocol requires interface information
maintained by zebra daemon. So running zebra
is mandatory to run ripd. Thus minimum sequence for running
RIP is like below:
# zebra -d # ripd -d |
Please note that zebra must be invoked before ripd.
To stop ripd. Please use kill `cat
/var/run/ripd.pid`. Certain signals have special meaningss to ripd.
- `SIGHUP'
Reload configuration file `ripd.conf'. All configurations are reseted. All routes learned so far are cleared and removed from routing table.
- `SIGUSR1'
Rotate
ripdlogfile.- `SIGINT'
- `SIGTERM'
ripdsweeps all installed RIP routes then terminates properly.
ripd invocation options. Common options that can be specified
(see section Common Invocation Options).
- `-r'
- `--retain'
When the program terminates, retain routes added by
ripd.
| 5.1.1 RIP netmask |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.1.1 RIP netmask
The netmask features of ripd support both version 1 and version 2 of
RIP. Version 1 of RIP originally contained no netmask information. In
RIP version 1, network classes were originally used to determine the
size of the netmask. Class A networks use 8 bits of mask, Class B
networks use 16 bits of masks, while Class C networks use 24 bits of
mask. Today, the most widely used method of a network mask is assigned
to the packet on the basis of the interface that received the packet.
Version 2 of RIP supports a variable length subnet mask (VLSM). By
extending the subnet mask, the mask can be divided and reused. Each
subnet can be used for different purposes such as large to middle size
LANs and WAN links. Quagga ripd does not support the non-sequential
netmasks that are included in RIP Version 2.
In a case of similar information with the same prefix and metric, the old information will be suppressed. Ripd does not currently support equal cost multipath routing.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.2 RIP Configuration
- Command: router rip
The
router ripcommand is necessary to enable RIP. To disable RIP, use theno router ripcommand. RIP must be enabled before carrying out any of the RIP commands.
- RIP Command: network network
- RIP Command: no network network
Set the RIP enable interface by network. The interfaces which have addresses matching with network are enabled.
This group of commands either enables or disables RIP interfaces between certain numbers of a specified network address. For example, if the network for 10.0.0.0/24 is RIP enabled, this would result in all the addresses from 10.0.0.0 to 10.0.0.255 being enabled for RIP. The
no networkcommand will disable RIP for the specified network.
- RIP Command: network ifname
- RIP Command: no network ifname
Set a RIP enabled interface by ifname. Both the sending and receiving of RIP packets will be enabled on the port specified in the
network ifnamecommand. Theno network ifnamecommand will disable RIP on the specified interface.
- RIP Command: neighbor a.b.c.d
- RIP Command: no neighbor a.b.c.d
Specify RIP neighbor. When a neighbor doesn't understand multicast, this command is used to specify neighbors. In some cases, not all routers will be able to understand multicasting, where packets are sent to a network or a group of addresses. In a situation where a neighbor cannot process multicast packets, it is necessary to establish a direct link between routers. The neighbor command allows the network administrator to specify a router as a RIP neighbor. The
no neighbor a.b.c.dcommand will disable the RIP neighbor.
Below is very simple RIP configuration. Interface eth0 and
interface which address match to 10.0.0.0/8 are RIP enabled.
! router rip network 10.0.0.0/8 network eth0 ! |
Passive interface
- RIP command: passive-interface (IFNAME|default)
- RIP command: no passive-interface IFNAME
This command sets the specified interface to passive mode. On passive mode interface, all receiving packets are processed as normal and ripd does not send either multicast or unicast RIP packets except to RIP neighbors specified with
neighborcommand. The interface may be specified as default to make ripd default to passive on all interfaces.The default is to be passive on all interfaces.
RIP split-horizon
- Interface command: ip split-horizon
- Interface command: no ip split-horizon
Control split-horizon on the interface. Default is
ip split-horizon. If you don't perform split-horizon on the interface, please specifyno ip split-horizon.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.3 RIP Version Control
RIP can be configured to send either Version 1 or Version 2 packets. The default is to send RIPv2 while accepting both RIPv1 and RIPv2 (and replying with packets of the appropriate version for REQUESTS / triggered updates). The version to receive and send can be specified globally, and further overriden on a per-interface basis if needs be for send and receive seperately (see below).
It is important to note that RIPv1 can not be authenticated. Further, if RIPv1 is enabled then RIP will reply to REQUEST packets, sending the state of its RIP routing table to any remote routers that ask on demand. For a more detailed discussion on the security implications of RIPv1 see RIP Authentication.
- RIP Command: version version
Set RIP version to accept for reads and send. version can be either `1" or `2".
Disabling RIPv1 by specifying version 2 is STRONGLY encouraged, See section RIP Authentication. This may become the default in a future release.
Default: Send Version 2, and accept either version.
- Interface command: ip rip send version version
version can be `1', `2' or `1 2'.
This interface command overrides the global rip version setting, and selects which version of RIP to send packets with, for this interface specifically. Choice of RIP Version 1, RIP Version 2, or both versions. In the latter case, where `1 2' is specified, packets will be both broadcast and multicast.
Default: Send packets according to the global version (version 2)
- Interface command: ip rip receive version version
version can be `1', `2' or `1 2'.
This interface command overrides the global rip version setting, and selects which versions of RIP packets will be accepted on this interface. Choice of RIP Version 1, RIP Version 2, or both.
Default: Accept packets according to the global setting (both 1 and 2).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.4 How to Announce RIP route
- RIP command: redistribute kernel
- RIP command: redistribute kernel metric <0-16>
- RIP command: redistribute kernel route-map route-map
- RIP command: no redistribute kernel
redistribute kernelredistributes routing information from kernel route entries into the RIP tables.no redistribute kerneldisables the routes.
- RIP command: redistribute static
- RIP command: redistribute static metric <0-16>
- RIP command: redistribute static route-map route-map
- RIP command: no redistribute static
redistribute staticredistributes routing information from static route entries into the RIP tables.no redistribute staticdisables the routes.
- RIP command: redistribute connected
- RIP command: redistribute connected metric <0-16>
- RIP command: redistribute connected route-map route-map
- RIP command: no redistribute connected
Redistribute connected routes into the RIP tables.
no redistribute connecteddisables the connected routes in the RIP tables. This command redistribute connected of the interface which RIP disabled. The connected route on RIP enabled interface is announced by default.