   This file documents the GNU Quagga software which manages common
TCP/IP routing protocols.

   This is Edition 0.1, last updated 12 August 2003 of `The Quagga
Manual', for Quagga Version 0.96.

   Copyright (C) 1999, 2000, 2001, 2002 Kunihiro Ishiguro

   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.

Filtering RIP Routes
====================

   RIP routes can be filtered by a distribute-list.

 - Command: distribute-list ACCESS_LIST DIRECT IFNAME
     You can apply access lists to the interface with a
     `distribute-list' command.  ACCESS_LIST is the access list name.
     DIRECT is `in' or `out'.  If DIRECT is `in' the access list is
     applied to input packets.

     The `distribute-list' command can be used to filter the RIP path.
     `distribute-list' can apply access-lists to a chosen interface.
     First, one should specify the access-list.  Next, the name of the
     access-list is used in the distribute-list command.  For example,
     in the following configuration `eth0' will permit only the paths
     that match the route 10.0.0.0/8

          !
          router rip
           distribute-list private in eth0
          !
          access-list private permit 10 10.0.0.0/8
          access-list private deny any
          !

   `distribute-list' can be applied to both incoming and outgoing data.

 - Command: distribute-list prefix PREFIX_LIST (in|out) IFNAME
     You can apply prefix lists to the interface with a
     `distribute-list' command.  PREFIX_LIST is the prefix list name.
     Next is the direction of `in' or `out'.  If DIRECT is `in' the
     access list is applied to input packets.

RIP Metric Manipulation
=======================

   RIP metric is a value for distance for the network.  Usually `ripd'
increment the metric when the network information is received.
Redistributed routes' metric is set to 1.

 - RIP command: default-metric <1-16>
 - RIP command: no default-metric <1-16>
     This command modifies the default metric value for redistributed
     routes.  The default value is 1.  This command does not affect
     connected route even if it is redistributed by `redistribute
     connected'.  To modify connected route's metric value, please use
     `redistribute connected metric' or `route-map'.  `offset-list' also
     affects connected routes.

 - RIP command: offset-list ACCESS-LIST (in|out)
 - RIP command: offset-list ACCESS-LIST (in|out) IFNAME

RIP distance
============

   Distance value is used in zebra daemon.  Default RIP distance is 120.

 - RIP command: distance <1-255>
 - RIP command: no distance <1-255>
     Set default RIP distance to specified value.

 - RIP command: distance <1-255> A.B.C.D/M
 - RIP command: no distance <1-255> A.B.C.D/M
     Set default RIP distance to specified value when the route's
     source IP address matches the specified prefix.

 - RIP command: distance <1-255> A.B.C.D/M ACCESS-LIST
 - RIP command: no distance <1-255> A.B.C.D/M ACCESS-LIST
     Set default RIP distance to specified value when the route's
     source IP address matches the specified prefix and the specified
     access-list.

RIP route-map
=============

   Usage of `ripd''s route-map support.

   Optional argument route-map MAP_NAME can be added to each
`redistribute' statement.

     redistribute static [route-map MAP_NAME]
     redistribute connected [route-map MAP_NAME]
     .....

   Cisco applies route-map _before_ routes will exported to rip route
table.  In current Quagga's test implementation, `ripd' applies
route-map after routes are listed in the route table and before routes
will be announced to an interface (something like output filter). I
think it is not so clear, but it is draft and it may be changed at
future.

   Route-map statement (see Route Map) is needed to use route-map
functionality.

 - Route Map: match interface WORD
     This command match to incoming interface.  Notation of this match
     is different from Cisco. Cisco uses a list of interfaces - NAME1
     NAME2 ... NAMEN.  Ripd allows only one name (maybe will change in
     the future).  Next - Cisco means interface which includes next-hop
     of routes (it is somewhat similar to "ip next-hop" statement).
     Ripd means interface where this route will be sent. This
     difference is because "next-hop" of same routes which sends to
     different interfaces must be different. Maybe it'd be better to
     made new matches - say "match interface-out NAME" or something
     like that.

 - Route Map: match ip address WORD
 - Route Map: match ip address prefix-list WORD
     Match if route destination is permitted by access-list.

 - Route Map: match ip next-hop A.B.C.D
     Cisco uses here <access-list>, `ripd' IPv4 address. Match if route
     has this next-hop (meaning next-hop listed in the rip route table
     - "show ip rip")

 - Route Map: match metric <0-4294967295>
     This command match to the metric value of RIP updates.  For other
     protocol compatibility metric range is shown as <0-4294967295>.
     But for RIP protocol only the value range <0-16> make sense.

 - Route Map: set ip next-hop A.B.C.D
     This command set next hop value in RIPv2 protocol.  This command
     does not affect RIPv1 because there is no next hop field in the
     packet.

 - Route Map: set metric <0-4294967295>
     Set a metric for matched route when sending announcement.  The
     metric value range is very large for compatibility with other
     protocols.  For RIP, valid metric values are from 1 to 16.

RIP Authentication
==================

 - Interface command: ip rip authentication mode md5
 - Interface command: no ip rip authentication mode md5
     Set the interface with RIPv2 MD5 authentication.

 - Interface command: ip rip authentication mode text
 - Interface command: no ip rip authentication mode text
     Set the interface with RIPv2 simple password authentication.

 - Interface command: ip rip authentication string STRING
 - Interface command: no ip rip authentication string STRING
     RIP version 2 has simple text authentication.  This command sets
     authentication string.  The string must be shorter than 16
     characters.

 - Interface command: ip rip authentication key-chain KEY-CHAIN
 - Interface command: no ip rip authentication key-chain KEY-CHAIN
     Specifiy Keyed MD5 chain.

     !
     key chain test
      key 1
       key-string test
     !
     interface eth1
      ip rip authentication mode md5
      ip rip authentication key-chain test
     !

RIP Timers
==========

 - RIP command: timers basic UPDATE TIMEOUT GARBAGE
     RIP protocol has several timers.  User can configure those timers'
     values by `timers basic' command.

     The default settings for the timers are as follows:

        * The update timer is 30 seconds. Every update timer seconds,
          the RIP process is awakened to send an unsolicited Response
          message containing the complete routing table to all
          neighboring RIP routers.

        * The timeout timer is 180 seconds. Upon expiration of the
          timeout, the route is no longer valid; however, it is
          retained in the routing table for a short time so that
          neighbors can be notified that the route has been dropped.

        * The garbage collect timer is 120 seconds.  Upon expiration of
          the garbage-collection timer, the route is finally removed
          from the routing table.

     The `timers basic' command allows the the default values of the
     timers listed above to be changed.

 - RIP command: no timers basic
     The `no timers basic' command will reset the timers to the default
     settings listed above.

Show RIP Information
====================

   To display RIP routes.

 - Command: show ip rip
     Show RIP routes.

   The command displays all RIP routes. For routes that are received
through RIP, this command will display the time the packet was sent and
the tag information.  This command will also display this information
for routes redistributed into RIP.

 - Command: show ip protocols
     The command displays current RIP status.  It includes RIP timer,
     filtering, version, RIP enabled interface and RIP peer inforation.

     ripd> show ip protocols
     Routing Protocol is "rip"
       Sending updates every 30 seconds with +/-50%, next due in 35 seconds
       Timeout after 180 seconds, garbage collect after 120 seconds
       Outgoing update filter list for all interface is not set
       Incoming update filter list for all interface is not set
       Default redistribution metric is 1
       Redistributing: kernel connected
       Default version control: send version 2, receive version 2
         Interface        Send  Recv
       Routing for Networks:
         eth0
         eth1
         1.1.1.1
         203.181.89.241
       Routing Information Sources:
         Gateway          BadPackets BadRoutes  Distance Last Update

RIP Debug Commands
==================

   Debug for RIP protocol.

 - Command: debug rip events
     Debug rip events.

   `debug rip' will show RIP events.  Sending and receiving packets,
timers, and changes in interfaces are events shown with `ripd'.

 - Command: debug rip packet
     Debug rip packet.

   `debug rip packet' will display detailed information about the RIP
packets.  The origin and port number of the packet as well as a packet
dump is shown.

 - Command: debug rip zebra
     Debug rip between zebra communication.

   This command will show the communication between `ripd' and `zebra'.
The main information will include addition and deletion of paths to the
kernel and the sending and receiving of interface information.

 - Command: show debugging rip
     Display `ripd''s debugging option.

   `show debugging rip' will show all information currently set for ripd
debug.

RIPng
*****

   `ripngd' supports the RIPng protocol as described in RFC2080.  It's
an IPv6 reincarnation of the RIP protocol.

Invoking ripngd
===============

   There are no `ripngd' specific invocation options.  Common options
can be specified (see Common Invocation Options).

ripngd Configuration
====================

   Currently ripngd supports the following commands:

 - Command: router ripng
     Enable RIPng.

 - RIPng Command: flush_timer TIME
     Set flush timer.

 - RIPng Command: network NETWORK
     Set RIPng enabled interface by NETWORK

 - RIPng Command: network IFNAME
     Set RIPng enabled interface by IFNAME

 - RIPng Command: route NETWORK
     Set RIPng static routing announcement of NETWORK.

 - Command: router zebra
     This command is the default and does not appear in the
     configuration.  With this statement, RIPng routes go to the
     `zebra' daemon.

ripngd Terminal Mode Commands
=============================

 - Command: show ip ripng

 - Command: show debugging ripng

 - Command: debug ripng events

 - Command: debug ripng packet

 - Command: debug ripng zebra

ripngd Filtering Commands
=========================

 - Command: distribute-list ACCESS_LIST (in|out) IFNAME
     You can apply an access-list to the interface using the
     `distribute-list' command.  ACCESS_LIST is an access-list name.
     DIRECT is `in' or `out'.  If DIRECT is `in', the access-list is
     applied only to incoming packets.

          distribute-list local-only out sit1

OSPFv2
******

   OSPF version 2 is a routing protocol which described in RFC2328 -
`OSPF Version 2'.  OSPF is IGP (Interior Gateway Protocols).  Compared
with RIP, OSPF can provide scalable network support and faster
convergence time.  OSPF is widely used in large networks such as ISP
backbone and enterprise networks.

Configuring ospfd
=================

   There is no `ospfd' specific options.  Common options can be
specified (see Common Invocation Options) to `ospfd'.  `ospfd'
needs interface information from `zebra'.  So please make it sure
`zebra' is running before invoking `ospfd'.

   Like other daemons, `ospfd' configuration is done in OSPF specific
configuration file `ospfd.conf'.

OSPF router
===========

   To start OSPF process you have to specify the OSPF router.  As of
this writing, `ospfd' does not support multiple OSPF processes.

 - Command: router ospf
 - Command: no router ospf
     Enable or disable the OSPF process.  `ospfd' does not yet support
     multiple OSPF processes.  So you can not specify an OSPF process
     number.

 - OSPF Command: ospf router-id A.B.C.D
 - OSPF Command: no ospf router-id

 - OSPF Command: ospf abr-type TYPE
 - OSPF Command: no ospf abr-type TYPE
     TYPE can be cisco|ibm|shortcut|standard More information regarding
     the behaviour controlled by this command can be found in
     draft-ietf-ospf-abr-alt-05.txt and
     draft-ietf-ospf-shortcut-abr-02.txt Quote: "Though the definition
     of the Area Border Router (ABR) in the OSPF specification does not
     require a router with multiple attached areas to have a backbone
     connection, it is actually necessary to provide successful routing
     to the inter-area and external destinations. If this requirement
     is not met, all traffic destined for the areas not connected to
     such an ABR or out of the OSPF domain, is dropped.  This document
     describes alternative ABR behaviors implemented in Cisco and IBM
     routers."

 - OSPF Command: ospf rfc1583compatibility
 - OSPF Command: no ospf rfc1583compatibility
     This rfc2328, the sucessor to rfc1583, suggests according to
     section G.2 (changes) in section 16.4 a change to the path
     preference algorithm that prevents possible routing loops that
     were possible in the old version of OSPFv2. More specifically it
     demands that inter-area paths and intra-area path are now of equal
     preference but still both preferred to external paths.

 - OSPF Command: passive interface INTERFACE
 - OSPF Command: no passive interface INTERFACE

 - OSPF Command: timers spf <0-4294967295> <0-4294967295>
 - OSPF Command: no timers spf

 - OSPF Command: refresh group-limit <0-10000>
 - OSPF Command: refresh per-slice <0-10000>
 - OSPF Command: refresh age-diff <0-10000>

 - OSPF Command: auto-cost refrence-bandwidth <1-4294967>
 - OSPF Command: no auto-cost refrence-bandwidth

 - OSPF Command: network A.B.C.D/M area A.B.C.D
 - OSPF Command: network A.B.C.D/M area <0-4294967295>
 - OSPF Command: no network A.B.C.D/M area A.B.C.D
 - OSPF Command: no network A.B.C.D/M area <0-4294967295>
     This command specifies the OSPF enabled interface.  If the
     interface has an address of 10.0.0.1/8 then the command below
     provides network information to the ospf routers
          router ospf
           network 10.0.0.0/8 area 0
     the network command's mask length should be the same as the
     interface address's mask.

OSPF area
=========

 - OSPF Command: area A.B.C.D range A.B.C.D/M
 - OSPF Command: area <0-4294967295> range A.B.C.D/M
 - OSPF Command: no area A.B.C.D range A.B.C.D/M
 - OSPF Command: no area <0-4294967295> range A.B.C.D/M

 - OSPF Command: area A.B.C.D range IPV4_PREFIX suppress
 - OSPF Command: no area A.B.C.D range IPV4_PREFIX suppress
 - OSPF Command: area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
 - OSPF Command: no area A.B.C.D range IPV4_PREFIX substitute
IPV4_PREFIX

 - OSPF Command: area A.B.C.D virtual-link A.B.C.D
 - OSPF Command: area <0-4294967295> virtual-link A.B.C.D
 - OSPF Command: no area A.B.C.D virtual-link A.B.C.D
 - OSPF Command: no area <0-4294967295> virtual-link A.B.C.D

 - OSPF Command: area A.B.C.D shortcut
 - OSPF Command: area <0-4294967295> shortcut
 - OSPF Command: no area A.B.C.D shortcut
 - OSPF Command: no area <0-4294967295> shortcut

 - OSPF Command: area A.B.C.D stub
 - OSPF Command: area <0-4294967295> stub
 - OSPF Command: no area A.B.C.D stub
 - OSPF Command: no area <0-4294967295> stub

 - OSPF Command: area A.B.C.D stub no-summary
 - OSPF Command: area <0-4294967295> stub no-summary
 - OSPF Command: no area A.B.C.D stub no-summary
 - OSPF Command: no area <0-4294967295> stub no-summary

 - OSPF Command: area A.B.C.D default-cost <0-16777215>
 - OSPF Command: no area A.B.C.D default-cost <0-16777215>

 - OSPF Command: area A.B.C.D export-list NAME
 - OSPF Command: area <0-4294967295> export-list NAME
 - OSPF Command: no area A.B.C.D export-list NAME
 - OSPF Command: no area <0-4294967295> export-list NAME

 - OSPF Command: area A.B.C.D import-list NAME
 - OSPF Command: area <0-4294967295> import-list NAME
 - OSPF Command: no area A.B.C.D import-list NAME
 - OSPF Command: no area <0-4294967295> import-list NAME

 - OSPF Command: area A.B.C.D authentication
 - OSPF Command: area <0-4294967295> authentication
 - OSPF Command: no area A.B.C.D authentication
 - OSPF Command: no area <0-4294967295> authentication

 - OSPF Command: area A.B.C.D authentication message-digest
 - OSPF Command: area <0-4294967295> authentication message-digest

OSPF interface
==============

 - Interface Command: ip ospf authentication-key AUTH_KEY
 - Interface Command: no ip ospf authentication-key
     Set OSPF authentication key to a simple password.  After setting
     AUTH_KEY, all OSPF packets are authenticated. AUTH_KEY has length
     up to 8 chars.

 - Interface Command: ip ospf message-digest-key KEYID md5 KEY
 - Interface Command: no ip ospf message-digest-key
     Set OSPF authentication key to a cryptographic password.  The
     cryptographic algorithm is MD5.  KEYID identifies secret key used
     to create the message digest.  KEY is the actual message digest
     key up to 16 chars.

 - Interface Command: ip ospf cost <1-65535>
 - Interface Command: no ip ospf cost
     Set link cost for the specified interface.  The cost value is set
     to router-LSA's metric field and used for SPF calculation.

 - Interface Command: ip ospf dead-interval <1-65535>
 - Interface Command: no ip ospf dead-interval
     Set number of seconds for RouterDeadInterval timer value used for
     Wait Timer and Inactivity Timer.  This value must be the same for
     all routers attached to a common network.  The default value is 40
     seconds.

 - Interface Command: ip ospf hello-interval <1-65535>
 - Interface Command: no ip ospf hello-interval
     Set number of seconds for HelloInterval timer value.  Setting this
     value, Hello packet will be sent every timer value seconds on the
     specified interface.  This value must be the same for all routers
     attached to a common network.  The default value is 10 seconds.

 - Interface Command: ip ospf network
(broadcast|non-broadcast|point-to-multipoint|point-to-point)
 - Interface Command: no ip ospf network
     Set explicitly network type for specifed interface.

 - Interface Command: ip ospf priority <0-255>
 - Interface Command: no ip ospf priority
     Set RouterPriority integer value.  Setting higher value, router
     will be more eligible to become Designated Router.  Setting the
     value to 0, router is no longer eligible to Designated Router.
     The default value is 1.

 - Interface Command: ip ospf retransmit-interval <1-65535>
 - Interface Command: no ip ospf retransmit interval
     Set number of seconds for RxmtInterval timer value.  This value is
     used when retransmitting Database Description and Link State
     Request packets.  The default value is 5 seconds.

 - Interface Command: ip ospf transmit-delay
 - Interface Command: no ip ospf transmit-delay
     Set number of seconds for InfTransDelay value.  LSAs' age should be
     incremented by this value when transmitting.  The default value is
     1 seconds.

Redistribute routes to OSPF
===========================

 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
ROUTE-MAP
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
metric-type (1|2)
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
metric-type (1|2) route-map WORD
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp) metric
<0-16777214>
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp) metric
<0-16777214> route-map WORD
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
metric-type (1|2) metric <0-16777214>
 - OSPF Command: redistribute (kernel|connected|static|rip|bgp)
metric-type (1|2) metric <0-16777214> route-map WORD
 - OSPF Command: no redistribute (kernel|connected|static|rip|bgp)

 - OSPF Command: default-information originate
 - OSPF Command: default-information originate metric <0-16777214>
 - OSPF Command: default-information originate metric <0-16777214>
metric-type (1|2)
 - OSPF Command: default-information originate metric <0-16777214>
metric-type (1|2) route-map WORD
 - OSPF Command: default-information originate always
 - OSPF Command: default-information originate always metric
<0-16777214>
 - OSPF Command: default-information originate always metric
<0-16777214> metric-type (1|2)
 - OSPF Command: default-information originate always metric
<0-16777214> metric-type (1|2) route-map WORD
 - OSPF Command: no default-information originate

 - OSPF Command: distribute-list NAME out
(kernel|connected|static|rip|ospf
 - OSPF Command: no distribute-list NAME out
(kernel|connected|static|rip|ospf

 - OSPF Command: default-metric <0-16777214>
 - OSPF Command: no default-metric

 - OSPF Command: distance <1-255>
 - OSPF Command: no distance <1-255>

 - OSPF Command: distance ospf (intra-area|inter-area|external) <1-255>
 - OSPF Command: no distance ospf

 - Command: router zebra
 - Command: no router zebra

Showing OSPF information
========================

 - Command: show ip ospf

 - Command: show ip ospf interface [INTERFACE]

 - Command: show ip ospf neighbor
 - Command: show ip ospf neighbor INTERFACE
 - Command: show ip ospf neighbor detail
 - Command: show ip ospf neighbor INTERFACE detail

 - Command: show ip ospf database

 - Command: show ip ospf database
(asbr-summary|external|network|router|summary)
 - Command: show ip ospf database
(asbr-summary|external|network|router|summary) LINK-STATE-ID
 - Command: show ip ospf database
(asbr-summary|external|network|router|summary) LINK-STATE-ID adv-router
ADV-ROUTER
 - Command: show ip ospf database
(asbr-summary|external|network|router|summary) adv-router ADV-ROUTER
 - Command: show ip ospf database
(asbr-summary|external|network|router|summary) LINK-STATE-ID
self-originate
 - Command: show ip ospf database
(asbr-summary|external|network|router|summary) self-originate

 - Command: show ip ospf database max-age

 - Command: show ip ospf database self-originate

 - Command: show ip ospf refresher

 - Command: show ip ospf route

Debugging OSPF
==============

 - Command: debug ospf packet
(hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
 - Command: no debug ospf packet
(hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]

 - Command: debug ospf ism
 - Command: debug ospf ism (status|events|timers)
 - Command: no debug ospf ism
 - Command: no debug ospf ism (status|events|timers)

 - Command: debug ospf nsm
 - Command: debug ospf nsm (status|events|timers)
 - Command: no debug ospf nsm
 - Command: no debug ospf nsm (status|events|timers)

 - Command: debug ospf lsa
 - Command: debug ospf lsa (generate|flooding|refresh)
 - Command: no debug ospf lsa
 - Command: no debug ospf lsa (generate|flooding|refresh)

 - Command: debug ospf zebra
 - Command: debug ospf zebra (interface|redistribute)
 - Command: no debug ospf zebra
 - Command: no debug ospf zebra (interface|redistribute)

 - Command: show debugging ospf

OSPFv3
******

   `ospf6d' is a daemon support OSPF version 3 for IPv6 network.  OSPF
for IPv6 is described in RFC2740.

OSPF6 router
============

 - Command: router ospf6

 - OSPF6 Command: router-id A.B.C.D
     Set router's Router-ID.

 - OSPF6 Command: interface IFNAME area AREA
     Bind interface to specified area, and start sending OSPF packets.
     AREA can be specified as 0.

OSPF6 area
==========

   Area support for OSPFv3 is not yet implemented.

OSPF6 interface
===============

 - Interface Command: ipv6 ospf6 cost COST
     Sets interface's output cost.  Default value is 1.

 - Interface Command: ipv6 ospf6 hello-interval HELLOINTERVAL
     Sets interface's Hello Interval.  Default 40

 - Interface Command: ipv6 ospf6 dead-interval DEADINTERVAL
     Sets interface's Router Dead Interval.  Default value is 40.

 - Interface Command: ipv6 ospf6 retransmit-interval RETRANSMITINTERVAL
     Sets interface's Rxmt Interval.  Default value is 5.

 - Interface Command: ipv6 ospf6 priority PRIORITY
     Sets interface's Router Priority.  Default value is 1.

 - Interface Command: ipv6 ospf6 transmit-delay TRANSMITDELAY
     Sets interface's Inf-Trans-Delay.  Default value is 1.

Redistribute routes to OSPF6
============================

 - OSPF6 Command: redistribute static
 - OSPF6 Command: redistribute connected
 - OSPF6 Command: redistribute ripng

Showing OSPF6 information
=========================

 - Command: show ipv6 ospf6 [INSTANCE_ID]
     INSTANCE_ID is an optional OSPF instance ID. To see router ID and
     OSPF instance ID, simply type "show ipv6 ospf6 <cr>".

 - Command: show ipv6 ospf6 database
     This command shows LSA database summary.  You can specify the type
     of LSA.

 - Command: show ipv6 ospf6 interface
     To see OSPF interface configuration like costs.

 - Command: show ipv6 ospf6 neighbor
     Shows state and chosen (Backup) DR of neighbor.

 - Command: show ipv6 ospf6 request-list A.B.C.D
     Shows requestlist of neighbor.

 - Command: show ipv6 route ospf6
     This command shows internal routing table.

BGP
***

   BGP stands for a Border Gateway Protocol.  The lastest BGP version
is 4.  It is referred as BGP-4.  BGP-4 is one of the Exterior Gateway
Protocols and de-fact standard of Inter Domain routing protocol.  BGP-4
is described in `RFC1771' - `A Border Gateway Protocol 4 (BGP-4)'.

   Many extentions are added to `RFC1771'.  `RFC2858' - `Multiprotocol
Extensions for BGP-4' provide multiprotocol support to BGP-4.

Starting BGP
============

   Default configuration file of `bgpd' is `bgpd.conf'.  `bgpd'
searches the current directory first then /usr/local/etc/bgpd.conf.
All of bgpd's command must be configured in `bgpd.conf'.

   `bgpd' specific invocation options are described below.  Common
options may also be specified (see Common Invocation Options).

`-p PORT'
`--bgp_port=PORT'
     Set the bgp protocol's port number.

`-r'
`--retain'
     When program terminates, retain BGP routes added by zebra.

BGP router
==========

   First of all you must configure BGP router with `router bgp'
command.  To configure BGP router, you need AS number.  AS number is an
identification of autonomous system.  BGP protocol uses the AS number
for detecting whether the BGP connection is internal one or external
one.

 - Command: router bgp ASN
     Enable a BGP protocol process with the specified ASN.  After this
     statement you can input any `BGP Commands'.  You can not create
     different BGP process under different ASN without specifying
     `multiple-instance' (see Multiple instance).

 - Command: no router bgp ASN
     Destroy a BGP protocol process with the specified ASN.

 - BGP: bgp router-id A.B.C.D
     This command specifies the router-ID.  If `bgpd' connects to
     `zebra' it gets interface and address information.  In that case
     default router ID value is selected as the largest IP Address of
     the interfaces.  When `router zebra' is not enabled `bgpd' can't
     get interface information so `router-id' is set to 0.0.0.0.  So
     please set router-id by hand.

BGP distance
------------

 - BGP: distance bgp <1-255> <1-255> <1-255>
     This command change distance value of BGP.  Each argument is
     distance value for external routes, internal routes and local
     routes.

 - BGP: distance <1-255> A.B.C.D/M
 - BGP: distance <1-255> A.B.C.D/M WORD
     This command set distance value to

BGP decision process
--------------------

1. Weight check

2. Local preference check.

3. Local route check.

4. AS path length check.

5. Origin check.

6. MED check.

BGP network
===========

BGP route
---------

 - BGP: network A.B.C.D/M
     This command adds the announcement network.
          router bgp 1
           network 10.0.0.0/8
     This configuration example says that network 10.0.0.0/8 will
     be announced to all neighbors.  Some vendors' routers don't
     advertise routes if they aren't present in their IGP routing
     tables; `bgp' doesn't care about IGP routes when announcing its
     routes.

 - BGP: no network A.B.C.D/M

Route Aggregation
-----------------

 - BGP: aggregate-address A.B.C.D/M
     This command specifies an aggregate address.

 - BGP: aggregate-address A.B.C.D/M as-set
     This command specifies an aggregate address.  Resulting routes
     inlucde AS set.

 - BGP: aggregate-address A.B.C.D/M summary-only
     This command specifies an aggregate address.  Aggreated routes will
     not be announce.

 - BGP: no aggregate-address A.B.C.D/M

Redistribute to BGP
-------------------

 - BGP: redistribute kernel
     Redistribute kernel route to BGP process.

 - BGP: redistribute static
     Redistribute static route to BGP process.

 - BGP: redistribute connected
     Redistribute connected route to BGP process.

 - BGP: redistribute rip
     Redistribute RIP route to BGP process.

 - BGP: redistribute ospf
     Redistribute OSPF route to BGP process.

BGP Peer
========

Defining Peer
-------------

 - BGP: neighbor PEER remote-as ASN
     Creates a new neighbor whose remote-as is ASN.  PEER can be an
     IPv4 address or an IPv6 address.
          router bgp 1
           neighbor 10.0.0.1 remote-as 2
     In this case my router, in AS-1, is trying to peer with AS-2
     at 10.0.0.1.

     This command must be the first command used when configuring a
     neighbor.  If the remote-as is not specified, `bgpd' will complain
     like this:
          can't find neighbor 10.0.0.1

BGP Peer commands
-----------------

   In a `router bgp' clause there are neighbor specific configurations
required.

 - BGP: neighbor PEER shutdown
 - BGP: no neighbor PEER shutdown
     Shutdown the peer.  We can delete the neighbor's configuration by
     `no neighbor PEER remote-as AS-NUMBER' but all configuration of
     the neighbor will be deleted.  When you want to preserve the
     configuration, but want to drop the BGP peer, use this syntax.

 - BGP: neighbor PEER ebgp-multihop
 - BGP: no neighbor PEER ebgp-multihop

 - BGP: neighbor PEER description ...
 - BGP: no neighbor PEER description ...
     Set description of the peer.

 - BGP: neighbor PEER version VERSION
     Set up the neighbor's BGP version.  VERSION can be 4, 4+ or 4-.
     BGP version 4 is the default value used for BGP peering.  BGP
     version 4+ means that the neighbor supports Multiprotocol
     Extensions for BGP-4.  BGP version 4- is similar but the neighbor
     speaks the old Internet-Draft revision 00's Multiprotocol
     Extensions for BGP-4.  Some routing software is still using this
     version.

 - BGP: neighbor PEER interface IFNAME
 - BGP: no neighbor PEER interface IFNAME
     When you connect to a BGP peer over an IPv6 link-local address,
     you have to specify the IFNAME of the interface used for the
     connection.

 - BGP: neighbor PEER next-hop-self
 - BGP: no neighbor PEER next-hop-self
     This command specifies an announced route's nexthop as being
     equivalent to the address of the bgp router.

 - BGP: neighbor PEER update-source
 - BGP: no neighbor PEER update-source

 - BGP: neighbor PEER default-originate
 - BGP: no neighbor PEER default-originate
     `bgpd''s default is to not announce the default route (0.0.0.0/0)
     even it is in routing table.  When you want to announce default
     routes to the peer, use this command.

 - BGP: neighbor PEER port PORT
 - BGP: neighbor PEER port PORT

 - BGP: neighbor PEER send-community
 - BGP: neighbor PEER send-community

 - BGP: neighbor PEER weight WEIGHT
 - BGP: no neighbor PEER weight WEIGHT
     This command specifies a default WEIGHT value for the neighbor's
     routes.

 - BGP: neighbor PEER maximum-prefix NUMBER
 - BGP: no neighbor PEER maximum-prefix NUMBER

Peer filtering
--------------

 - BGP: neighbor PEER distribute-list NAME [in|out]
     This command specifies a distribute-list for the peer.  DIRECT is
     `in' or `out'.

 - BGP command: neighbor PEER prefix-list NAME [in|out]

 - BGP command: neighbor PEER filter-list NAME [in|out]

 - BGP: neighbor PEER route-map NAME [in|out]
     Apply a route-map on the neighbor.  DIRECT must be `in' or `out'.

BGP Peer Group
==============

 - BGP: neighbor WORD peer-group
     This command defines a new peer group.

 - BGP: neighbor PEER peer-group WORD
     This command bind specific peer to peer group WORD.

BGP Address Family
==================

Autonomous System
=================

   AS (Autonomous System) is one of the essential element of BGP.  BGP
is a distance vector routing protocol.  AS framework provides distance
vector metric and loop detection to BGP.  `RFC1930' - `Guidelines for
creation, selection, and registration of an Autonomous System (AS)'
describes how to use AS.

   AS number is tow octet digita value.  So the value range is from 1
to 65535.  AS numbers 64512 through 65535 are defined as private AS
numbers.  Private AS numbers must not to be advertised in the global
Internet.

AS Path Regular Expression
--------------------------

   AS path regular expression can be used for displaying BGP routes and
AS path access list.  AS path regular expression is based on `POSIX
1003.2' regular expressions.  Following description is just a subset of
`POSIX' regular expression.  User can use full `POSIX' regular
expression.  Adding to that special character '_' is added for AS path
regular expression.

`.'
     Matches any single character.

`*'
     Matches 0 or more occurrences of pattern.

`+'
     Matches 1 or more occurrences of pattern.

`?'
     Match 0 or 1 occurrences of pattern.

`^'
     Matches the beginning of the line.

`$'
     Matches the end of the line.

`_'
     Character `_' has special meanings in AS path regular expression.
     It matches to space and comma , and AS set delimiter { and } and AS
     confederation delimiter `(' and `)'.  And it also matches to the
     beginning of the line and the end of the line.  So `_' can be used
     for AS value boundaries match.  `show ip bgp regexp _7675_'
     matches to all of BGP routes which as AS number include 7675.

Display BGP Routes by AS Path
-----------------------------

   To show BGP routes which has specific AS path information `show ip
bgp' command can be used.

 - Command: show ip bgp regexp LINE
     This commands display BGP routes that matches AS path regular
     expression LINE.

AS Path Access List
-------------------

   AS path access list is user defined AS path.

 - Command: ip as-path access-list WORD {permit|deny} LINE
     This command defines a new AS path access list.

 - Command: no ip as-path access-list WORD
 - Command: no ip as-path access-list WORD {permit|deny} LINE

Using AS Path in Route Map
--------------------------

 - Route Map: match as-path WORD

 - Route Map: set as-path prepend AS-PATH

Private AS Numbers
------------------

BGP Communities Attribute
=========================

   BGP communities attribute is widely used for implementing policy
routing.  Network operators can manipulate BGP communities attribute
based on their network policy.  BGP communities attribute is defined in
`RFC1997' - `BGP Communities Attribute' and `RFC1998' - `An Application
of the BGP Community Attribute in Multi-home Routing'.  It is an
optional transitive attribute, therefore local policy can travel
through different autonomous system.

   Communities attribute is a set of communities values.  Each
communities value is 4 octet long.  The following format is used to
define communities value.

`AS:VAL'
     This format represents 4 octet communities value.  `AS' is high
     order 2 octet in digit format.  `VAL' is low order 2 octet in
     digit format.  This format is useful to define AS oriented policy
     value.  For example, `7675:80' can be used when AS 7675 wants to
     pass local policy value 80 to neighboring peer.

`internet'
     `internet' represents well-known communities value 0.

`no-export'
     `no-export' represents well-known communities value `NO_EXPORT'
     (0xFFFFFF01).  All routes carry this value must not be advertised
     to outside a BGP confederation boundary.  If neighboring BGP peer
     is part of BGP confederation, the peer is considered as inside a
     BGP confederation boundary, so the route will be announced to the
     peer.

`no-advertise'
     `no-advertise' represents well-known communities value
     `NO_ADVERTISE'
     (0xFFFFFF02).  All routes carry this value must not be advertise
     to other BGP peers.

`local-AS'
     `local-AS' represents well-known communities value
     `NO_EXPORT_SUBCONFED' (0xFFFFFF03).  All routes carry this value
     must not be advertised to external BGP peers.  Even if the
     neighboring router is part of confederation, it is considered as
     external BGP peer, so the route will not be announced to the peer.

   When BGP communities attribute is received, duplicated communities
value in the communities attribute is ignored and each communities
values are sorted in numerical order.

BGP Community Lists
-------------------

   BGP community list is a user defined BGP communites attribute list.
BGP community list can be used for matching or manipulating BGP
communities attribute in updates.

   There are two types of community list.  One is standard community
list and another is expanded community list.  Standard community list
defines communities attribute.  Expanded community list defines
communities attribute string with regular expression.  Standard
community list is compiled into binary format when user define it.
Standard community list will be directly compared to BGP communities
attribute in BGP updates.  Therefore the comparison is faster than
expanded community list.

 - Command: ip community-list standard NAME {permit|deny} COMMUNITY
     This command defines a new standard community list.  COMMUNITY is
     communities value.  The COMMUNITY is compiled into community
     structure.  We can define multiple community list under same name.
     In that case match will happen user defined order.  Once the
     community list matches to communities attribute in BGP updates it
     return permit or deny by the community list definition.  When
     there is no matched entry, deny will be returned.  When COMMUNITY
     is empty it matches to any routes.

 - Command: ip community-list expanded NAME {permit|deny} LINE
     This command defines a new expanded community list.  LINE is a
     string expression of communities attribute.  LINE can include
     regular expression to match communities attribute in BGP updates.

 - Command: no ip community-list NAME
 - Command: no ip community-list standard NAME
 - Command: no ip community-list expanded NAME
     These commands delete community lists specified by NAME.  All of
     community lists shares a single name space.  So community lists
     can be removed simpley specifying community lists name.

 - Command: show ip community-list
 - Command: show ip community-list NAME
     This command display current community list information.  When
     NAME is specified the specified community list's information is
     shown.

          # show ip community-list
          Named Community standard list CLIST
              permit 7675:80 7675:100 no-export
              deny internet
          Named Community expanded list EXPAND
              permit :

          # show ip community-list CLIST
          Named Community standard list CLIST
              permit 7675:80 7675:100 no-export
              deny internet

Numbered BGP Community Lists
----------------------------

   When number is used for BGP community list name, the number has
special meanings.  Community list number in the range from 1 and 99 is
standard community list.  Community list number in the range from 100
to 199 is expanded community list.  These community lists are called as
numbered community lists.  On the other hand normal community lists is
called as named community lists.

 - Command: ip community-list <1-99> {permit|deny} COMMUNITY
     This command defines a new community list.  <1-99> is standard
     community list number.  Community list name within this range
     defines standard community list.  When COMMUNITY is empty it
     matches to any routes.

 - Command: ip community-list <100-199> {permit|deny} COMMUNITY
     This command defines a new community list.  <100-199> is expanded
     community list number.  Community list name within this range
     defines expanded community list.

 - Command: ip community-list NAME {permit|deny} COMMUNITY
     When community list type is not specifed, the community list type
     is automatically detected.  If COMMUNITY can be compiled into
     communities attribute, the community list is defined as a standard
     community list.  Otherwise it is defined as an expanded community
     list.  This feature is left for backward compability.  Use of this
     feature is not recommended.

BGP Community in Route Map
--------------------------

   In Route Map (see Route Map), we can match or set BGP
communities attribute.  Using this feature network operator can
implement their network policy based on BGP communities attribute.

   Following commands can be used in Route Map.

 - Route Map: match community WORD
 - Route Map: match community WORD exact-match
     This command perform match to BGP updates using community list
     WORD.  When the one of BGP communities value match to the one of
     communities value in community list, it is match.  When
     `exact-match' keyword is spcified, match happen only when BGP
     updates have completely same communities value specified in the
     community list.

 - Route Map: set community none
 - Route Map: set community COMMUNITY
 - Route Map: set community COMMUNITY additive
     This command manipulate communities value in BGP updates.  When
     `none' is specified as communities value, it removes entire
     communities attribute from BGP updates.  When COMMUNITY is not
     `none', specified communities value is set to BGP updates.  If BGP
     updates already has BGP communities value, the existing BGP
     communities value is replaced with specified COMMUNITY value.
     When `additive' keyword is specified, COMMUNITY is appended to the
     existing communities value.

 - Route Map: set comm-list WORD delete
     This command remove communities value from BGP communities
     attribute.  The WORD is community list name.  When BGP route's
     communities value matches to the community list WORD, the
     communities value is removed.  When all of communities value is
     removed eventually, the BGP update's communities attribute is
     completely removed.