--- /dev/null
--- /dev/null
++OSPF API Documentation
++======================
++
++Disclaimer
++----------
++
++The OSPF daemon contains an API for application access to the LSA
++database. This API was created by Ralph Keller, originally as patch for
++Zebra. Unfortunately, the page containing documentation of the API is no
++longer online. This page is an attempt to recreate documentation for the
++API (with lots of help of the WayBackMachine)
++
++Introduction
++------------
++
++This page describes an API that allows external applications to access
++the link-state database (LSDB) of the OSPF daemon. The implementation is
++based on the OSPF code from FRRouting (forked from Quagga and formerly
++Zebra) routing protocol suite and is subject to the GNU General Public
++License. The OSPF API provides you with the following functionality:
++
++- Retrieval of the full or partial link-state database of the OSPF
++ daemon. This allows applications to obtain an exact copy of the LSDB
++ including router LSAs, network LSAs and so on. Whenever a new LSA
++ arrives at the OSPF daemon, the API module immediately informs the
++ application by sending a message. This way, the application is always
++ synchronized with the LSDB of the OSPF daemon.
++- Origination of own opaque LSAs (of type 9, 10, or 11) which are then
++ distributed transparently to other routers within the flooding scope
++ and received by other applications through the OSPF API.
++
++Opaque LSAs, which are described in RFC 2370 , allow you to distribute
++application-specific information within a network using the OSPF
++protocol. The information contained in opaque LSAs is transparent for
++the routing process but it can be processed by other modules such as
++traffic engineering (e.g., MPLS-TE).
++
++Architecture
++------------
++
++The following picture depicts the architecture of the Quagga/Zebra
++protocol suite. The OSPF daemon is extended with opaque LSA capabilities
++and an API for external applications. The OSPF core module executes the
++OSPF protocol by discovering neighbors and exchanging neighbor state.
++The opaque module, implemented by Masahiko Endo, provides functions to
++exchange opaque LSAs between routers. Opaque LSAs can be generated by
++several modules such as the MPLS-TE module or the API server module.
++These modules then invoke the opaque module to flood their data to
++neighbors within the flooding scope.
++
++The client, which is an application potentially running on a different
++node than the OSPF daemon, links against the OSPF API client library.
++This client library establishes a socket connection with the API server
++module of the OSPF daemon and uses this connection to retrieve LSAs and
++originate opaque LSAs.
++
++.. figure:: ../figures/ospf_api_architecture.png
++ :alt: image
++
++ image
++
++The OSPF API server module works like any other internal opaque module
++(such as the MPLS-TE module), but listens to connections from external
++applications that want to communicate with the OSPF daemon. The API
++server module can handle multiple clients concurrently.
++
++One of the main objectives of the implementation is to make as little
++changes to the existing Zebra code as possible.
++
++Installation & Configuration
++----------------------------
++
++Download FRRouting and unpack
++
++Configure your frr version (note that --enable-opaque-lsa also enables
++the ospfapi server and ospfclient).
++
++::
++
++ % update-autotools
++ % sh ./configure --enable-opaque-lsa
++ % make
++
++This should also compile the client library and sample application in
++ospfclient.
++
++Make sure that you have enabled opaque LSAs in your configuration. Add
++the ospf opaque-lsa statement to your ospfd.conf:
++
++::
++
++ ! -*- ospf -*-
++ !
++ ! OSPFd sample configuration file
++ !
++ !
++ hostname xxxxx
++ password xxxxx
++
++ router ospf
++ router-id 10.0.0.1
++ network 10.0.0.1/24 area 1
++ neighbor 10.0.0.2
++ network 10.0.1.2/24 area 1
++ neighbor 10.0.1.1
++ ospf opaque-lsa <============ add this statement!
++
++Usage
++-----
++
++In the following we describe how you can use the sample application to
++originate opaque LSAs. The sample application first registers with the
++OSPF daemon the opaque type it wants to inject and then waits until the
++OSPF daemon is ready to accept opaque LSAs of that type. Then the client
++application originates an opaque LSA, waits 10 seconds and then updates
++the opaque LSA with new opaque data. After another 20 seconds, the
++client application deletes the opaque LSA from the LSDB. If the clients
++terminates unexpectedly, the OSPF API module will remove all the opaque
++LSAs that the application registered. Since the opaque LSAs are flooded
++to other routers, we will see the opaque LSAs in all routers according
++to the flooding scope of the opaque LSA.
++
++We have a very simple demo setup, just two routers connected with an ATM
++point-to-point link. Start the modified OSPF daemons on two adjacent
++routers. First run on msr2:
++
++::
++
++ > msr2:/home/keller/ospfapi/zebra/ospfd# ./ospfd -f /usr/local/etc/ospfd.conf
++
++And on the neighboring router msr3:
++
++::
++
++ > msr3:/home/keller/ospfapi/zebra/ospfd# ./ospfd -f /usr/local/etc/ospfd.conf
++
++Now the two routers form adjacency and start exchanging their databases.
++Looking at the OSPF daemon of msr2 (or msr3), you see this:
++
++::
++
++ ospfd> show ip ospf database
++
++ OSPF Router with ID (10.0.0.1)
++
++ Router Link States (Area 0.0.0.1)
++
++ Link ID ADV Router Age Seq# CkSum Link count
++ 10.0.0.1 10.0.0.1 55 0x80000003 0xc62f 2
++ 10.0.0.2 10.0.0.2 55 0x80000003 0xe3e4 3
++
++ Net Link States (Area 0.0.0.1)
++
++ Link ID ADV Router Age Seq# CkSum
++ 10.0.0.2 10.0.0.2 60 0x80000001 0x5fcb
++
++Now we start the sample main application that originates an opaque LSA.
++
++::
++
++ > cd ospfapi/apiclient
++ > ./main msr2 10 250 20 0.0.0.0 0.0.0.1
++
++This originates an opaque LSA of type 10 (area local), with opaque type
++250 (experimental), opaque id of 20 (chosen arbitrarily), interface
++address 0.0.0.0 (which is used only for opaque LSAs type 9), and area
++0.0.0.1
++
++Again looking at the OSPF database you see:
++
++::
++
++ ospfd> show ip ospf database
++
++ OSPF Router with ID (10.0.0.1)
++
++ Router Link States (Area 0.0.0.1)
++
++ Link ID ADV Router Age Seq# CkSum Link count
++ 10.0.0.1 10.0.0.1 437 0x80000003 0xc62f 2
++ 10.0.0.2 10.0.0.2 437 0x80000003 0xe3e4 3
++
++ Net Link States (Area 0.0.0.1)
++
++ Link ID ADV Router Age Seq# CkSum
++ 10.0.0.2 10.0.0.2 442 0x80000001 0x5fcb
++
++ Area-Local Opaque-LSA (Area 0.0.0.1)
++
++ Opaque-Type/Id ADV Router Age Seq# CkSum
++ 250.0.0.20 10.0.0.1 0 0x80000001 0x58a6 <=== opaque LSA
++
++You can take a closer look at this opaque LSA:
++
++::
++
++ ospfd> show ip ospf database opaque-area
++
++ OSPF Router with ID (10.0.0.1)
++
++
++ Area-Local Opaque-LSA (Area 0.0.0.1)
++
++ LS age: 4
++ Options: 66
++ LS Type: Area-Local Opaque-LSA
++ Link State ID: 250.0.0.20 (Area-Local Opaque-Type/ID)
++ Advertising Router: 10.0.0.1
++ LS Seq Number: 80000001
++ Checksum: 0x58a6
++ Length: 24
++ Opaque-Type 250 (Private/Experimental)
++ Opaque-ID 0x14
++ Opaque-Info: 4 octets of data
++ Added using OSPF API: 4 octets of opaque data
++ Opaque data: 1 0 0 0 <==== counter is 1
++
++Note that the main application updates the opaque LSA after 10 seconds,
++then it looks as follows:
++
++::
++
++ ospfd> show ip ospf database opaque-area
++
++ OSPF Router with ID (10.0.0.1)
++
++
++ Area-Local Opaque-LSA (Area 0.0.0.1)
++
++ LS age: 1
++ Options: 66
++ LS Type: Area-Local Opaque-LSA
++ Link State ID: 250.0.0.20 (Area-Local Opaque-Type/ID)
++ Advertising Router: 10.0.0.1
++ LS Seq Number: 80000002
++ Checksum: 0x59a3
++ Length: 24
++ Opaque-Type 250 (Private/Experimental)
++ Opaque-ID 0x14
++ Opaque-Info: 4 octets of data
++ Added using OSPF API: 4 octets of opaque data
++ Opaque data: 2 0 0 0 <==== counter is now 2
++
++Note that the payload of the opaque LSA has changed as you can see
++above.
++
++Then, again after another 20 seconds, the opaque LSA is flushed from the
++LSDB.
++
++Important note:
++^^^^^^^^^^^^^^^
++
++In order to originate an opaque LSA, there must be at least one active
++opaque-capable neighbor. Thus, you cannot originate opaque LSAs of no
++neighbors are present. If you try to originate even so no neighbor is
++ready, you will receive a not ready error message. The reason for this
++restriction is that it might be possible that some routers have an
++identical opaque LSA from a previous origination in their LSDB that
++unfortunately could not be flushed due to a crash, and now if the router
++comes up again and starts originating a new opaque LSA, the new opaque
++LSA is considered older since it has a lower sequence number and is
++ignored by other routers (that consider the stalled opaque LSA as more
++recent). However, if the originating router first synchronizes the
++database before originating opaque LSAs, it will detect the older opaque
++LSA and can flush it first.
++
++Protocol and Message Formats
++----------------------------
++
++If you are developing your own client application and you don't want to
++make use of the client library (due to the GNU license restriction or
++whatever reason), you can implement your own client-side message
++handling. The OSPF API uses two connections between the client and the
++OSPF API server: One connection is used for a synchronous request /reply
++protocol and another connection is used for asynchronous notifications
++(e.g., LSA update, neighbor status change).
++
++Each message begins with the following header:
++
++.. figure:: ../figures/ospf_api_msghdr.png
++ :alt: image
++
++ image
++
++The message type field can take one of the following values:
++
+++-------------------------------+---------+
++| Messages to OSPF deamon | Value |
+++===============================+=========+
++| MSG\_REGISTER\_OPAQUETYPE | 1 |
+++-------------------------------+---------+
++| MSG\_UNREGISTER\_OPAQUETYPE | 2 |
+++-------------------------------+---------+
++| MSG\_REGISTER\_EVENT | 3 |
+++-------------------------------+---------+
++| MSG\_SYNC\_LSDB | 4 |
+++-------------------------------+---------+
++| MSG\_ORIGINATE\_REQUEST | 5 |
+++-------------------------------+---------+
++| MSG\_DELETE\_REQUEST | 6 |
+++-------------------------------+---------+
++
+++-----------------------------+---------+
++| Messages from OSPF deamon | Value |
+++=============================+=========+
++| MSG\_REPLY | 10 |
+++-----------------------------+---------+
++| MSG\_READY\_NOTIFY | 11 |
+++-----------------------------+---------+
++| MSG\_LSA\_UPDATE\_NOTIFY | 12 |
+++-----------------------------+---------+
++| MSG\_LSA\_DELETE\_NOTIFY | 13 |
+++-----------------------------+---------+
++| MSG\_NEW\_IF | 14 |
+++-----------------------------+---------+
++| MSG\_DEL\_IF | 15 |
+++-----------------------------+---------+
++| MSG\_ISM\_CHANGE | 16 |
+++-----------------------------+---------+
++| MSG\_NSM\_CHANGE | 17 |
+++-----------------------------+---------+
++
++The synchronous requests and replies have the following message formats:
++
++.. figure:: ../figures/ospf_api_msgs1.png
++ :alt: image
++
++ image
++
++The origin field allows to select according to the following types of
++origins:
++
+++-------------------------+---------+
++| Origin | Value |
+++=========================+=========+
++| NON\_SELF\_ORIGINATED | 0 |
+++-------------------------+---------+
++| SELF\_ORIGINATED | 1 |
+++-------------------------+---------+
++| ANY\_ORIGIN | 2 |
+++-------------------------+---------+
++
++The reply message has on of the following error codes:
++
+++--------------------------+---------+
++| Error code | Value |
+++==========================+=========+
++| API\_OK | 0 |
+++--------------------------+---------+
++| API\_NOSUCHINTERFACE | -1 |
+++--------------------------+---------+
++| API\_NOSUCHAREA | -2 |
+++--------------------------+---------+
++| API\_NOSUCHLSA | -3 |
+++--------------------------+---------+
++| API\_ILLEGALSATYPE | -4 |
+++--------------------------+---------+
++| API\_ILLEGALOPAQUETYPE | -5 |
+++--------------------------+---------+
++| API\_OPAQUETYPEINUSE | -6 |
+++--------------------------+---------+
++| API\_NOMEMORY | -7 |
+++--------------------------+---------+
++| API\_ERROR | -99 |
+++--------------------------+---------+
++| API\_UNDEF | -100 |
+++--------------------------+---------+
++
++The asynchronous notifications have the following message formats:
++
++.. figure:: ../figures/ospf_api_msgs2.png
++ :alt: image
++
++ image
++
++Original Acknowledgments from Ralph Keller
++------------------------------------------
++
++I would like to thank Masahiko Endo, the author of the opaque LSA
++extension module, for his great support. His wonderful ASCII graphs
++explaining the internal workings of this code, and his invaluable input
++proved to be crucial in designing a useful API for accessing the link
++state database of the OSPF daemon. Once, he even decided to take the
++plane from Tokyo to Zurich so that we could actually meet and have
++face-to-face discussions, which was a lot of fun. Clearly, without
++Masahiko no API would ever be completed. I also would like to thank
++Daniel Bauer who wrote an opaque LSA implementation too and was willing
++to test the OSPF API code in one of his projects.
--- /dev/null
--- /dev/null
++OSPF Segment Routing
++====================
++
++This is an EXPERIMENTAL support of draft
++`draft-ietf-ospf-segment-routing-extensions-24`.
++DON'T use it for production network.
++
++Implementation details
++----------------------
++
++Concepts
++~~~~~~~~
++
++Segment Routing used 3 differents OPAQUE LSA in OSPF to carry the various
++information:
++
++* **Router Information:** flood the Segment Routing capabilities of the node.
++ This include the supported algorithms, the Segment Routing Global Block
++ (SRGB) and the Maximum Stack Depth (MSD).
++* **Extended Link:** flood the Adjaceny and Lan Adjacency Segment Identifier
++* **Extended Prefix:** flood the Prefix Segment Identifier
++
++The implementation follow previous TE and Router Information codes. It used the
++OPAQUE LSA functions defined in ospf_opaque.[c,h] as well as the OSPF API. This
++latter is mandatory for the implementation as it provides the Callback to
++Segment Routing functions (see below) when an Extended Link / Prefix or Router
++Information LSA s are received.
++
++Overview
++~~~~~~~~
++
++Following files where modified or added:
++
++* ospd_ri.[c,h] have been modified to add the new TLVs for Segment Routing.
++* ospf_ext.[c,h] implement RFC7684 as base support of Extended Link and Prefix
++ Opaque LSA.
++* ospf_sr.[c,h] implement the earth of Segment Routing. It adds a new Segment
++ Routing database to manage Segment Identifiers per Link and Prefix and
++ Segment Routing enable node, Callback functions to process incoming LSA and
++ install MPLS FIB entry through Zebra.
++
++The figure below shows the relation between the various files:
++
++* ospf_sr.c centralized all the Segment Routing processing. It receives Opaque
++ LSA Router Information (4.0.0.0) from ospf_ri.c and Extended Prefix
++ (7.0.0.X) Link (8.0.0.X) from ospf_ext.c. Once received, it parse TLVs and
++ SubTLVs and store information in SRDB (which is defined in ospf_sr.h). For
++ each received LSA, NHLFE is computed and send to Zebra to add/remove new
++ MPLS labels entries and FEC. New CLI configurations are also centralized in
++ ospf_sr.c. This CLI will trigger the flooding of new LSA Router Information
++ (4.0.0.0), Extended Prefix (7.0.0.X) and Link (8.0.0.X) by ospf_ri.c,
++ respectively ospf_ext.c.
++* ospf_ri.c send back to ospf_sr.c received Router Information LSA and update
++ Self Router Information LSA with paramters provided by ospf_sr.c i.e. SRGB
++ and MSD. It use ospf_opaque.c functions to send/received these Opaque LSAs.
++* ospf_ext.c send back to ospf_sr.c received Extended Prefix and Link Opaque
++ LSA and send self Extended Prefix and Link Opaque LSA through ospf_opaque.c
++ functions.
++
++::
++
++ +-----------+ +-------+
++ | | | |
++ | ospf_sr.c +-----+ SRDB |
++ +-----------+ +--+ | |
++ | +-^-------^-+ | +-------+
++ | | | | |
++ | | | | |
++ | | | | +--------+
++ | | | | |
++ +---v----------+ | | | +-----v-------+
++ | | | | | | |
++ | ospf_ri.c +--+ | +-------+ ospf_ext.c |
++ | LSA 4.0.0.0 | | | LSA 7.0.0.X |
++ | | | | LSA 8.0.0.X |
++ +---^----------+ | | |
++ | | +-----^-------+
++ | | |
++ | | |
++ | +--------v------------+ |
++ | | | |
++ | | ZEBRA: Labels + FEC | |
++ | | | |
++ | +---------------------+ |
++ | |
++ | |
++ | +---------------+ |
++ | | | |
++ +---------> ospf_opaque.c <---------+
++ | |
++ +---------------+
++
++ Figure 1: Overview of Segment Routing interaction
++
++Module interactions
++~~~~~~~~~~~~~~~~~~~
++
++To process incoming LSA, the code is based on the capability to call `hook()`
++functions when LSA are inserted or delete to / from the LSDB and the
++possibility to register particular treatment for Opaque LSA. The first point
++is provided by the OSPF API feature and the second by the Opaque implementation
++itself. Indeed, it is possible to register callback function for a given Opaque
++LSA ID (see `ospf_register_opaque_functab()` function defined in
++`ospf_opaque.c`). Each time a new LSA is added to the LSDB, the
++`new_lsa_hook()` function previously register for this LSA type is called. For
++Opaque LSA it is the `ospf_opaque_lsa_install_hook()`. For deletion, it is
++`ospf_opaque_lsa_delete_hook()`.
++
++Note that incoming LSA which is already present in the LSDB will be inserted
++after the old instance of this LSA remove from the LSDB. Thus, after the first
++time, each incoming LSA will trigger a `delete` following by an `install`. This
++is not very helpfull to handle real LSA deletion. In fact, LSA deletion is done
++by Flushing LSA i.e. flood LSA after seting its age to MAX_AGE. Then, a garbage
++function has the role to remove all LSA with `age == MAX_AGE` in the LSDB. So,
++to handle LSA Flush, the best is to look to the LSA age to determine if it is
++an installation or a future deletion i.e. the flushed LSA is first store in the
++LSDB with MAX_AGE waiting for the garbage collector function.
++
++Router Information LSAs
++^^^^^^^^^^^^^^^^^^^^^^^
++
++To activate Segment Routing, new CLI command `segment-routing on` has been
++introduced. When this command is activated, function
++`ospf_router_info_update_sr()` is called to indicate to Router Information
++process that Segment Routing TLVs must be flood. Same function is called to
++modify the Segment Routing Global Block (SRGB) and Maximum Stack Depth (MSD)
++TLV. Only Shortest Path First (SPF) Algorithm is supported, so no possiblity
++to modify this TLV is offer by the code.
++
++When Opaque LSA Tyep 4 i.e. Router Information are stored in LSDB, function
++`ospf_opaque_lsa_install_hook()` will call the previously registered function
++`ospf_router_info_lsa_update()`. In turn, the function will simply trigger
++`ospf_sr_ri_lsa_update()` or `ospf_sr_ri_lsa_delete` in function of the LSA
++age. Before, it verifies that the LSA Opaque Type is 4 (Router Information).
++Self Opaque LSA are not send back to the Segment Routing functions as
++information are already stored.
++
++Extended Link Prefix LSAs
++^^^^^^^^^^^^^^^^^^^^^^^^^
++
++Like for Router Information, Segment Routing is activate at the Extended
++Link/Prefix level with new `segment-routing on` command. This trigger
++automtically the flooding of Extended Link LSA for all ospf interface where
++adjacency is full. For Extended Prefix LSA, the new CLI command
++`segment-routing prefix ...` will trigger the flooding of Prefix SID
++TLV/SubTLVs.
++
++When Opaque LSA Type 7 i.e. Extended Prefix and Type 8 i.e. Extended Link are
++store in the LSDB, `ospf_ext_pref_update_lsa()` respectively
++`ospf_ext_link_update_lsa()` are called like for Router Information LSA. In
++turn, they respectively trigger `ospf_sr_ext_prefix_lsa_update()` /
++`ospf_sr_ext_link_lsa_update()` or `ospf_sr_ext_prefix_lsa_delete()` /
++`ospf_sr_ext_link_lsa_delete()` if the LSA age is equal to MAX_AGE.
++
++Zebra
++^^^^^
++
++When a new MPLS entry or new Forwarding Equivalent Class (FEC) must be added or
++deleted in the data plane, `add_sid_nhlfe()` respectively `del_sid_nhlfe()` are
++called. Once check the validity of labels, they are send to ZEBRA layer through
++`ZEBRA_MPLS_LABELS_ADD` command, respectively `ZEBRA_MPLS_LABELS_DELETE`
++command for deletion. This is completed by a new labelled route through
++`ZEBRA_ROUTE_ADD` command, respectively `ZEBRA_ROUTE_DELETE` command.
++
++Configuration
++-------------
++
++Linux Kernel
++~~~~~~~~~~~~
++
++In order to use OSPF Segment Routing, you must setup MPLS data plane. Up to
++know, only Linux Kernel version >= 4.5 is supported.
++
++First, the MPLS modules aren't loaded by default, so you'll need to load them
++yourself:
++
++::
++
++ modprobe mpls_router
++ modprobe mpls_gso
++ modprobe mpls_iptunnel
++
++Then, you must activate MPLS on the interface you would used:
++
++::
++
++ sysctl -w net.mpls.conf.enp0s9.input=1
++ sysctl -w net.mpls.conf.lo.input=1
++ sysctl -w net.mpls.platform_labels=1048575
++
++The last line fix the maximum MPLS label value.
++
++Once OSPFd start with Segment Routing, you could check that MPLS routes are
++enable with:
++
++::
++
++ ip -M route
++ ip route
++
++The first command show the MPLS LFIB table while the second show the FIB
++table which contains route with MPLS label encapsulation.
++
++If you disable Penultimate Hop Popping with the `no-php-flag` (see below), you
++MUST check that RP filter is not enable for the interface you intend to use,
++especially the `lo` one. For that purpose, disable RP filtering with:
++
++::
++
++ systcl -w net.ipv4.conf.all.rp_filter=0
++ sysctl -w net.ipv4.conf.lo.rp_filter=0
++
++OSPFd
++~~~~~
++
++Here it is a simple example of configuration to enable Segment Routing. Note
++that `opaque capability` and `router information` must be set to activate
++Opaque LSA prior to Segment
++Routing.
++
++::
++
++ router ospf
++ ospf router-id 192.168.1.11
++ capability opaque
++ mpls-te on
++ mpls-te router-address 192.168.1.11
++ router-info area 0.0.0.0
++ segment-routing on
++ segment-routing global-block 10000 19999
++ segment-routing node-msd 8
++ segment-routing prefix 192.168.1.11/32 index 1100
++
++The first segment-routing statement enable it. The Second one set the SRGB,
++third line the MSD and finally, set the Prefix SID index for a given prefix.
++Note that only prefix of Loopback interface could be configured with a Prefix
++SID. It is possible to add `no-php-flag` at the end of the prefix command to
++disbale Penultimate Hop Popping. This advertises peers that they MUST NOT pop
++the MPLS label prior to sending the packet.
++
++Known limitations
++-----------------
++
++* Runs only within default VRF
++* Only single Area is supported. ABR is not yet supported
++* Only SPF algorithm is supported
++* Extended Prefix Range is not supported
++* MPLS table are not flush at startup. Thus, restarting zebra process is
++ mandatory to remove old MPLS entries in the data plane after a crash of
++ ospfd daemon
++* Due to a bug in OSPF Opaque, LSA are not flood when enable Segment Routing
++ through CLI once OSPFd started. You must configure Segment Routing within
++ configuration file before launching OSPFd
++* With NO Penultimate Hop Popping, it is not possible to express a Segment
++ Path with an Adjacency SID due to the impossibility for the Linux Kernel to
++ perform double POP instruction.
++
++Credits
++-------
++
++* Author: Anselme Sawadogo <anselmesawadogo@gmail.com>
++* Author: Olivier Dugeon <olivier.dugeon@orange.com>
++* Copyright (C) 2016 - 2018 Orange Labs http://www.orange.com
++
++This work has been performed in the framework of the H2020-ICT-2014
++project 5GEx (Grant Agreement no. 671636), which is partially funded
++by the European Commission.
++
++
--- /dev/null
- mpls-te on
- mpls-te link metric 10
- mpls-te link max-bw 1.25e+06
- mpls-te link max-rsv-bw 1.25e+06
- mpls-te link unrsv-bw 0 1.25e+06
- mpls-te link unrsv-bw 1 1.25e+06
- mpls-te link unrsv-bw 2 1.25e+06
- mpls-te link unrsv-bw 3 1.25e+06
- mpls-te link unrsv-bw 4 1.25e+06
- mpls-te link unrsv-bw 5 1.25e+06
- mpls-te link unrsv-bw 6 1.25e+06
- mpls-te link unrsv-bw 7 1.25e+06
- mpls-te link rsc-clsclr 0xab
+.. _ospfv2:
+
+******
+OSPFv2
+******
+
+:abbr:`OSPF (Open Shortest Path First)` version 2 is a routing protocol which
+is described in :rfc:`2328`. OSPF is an :abbr:`IGP (Interior Gateway
+Protocol)`. Compared with :abbr:`RIP`, :abbr:`OSPF` can provide scalable
+network support and faster convergence times. OSPF is widely used in large
+networks such as :abbr:`ISP (Internet Service Provider)` backbone and
+enterprise networks.
+
+.. include:: ospf_fundamentals.rst
+
+.. _configuring-ospfd:
+
+Configuring ospfd
+=================
+
+There are no *ospfd* specific options. Common options can be specified
+(:ref:`common-invocation-options`) to *ospfd*. *ospfd* needs to acquire
+interface information from *zebra* in order to function. Therefore *zebra* must
+be running before invoking *ospfd*. Also, if *zebra* is restarted then *ospfd*
+must be too.
+
+Like other daemons, *ospfd* configuration is done in :abbr:`OSPF` specific
+configuration file :file:`ospfd.conf`.
+
+.. _ospf-router:
+
+OSPF router
+===========
+
+To start OSPF process you have to specify the OSPF router. As of this
+writing, *ospfd* does not support multiple OSPF processes.
+
+.. index:: router ospf
+.. clicmd:: router ospf
+
+.. index:: no router ospf
+.. clicmd:: 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.
+
+.. index:: ospf router-id A.B.C.D
+.. clicmd:: ospf router-id A.B.C.D
+
+.. index:: no ospf router-id
+.. clicmd:: no ospf router-id
+
+ This sets the router-ID of the OSPF process. The
+ router-ID may be an IP address of the router, but need not be - it can
+ be any arbitrary 32bit number. However it MUST be unique within the
+ entire OSPF domain to the OSPF speaker - bad things will happen if
+ multiple OSPF speakers are configured with the same router-ID! If one
+ is not specified then *ospfd* will obtain a router-ID
+ automatically from *zebra*.
+
+.. index:: ospf abr-type TYPE
+.. clicmd:: ospf abr-type TYPE
+
+.. index:: no ospf abr-type TYPE
+.. clicmd:: no ospf abr-type TYPE
+
+ `type` can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
+ are equivalent.
+
+ The OSPF standard for ABR behaviour does not allow an ABR to consider
+ routes through non-backbone areas when its links to the backbone are
+ down, even when there are other ABRs in attached non-backbone areas
+ which still can reach the backbone - this restriction exists primarily
+ to ensure routing-loops are avoided.
+
+ With the "Cisco" or "IBM" ABR type, the default in this release of
+ FRR, this restriction is lifted, allowing an ABR to consider
+ summaries learnt from other ABRs through non-backbone areas, and hence
+ route via non-backbone areas as a last resort when, and only when,
+ backbone links are down.
+
+ Note that areas with fully-adjacent virtual-links are considered to be
+ "transit capable" and can always be used to route backbone traffic, and
+ hence are unaffected by this setting (:clicmd:`area A.B.C.D virtual-link A.B.C.D`).
+
+ More information regarding the behaviour controlled by this command can
+ be found in :rfc:`3509`, and :t:`draft-ietf-ospf-shortcut-abr-02.txt`.
+
+ Quote: "Though the definition of the :abbr:`ABR (Area Border Router)`
+ 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."
+
+.. index:: ospf rfc1583compatibility
+.. clicmd:: ospf rfc1583compatibility
+
+.. index:: no ospf rfc1583compatibility
+.. clicmd:: no ospf rfc1583compatibility
+
+ :rfc:`2328`, the sucessor to :rfc:`1583`, 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 backbone path are now of equal preference
+ but still both preferred to external paths.
+
+ This command should NOT be set normally.
+
+.. index:: log-adjacency-changes [detail]
+.. clicmd:: log-adjacency-changes [detail]
+
+.. index:: no log-adjacency-changes [detail]
+.. clicmd:: no log-adjacency-changes [detail]
+
+ Configures ospfd to log changes in adjacency. With the optional
+ detail argument, all changes in adjacency status are shown. Without detail,
+ only changes to full or regressions are shown.
+
+.. index:: passive-interface INTERFACE
+.. clicmd:: passive-interface INTERFACE
+
+.. index:: no passive-interface INTERFACE
+.. clicmd:: no passive-interface INTERFACE
+
+ Do not speak OSPF interface on the
+ given interface, but do advertise the interface as a stub link in the
+ router-:abbr:`LSA (Link State Advertisement)` for this router. This
+ allows one to advertise addresses on such connected interfaces without
+ having to originate AS-External/Type-5 LSAs (which have global flooding
+ scope) - as would occur if connected addresses were redistributed into
+ OSPF (:ref:`redistribute-routes-to-ospf`). This is the only way to
+ advertise non-OSPF links into stub areas.
+
+.. index:: timers throttle spf DELAY INITIAL-HOLDTIME MAX-HOLDTIME
+.. clicmd:: timers throttle spf DELAY INITIAL-HOLDTIME MAX-HOLDTIME
+
+.. index:: no timers throttle spf
+.. clicmd:: no timers throttle spf
+
+ This command sets the initial `delay`, the `initial-holdtime`
+ and the `maximum-holdtime` between when SPF is calculated and the
+ event which triggered the calculation. The times are specified in
+ milliseconds and must be in the range of 0 to 600000 milliseconds.
+
+ The `delay` specifies the minimum amount of time to delay SPF
+ calculation (hence it affects how long SPF calculation is delayed after
+ an event which occurs outside of the holdtime of any previous SPF
+ calculation, and also serves as a minimum holdtime).
+
+ Consecutive SPF calculations will always be seperated by at least
+ 'hold-time' milliseconds. The hold-time is adaptive and initially is
+ set to the `initial-holdtime` configured with the above command.
+ Events which occur within the holdtime of the previous SPF calculation
+ will cause the holdtime to be increased by `initial-holdtime`, bounded
+ by the `maximum-holdtime` configured with this command. If the adaptive
+ hold-time elapses without any SPF-triggering event occuring then
+ the current holdtime is reset to the `initial-holdtime`. The current
+ holdtime can be viewed with :clicmd:`show ip ospf`, where it is expressed as
+ a multiplier of the `initial-holdtime`.
+
+ ::
+
+ router ospf
+ timers throttle spf 200 400 10000
+
+
+ In this example, the `delay` is set to 200ms, the initial holdtime is set to
+ 400ms and the `maximum holdtime` to 10s. Hence there will always be at least
+ 200ms between an event which requires SPF calculation and the actual SPF
+ calculation. Further consecutive SPF calculations will always be seperated
+ by between 400ms to 10s, the hold-time increasing by 400ms each time an
+ SPF-triggering event occurs within the hold-time of the previous SPF
+ calculation.
+
+ This command supercedes the *timers spf* command in previous FRR
+ releases.
+
+.. index:: max-metric router-lsa [on-startup|on-shutdown] (5-86400)
+.. clicmd:: max-metric router-lsa [on-startup|on-shutdown] (5-86400)
+
+.. index:: max-metric router-lsa administrative
+.. clicmd:: max-metric router-lsa administrative
+
+.. index:: no max-metric router-lsa [on-startup|on-shutdown|administrative]
+.. clicmd:: no max-metric router-lsa [on-startup|on-shutdown|administrative]
+
+ This enables :rfc:`3137` support, where the OSPF process describes its
+ transit links in its router-LSA as having infinite distance so that other
+ routers will avoid calculating transit paths through the router while still
+ being able to reach networks through the router.
+
+ This support may be enabled administratively (and indefinitely) or
+ conditionally. Conditional enabling of max-metric router-lsas can be for a
+ period of seconds after startup and/or for a period of seconds prior to
+ shutdown.
+
+ Enabling this for a period after startup allows OSPF to converge fully first
+ without affecting any existing routes used by other routers, while still
+ allowing any connected stub links and/or redistributed routes to be
+ reachable. Enabling this for a period of time in advance of shutdown allows
+ the router to gracefully excuse itself from the OSPF domain.
+
+ Enabling this feature administratively allows for administrative
+ intervention for whatever reason, for an indefinite period of time. Note
+ that if the configuration is written to file, this administrative form of
+ the stub-router command will also be written to file. If *ospfd* is
+ restarted later, the command will then take effect until manually
+ deconfigured.
+
+ Configured state of this feature as well as current status, such as the
+ number of second remaining till on-startup or on-shutdown ends, can be
+ viewed with the :clicmd:`show ip ospf` command.
+
+.. index:: auto-cost reference-bandwidth (1-4294967)
+.. clicmd:: auto-cost reference-bandwidth (1-4294967)
+
+.. index:: no auto-cost reference-bandwidth
+.. clicmd:: no auto-cost reference-bandwidth
+
+ This sets the reference
+ bandwidth for cost calculations, where this bandwidth is considered
+ equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
+ 100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
+ cost of 1. Cost of lower bandwidth links will be scaled with reference
+ to this cost).
+
+ This configuration setting MUST be consistent across all routers within the
+ OSPF domain.
+
+.. index:: network A.B.C.D/M area A.B.C.D
+.. clicmd:: network A.B.C.D/M area A.B.C.D
+
+.. index:: network A.B.C.D/M area (0-4294967295)
+.. clicmd:: network A.B.C.D/M area (0-4294967295)
+
+.. index:: no network A.B.C.D/M area A.B.C.D
+.. clicmd:: no network A.B.C.D/M area A.B.C.D
+
+.. index:: no network A.B.C.D/M area (0-4294967295)
+.. clicmd:: no network A.B.C.D/M area (0-4294967295)
+
+ This command specifies the OSPF enabled interface(s). If the interface has
+ an address from range 192.168.1.0/24 then the command below enables ospf
+ on this interface so router can provide network information to the other
+ ospf routers via this interface.
+
+::
+
+ router ospf
+ network 192.168.1.0/24 area 0.0.0.0
+
+
+ Prefix length in interface must be equal or bigger (ie. smaller network) than
+ prefix length in network statement. For example statement above doesn't enable
+ ospf on interface with address 192.168.1.1/23, but it does on interface with
+ address 192.168.1.129/25.
+
+ Note that the behavior when there is a peer address
+ defined on an interface changed after release 0.99.7.
+ Currently, if a peer prefix has been configured,
+ then we test whether the prefix in the network command contains
+ the destination prefix. Otherwise, we test whether the network command prefix
+ contains the local address prefix of the interface.
+
+ In some cases it may be more convenient to enable OSPF on a per
+ interface/subnet basis (:clicmd:`ip ospf area AREA [ADDR]`).
+
+
+.. _ospf-area:
+
+OSPF area
+=========
+
+.. index:: area A.B.C.D range A.B.C.D/M
+.. clicmd:: area A.B.C.D range A.B.C.D/M
+
+.. index:: area (0-4294967295) range A.B.C.D/M
+.. clicmd:: area (0-4294967295) range A.B.C.D/M
+
+.. index:: no area A.B.C.D range A.B.C.D/M
+.. clicmd:: no area A.B.C.D range A.B.C.D/M
+
+.. index:: no area (0-4294967295) range A.B.C.D/M
+.. clicmd:: no area (0-4294967295) range A.B.C.D/M
+
+ Summarize intra area paths from specified area into one Type-3 summary-LSA
+ announced to other areas. This command can be used only in ABR and ONLY
+ router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
+ be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
+ Summarizing Type-7 AS-external-LSAs isn't supported yet by FRR.
+
+::
+
+ router ospf
+ network 192.168.1.0/24 area 0.0.0.0
+ network 10.0.0.0/8 area 0.0.0.10
+ area 0.0.0.10 range 10.0.0.0/8
+
+
+ With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
+ announced into backbone area if area 0.0.0.10 contains at least one intra-area
+ network (ie. described with router or network LSA) from this range.
+
+.. index:: area A.B.C.D range IPV4_PREFIX not-advertise
+.. clicmd:: area A.B.C.D range IPV4_PREFIX not-advertise
+
+.. index:: no area A.B.C.D range IPV4_PREFIX not-advertise
+.. clicmd:: no area A.B.C.D range IPV4_PREFIX not-advertise
+
+ Instead of summarizing intra area paths filter them - ie. intra area paths from this
+ range are not advertised into other areas.
+ This command makes sense in ABR only.
+
+.. index:: area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
+.. clicmd:: area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
+
+.. index:: no area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
+.. clicmd:: no area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
+
+ Substitute summarized prefix with another prefix.
+
+::
+
+ router ospf
+ network 192.168.1.0/24 area 0.0.0.0
+ network 10.0.0.0/8 area 0.0.0.10
+ area 0.0.0.10 range 10.0.0.0/8 substitute 11.0.0.0/8
+
+
+ One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
+ area 0.0.0.10 contains at least one intra-area network (ie. described with router-LSA or
+ network-LSA) from range 10.0.0.0/8.
+ This command makes sense in ABR only.
+
+.. index:: area A.B.C.D virtual-link A.B.C.D
+.. clicmd:: area A.B.C.D virtual-link A.B.C.D
+
+.. index:: area (0-4294967295) virtual-link A.B.C.D
+.. clicmd:: area (0-4294967295) virtual-link A.B.C.D
+
+.. index:: no area A.B.C.D virtual-link A.B.C.D
+.. clicmd:: no area A.B.C.D virtual-link A.B.C.D
+
+.. index:: no area (0-4294967295) virtual-link A.B.C.D
+.. clicmd:: no area (0-4294967295) virtual-link A.B.C.D
+
+.. index:: area A.B.C.D shortcut
+.. clicmd:: area A.B.C.D shortcut
+
+.. index:: area (0-4294967295) shortcut
+.. clicmd:: area (0-4294967295) shortcut
+
+.. index:: no area A.B.C.D shortcut
+.. clicmd:: no area A.B.C.D shortcut
+
+.. index:: no area (0-4294967295) shortcut
+.. clicmd:: no area (0-4294967295) shortcut
+
+ Configure the area as Shortcut capable. See :rfc:`3509`. This requires
+ that the 'abr-type' be set to 'shortcut'.
+
+.. index:: area A.B.C.D stub
+.. clicmd:: area A.B.C.D stub
+
+.. index:: area (0-4294967295) stub
+.. clicmd:: area (0-4294967295) stub
+
+.. index:: no area A.B.C.D stub
+.. clicmd:: no area A.B.C.D stub
+
+.. index:: no area (0-4294967295) stub
+.. clicmd:: no area (0-4294967295) stub
+
+ Configure the area to be a stub area. That is, an area where no router
+ originates routes external to OSPF and hence an area where all external
+ routes are via the ABR(s). Hence, ABRs for such an area do not need
+ to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
+ area. They need only pass Network-Summary (type-3) LSAs into such an area,
+ along with a default-route summary.
+
+.. index:: area A.B.C.D stub no-summary
+.. clicmd:: area A.B.C.D stub no-summary
+
+.. index:: area (0-4294967295) stub no-summary
+.. clicmd:: area (0-4294967295) stub no-summary
+
+.. index:: no area A.B.C.D stub no-summary
+.. clicmd:: no area A.B.C.D stub no-summary
+
+.. index:: no area (0-4294967295) stub no-summary
+.. clicmd:: no area (0-4294967295) stub no-summary
+
+ Prevents an *ospfd* ABR from injecting inter-area
+ summaries into the specified stub area.
+
+.. index:: area A.B.C.D default-cost (0-16777215)
+.. clicmd:: area A.B.C.D default-cost (0-16777215)
+
+.. index:: no area A.B.C.D default-cost (0-16777215)
+.. clicmd:: no area A.B.C.D default-cost (0-16777215)
+
+ Set the cost of default-summary LSAs announced to stubby areas.
+
+.. index:: area A.B.C.D export-list NAME
+.. clicmd:: area A.B.C.D export-list NAME
+
+.. index:: area (0-4294967295) export-list NAME
+.. clicmd:: area (0-4294967295) export-list NAME
+
+.. index:: no area A.B.C.D export-list NAME
+.. clicmd:: no area A.B.C.D export-list NAME
+
+.. index:: no area (0-4294967295) export-list NAME
+.. clicmd:: no area (0-4294967295) export-list NAME
+
+ Filter Type-3 summary-LSAs announced to other areas originated from intra-
+ area paths from specified area.
+
+::
+
+ router ospf
+ network 192.168.1.0/24 area 0.0.0.0
+ network 10.0.0.0/8 area 0.0.0.10
+ area 0.0.0.10 export-list foo
+ !
+ access-list foo permit 10.10.0.0/16
+ access-list foo deny any
+
+
+ With example above any intra-area paths from area 0.0.0.10 and from range
+ 10.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
+ other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
+ or 10.128.30.16/30) aren't.
+
+ This command is only relevant if the router is an ABR for the specified
+ area.
+
+.. index:: area A.B.C.D import-list NAME
+.. clicmd:: area A.B.C.D import-list NAME
+
+.. index:: area (0-4294967295) import-list NAME
+.. clicmd:: area (0-4294967295) import-list NAME
+
+.. index:: no area A.B.C.D import-list NAME
+.. clicmd:: no area A.B.C.D import-list NAME
+
+.. index:: no area (0-4294967295) import-list NAME
+.. clicmd:: no area (0-4294967295) import-list NAME
+
+ Same as export-list, but it applies to paths announced into specified area as
+ Type-3 summary-LSAs.
+
+.. index:: area A.B.C.D filter-list prefix NAME in
+.. clicmd:: area A.B.C.D filter-list prefix NAME in
+
+.. index:: area A.B.C.D filter-list prefix NAME out
+.. clicmd:: area A.B.C.D filter-list prefix NAME out
+
+.. index:: area (0-4294967295) filter-list prefix NAME in
+.. clicmd:: area (0-4294967295) filter-list prefix NAME in
+
+.. index:: area (0-4294967295) filter-list prefix NAME out
+.. clicmd:: area (0-4294967295) filter-list prefix NAME out
+
+.. index:: no area A.B.C.D filter-list prefix NAME in
+.. clicmd:: no area A.B.C.D filter-list prefix NAME in
+
+.. index:: no area A.B.C.D filter-list prefix NAME out
+.. clicmd:: no area A.B.C.D filter-list prefix NAME out
+
+.. index:: no area (0-4294967295) filter-list prefix NAME in
+.. clicmd:: no area (0-4294967295) filter-list prefix NAME in
+
+.. index:: no area (0-4294967295) filter-list prefix NAME out
+.. clicmd:: no area (0-4294967295) filter-list prefix NAME out
+
+ Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
+ makes sense in ABR only.
+
+.. index:: area A.B.C.D authentication
+.. clicmd:: area A.B.C.D authentication
+
+.. index:: area (0-4294967295) authentication
+.. clicmd:: area (0-4294967295) authentication
+
+.. index:: no area A.B.C.D authentication
+.. clicmd:: no area A.B.C.D authentication
+
+.. index:: no area (0-4294967295) authentication
+.. clicmd:: no area (0-4294967295) authentication
+
+ Specify that simple password authentication should be used for the given
+ area.
+
+.. index:: area A.B.C.D authentication message-digest
+.. clicmd:: area A.B.C.D authentication message-digest
+
+.. index:: area (0-4294967295) authentication message-digest
+.. clicmd:: area (0-4294967295) authentication message-digest
+
+ Specify that OSPF packets must be authenticated with MD5 HMACs within the
+ given area. Keying material must also be configured on a per-interface basis
+ (:clicmd:`ip ospf message-digest-key`).
+
+ MD5 authentication may also be configured on a per-interface basis
+ (:clicmd:`ip ospf authentication message-digest`). Such per-interface
+ settings will override any per-area authentication setting.
+
+.. _ospf-interface:
+
+OSPF interface
+==============
+
+.. index:: ip ospf area AREA [ADDR]
+.. clicmd:: ip ospf area AREA [ADDR]
+
+.. index:: no ip ospf area [ADDR]
+.. clicmd:: no ip ospf area [ADDR]
+
+ Enable OSPF on the interface, optionally restricted to just the IP address
+ given by `ADDR`, putting it in the `AREA` area. Per interface area settings
+ take precedence to network commands
+ (:clicmd:`network A.B.C.D/M area A.B.C.D`).
+
+ If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
+ via this command may result in a slight performance improvement.
+
+.. index:: ip ospf authentication-key AUTH_KEY
+.. clicmd:: ip ospf authentication-key AUTH_KEY
+
+.. index:: no ip ospf authentication-key
+.. clicmd:: 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.
+
+ Simple text password authentication is insecure and deprecated in favour of
+ MD5 HMAC authentication.
+
+.. index:: ip ospf authentication message-digest
+.. clicmd:: ip ospf authentication message-digest
+
+ Specify that MD5 HMAC authentication must be used on this interface. MD5
+ keying material must also be configured. Overrides any authentication
+ enabled on a per-area basis
+ (:clicmd:`area A.B.C.D authentication message-digest`)
+
+ Note that OSPF MD5 authentication requires that time never go backwards
+ (correct time is NOT important, only that it never goes backwards), even
+ across resets, if ospfd is to be able to promptly reestabish adjacencies
+ with its neighbours after restarts/reboots. The host should have system time
+ be set at boot from an external or non-volatile source (eg battery backed
+ clock, NTP, etc.) or else the system clock should be periodically saved to
+ non-volative storage and restored at boot if MD5 authentication is to be
+ expected to work reliably.
+
+.. index:: ip ospf message-digest-key KEYID md5 KEY
+.. clicmd:: ip ospf message-digest-key KEYID md5 KEY
+
+.. index:: no ip ospf message-digest-key
+.. clicmd:: 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. This ID
+ is part of the protocol and must be consistent across routers on a
+ link.
+
+ KEY is the actual message digest key, of up to 16 chars (larger strings
+ will be truncated), and is associated with the given KEYID.
+
+.. index:: ip ospf cost (1-65535)
+.. clicmd:: ip ospf cost (1-65535)
+
+.. index:: no ip ospf cost
+.. clicmd:: 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.
+
+.. index:: ip ospf dead-interval (1-65535)
+.. clicmd:: ip ospf dead-interval (1-65535)
+
+.. index:: ip ospf dead-interval minimal hello-multiplier (2-20)
+.. clicmd:: ip ospf dead-interval minimal hello-multiplier (2-20)
+
+.. index:: no ip ospf dead-interval
+.. clicmd:: 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.
+
+ If 'minimal' is specified instead, then the dead-interval is set to 1 second
+ and one must specify a hello-multiplier. The hello-multiplier specifies how
+ many Hellos to send per second, from 2 (every 500ms) to 20 (every 50ms).
+ Thus one can have 1s convergence time for OSPF. If this form is specified,
+ then the hello-interval advertised in Hello packets is set to 0 and the
+ hello-interval on received Hello packets is not checked, thus the
+ hello-multiplier need NOT be the same across multiple routers on a common
+ link.
+
+.. index:: ip ospf hello-interval (1-65535)
+.. clicmd:: ip ospf hello-interval (1-65535)
+
+.. index:: no ip ospf hello-interval
+.. clicmd:: 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.
+
+ This command has no effect if
+ :clicmd:`ip ospf dead-interval minimal hello-multiplier (2-20)` is also
+ specified for the interface.
+
+.. index:: ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)
+.. clicmd:: ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)
+
+.. index:: no ip ospf network
+.. clicmd:: no ip ospf network
+
+ Set explicitly network type for specifed interface.
+
+.. index:: ip ospf priority (0-255)
+.. clicmd:: ip ospf priority (0-255)
+
+.. index:: no ip ospf priority
+.. clicmd:: no ip ospf priority
+
+ Set RouterPriority integer value. The router with the highest priority
+ will be more eligible to become Designated Router. Setting the value
+ to 0, makes the router ineligible to become Designated Router. The
+ default value is 1.
+
+.. index:: ip ospf retransmit-interval (1-65535)
+.. clicmd:: ip ospf retransmit-interval (1-65535)
+
+.. index:: no ip ospf retransmit interval
+.. clicmd:: 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.
+
+.. index:: ip ospf transmit-delay
+.. clicmd:: ip ospf transmit-delay
+
+.. index:: no ip ospf transmit-delay
+.. clicmd:: 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.
+
+.. index:: ip ospf area (A.B.C.D|(0-4294967295))
+.. clicmd:: ip ospf area (A.B.C.D|(0-4294967295))
+
+.. index:: no ip ospf area
+.. clicmd:: no ip ospf area
+
+ Enable ospf on an interface and set associated area.
+
+.. _redistribute-routes-to-ospf:
+
+Redistribute routes to OSPF
+===========================
+
+.. index:: redistribute (kernel|connected|static|rip|bgp)
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp)
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) ROUTE-MAP
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) ROUTE-MAP
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214)
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214)
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214) route-map WORD
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214) route-map WORD
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214)
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214)
+
+.. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214) route-map WORD
+.. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214) route-map WORD
+
+.. index:: no redistribute (kernel|connected|static|rip|bgp)
+.. clicmd:: no redistribute (kernel|connected|static|rip|bgp)
+
+.. _ospf-redistribute:
+
+ Redistribute routes of the specified protocol
+ or kind into OSPF, with the metric type and metric set if specified,
+ filtering the routes using the given route-map if specified.
+ Redistributed routes may also be filtered with distribute-lists, see
+ :ref:`ospf distribute-list configuration <ospf-distribute-list>`.
+
+ Redistributed routes are distributed as into OSPF as Type-5 External
+ LSAs into links to areas that accept external routes, Type-7 External LSAs
+ for NSSA areas and are not redistributed at all into Stub areas, where
+ external routes are not permitted.
+
+ Note that for connected routes, one may instead use the `passive-interface`
+ configuration.
+
+.. seealso::
+
+ clicmd:`passive-interface INTERFACE`.
+
+.. index:: default-information originate
+.. clicmd:: default-information originate
+
+.. index:: default-information originate metric (0-16777214)
+.. clicmd:: default-information originate metric (0-16777214)
+
+.. index:: default-information originate metric (0-16777214) metric-type (1|2)
+.. clicmd:: default-information originate metric (0-16777214) metric-type (1|2)
+
+.. index:: default-information originate metric (0-16777214) metric-type (1|2) route-map WORD
+.. clicmd:: default-information originate metric (0-16777214) metric-type (1|2) route-map WORD
+
+.. index:: default-information originate always
+.. clicmd:: default-information originate always
+
+.. index:: default-information originate always metric (0-16777214)
+.. clicmd:: default-information originate always metric (0-16777214)
+
+.. index:: default-information originate always metric (0-16777214) metric-type (1|2)
+.. clicmd:: default-information originate always metric (0-16777214) metric-type (1|2)
+
+.. index:: default-information originate always metric (0-16777214) metric-type (1|2) route-map WORD
+.. clicmd:: default-information originate always metric (0-16777214) metric-type (1|2) route-map WORD
+
+.. index:: no default-information originate
+.. clicmd:: no default-information originate
+
+ Originate an AS-External (type-5) LSA describing a default route into
+ all external-routing capable areas, of the specified metric and metric
+ type. If the 'always' keyword is given then the default is always
+ advertised, even when there is no default present in the routing table.
+
+.. index:: distribute-list NAME out (kernel|connected|static|rip|ospf
+.. clicmd:: distribute-list NAME out (kernel|connected|static|rip|ospf
+
+.. index:: no distribute-list NAME out (kernel|connected|static|rip|ospf
+.. clicmd:: no distribute-list NAME out (kernel|connected|static|rip|ospf
+
+.. _ospf-distribute-list:
+
+ Apply the access-list filter, NAME, to
+ redistributed routes of the given type before allowing the routes to
+ redistributed into OSPF (:ref:`ospf redistribution <ospf-redistribute>`).
+
+.. index:: default-metric (0-16777214)
+.. clicmd:: default-metric (0-16777214)
+
+.. index:: no default-metric
+.. clicmd:: no default-metric
+
+.. index:: distance (1-255)
+.. clicmd:: distance (1-255)
+
+.. index:: no distance (1-255)
+.. clicmd:: no distance (1-255)
+
+.. index:: distance ospf (intra-area|inter-area|external) (1-255)
+.. clicmd:: distance ospf (intra-area|inter-area|external) (1-255)
+
+.. index:: no distance ospf
+.. clicmd:: no distance ospf
+
+.. index:: router zebra
+.. clicmd:: router zebra
+
+.. index:: no router zebra
+.. clicmd:: no router zebra
+
+
+.. _showing-ospf-information:
+
+Showing OSPF information
+========================
+
+.. _show-ip-ospf:
+
+.. index:: show ip ospf
+.. clicmd:: show ip ospf
+
+ Show information on a variety of general OSPF and area state and
+ configuration information.
+
+.. index:: show ip ospf interface [INTERFACE]
+.. clicmd:: show ip ospf interface [INTERFACE]
+
+ Show state and configuration of OSPF the specified interface, or all
+ interfaces if no interface is given.
+
+.. index:: show ip ospf neighbor
+.. clicmd:: show ip ospf neighbor
+
+.. index:: show ip ospf neighbor INTERFACE
+.. clicmd:: show ip ospf neighbor INTERFACE
+
+.. index:: show ip ospf neighbor detail
+.. clicmd:: show ip ospf neighbor detail
+
+.. index:: show ip ospf neighbor INTERFACE detail
+.. clicmd:: show ip ospf neighbor INTERFACE detail
+
+.. index:: show ip ospf database
+.. clicmd:: show ip ospf database
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary)
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary)
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID adv-router ADV-ROUTER
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID adv-router ADV-ROUTER
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary) adv-router ADV-ROUTER
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) adv-router ADV-ROUTER
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID self-originate
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID self-originate
+
+.. index:: show ip ospf database (asbr-summary|external|network|router|summary) self-originate
+.. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) self-originate
+
+.. index:: show ip ospf database max-age
+.. clicmd:: show ip ospf database max-age
+
+.. index:: show ip ospf database self-originate
+.. clicmd:: show ip ospf database self-originate
+
+.. index:: show ip ospf route
+.. clicmd:: show ip ospf route
+
+ Show the OSPF routing table, as determined by the most recent SPF calculation.
+
+.. _opaque-lsa:
+
+Opaque LSA
+==========
+
+.. index:: ospf opaque-lsa
+.. clicmd:: ospf opaque-lsa
+
+.. index:: capability opaque
+.. clicmd:: capability opaque
+
+.. index:: no ospf opaque-lsa
+.. clicmd:: no ospf opaque-lsa
+
+.. index:: no capability opaque
+.. clicmd:: no capability opaque
+
+ *ospfd* support Opaque LSA (RFC2370) as fondment for MPLS Traffic Engineering
+ LSA. Prior to used MPLS TE, opaque-lsa must be enable in the configuration
+ file. Alternate command could be "mpls-te on"
+ (:ref:`ospf-traffic-engineering`).
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external)
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external)
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID adv-router ADV-ROUTER
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID adv-router ADV-ROUTER
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router ADV-ROUTER
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router ADV-ROUTER
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID self-originate
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID self-originate
+
+.. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate
+.. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate
+
+ Show Opaque LSA from the database.
+
+.. _ospf-traffic-engineering:
+
+Traffic Engineering
+===================
+
+.. index:: mpls-te on
+.. clicmd:: mpls-te on
+
+.. index:: no mpls-te
+.. clicmd:: no mpls-te
+
+ Enable Traffic Engineering LSA flooding.
+
+.. index:: mpls-te router-address <A.B.C.D>
+.. clicmd:: mpls-te router-address <A.B.C.D>
+
+ Configure stable IP address for MPLS-TE. This IP address is then advertise
+ in Opaque LSA Type-10 TLV=1 (TE) option 1 (Router-Address).
+
+.. index:: mpls-te inter-as area <area-id>|as
+.. clicmd:: mpls-te inter-as area <area-id>|as
+
+.. index:: no mpls-te inter-as
+.. clicmd:: no mpls-te inter-as
+
+ Enable :rfc:`5392` support - Inter-AS TE v2 - to flood Traffic Engineering
+ parameters of Inter-AS link. 2 modes are supported: AREA and AS; LSA are
+ flood in AREA <area-id> with Opaque Type-10, respectively in AS with Opaque
+ Type-11. In all case, Opaque-LSA TLV=6.
+
+.. index:: show ip ospf mpls-te interface
+.. clicmd:: show ip ospf mpls-te interface
+
+.. index:: show ip ospf mpls-te interface INTERFACE
+.. clicmd:: show ip ospf mpls-te interface INTERFACE
+
+ Show MPLS Traffic Engineering parameters for all or specified interface.
+
+.. index:: show ip ospf mpls-te router
+.. clicmd:: show ip ospf mpls-te router
+
+ Show Traffic Engineering router parameters.
+
+.. _router-information:
+
+Router Information
+==================
+
+.. index:: router-info [as | area <A.B.C.D>]
+.. clicmd:: router-info [as | area <A.B.C.D>]
+
+.. index:: no router-info
+.. clicmd:: no router-info
+
+ Enable Router Information (:rfc:`4970`) LSA advertisement with AS scope
+ (default) or Area scope flooding when area is specified.
+
+.. index:: pce address <A.B.C.D>
+.. clicmd:: pce address <A.B.C.D>
+
+.. index:: no pce address
+.. clicmd:: no pce address
+
+.. index:: pce domain as (0-65535)
+.. clicmd:: pce domain as (0-65535)
+
+.. index:: no pce domain as (0-65535)
+.. clicmd:: no pce domain as (0-65535)
+
+.. index:: pce neighbor as (0-65535)
+.. clicmd:: pce neighbor as (0-65535)
+
+.. index:: no pce neighbor as (0-65535)
+.. clicmd:: no pce neighbor as (0-65535)
+
+.. index:: pce flag BITPATTERN
+.. clicmd:: pce flag BITPATTERN
+
+.. index:: no pce flag
+.. clicmd:: no pce flag
+
+.. index:: pce scope BITPATTERN
+.. clicmd:: pce scope BITPATTERN
+
+.. index:: no pce scope
+.. clicmd:: no pce scope
+
+ The commands are conform to :rfc:`5088` and allow OSPF router announce Path
+ Compuatation Elemenent (PCE) capabilities through the Router Information (RI)
+ LSA. Router Information must be enable prior to this. The command set/unset
+ respectively the PCE IP adress, Autonomous System (AS) numbers of controlled
+ domains, neighbor ASs, flag and scope. For flag and scope, please refer to
+ :rfc`5088` for the BITPATTERN recognition. Multiple 'pce neighbor' command
+ could be specified in order to specify all PCE neighbours.
+
+.. index:: show ip ospf router-info
+.. clicmd:: show ip ospf router-info
+
+ Show Router Capabilities flag.
+.. index:: show ip ospf router-info pce
+.. clicmd:: show ip ospf router-info pce
+
+ Show Router Capabilities PCE parameters.
+
+.. _debugging-ospf:
+
++Segment Routing
++===============
++
++This is an EXPERIMENTAL support of Segment Routing as per draft
++`draft-ietf-ospf-segment-routing-extensions-24.txt` for MPLS dataplane.
++
++.. index:: [no] segment-routing on
++.. clicmd:: [no] segment-routing on
++
++ Enable Segment Routing. Even if this also activate routing information
++ support, it is preferable to also activate routing information, and set
++ accordingly the Area or AS flooding.
++
++.. index:: [no] segment-routing global-block (0-1048575) (0-1048575)
++.. clicmd:: [no] segment-routing global-block (0-1048575) (0-1048575)
++
++ Fix the Segment Routing Global Block i.e. the label range used by MPLS to
++ store label in the MPLS FIB.
++
++.. index:: [no] segment-routing node-msd (1-16)
++.. clicmd:: [no] segment-routing node-msd (1-16)
++
++ Fix the Maximum Stack Depth supported by the router. The value depend of the
++ MPLS dataplane. E.g. for Linux kernel, since version 4.13 it is 32.
++
++.. index:: [no] segment-routing prefix A.B.C.D/M index (0-65535) [no-php-flag]
++.. clicmd:: [no] segment-routing prefix A.B.C.D/M index (0-65535) [no-php-flag]
++
++ Set the Segment Rounting index for the specifyed prefix. Note
++ that, only prefix with /32 corresponding to a loopback interface are
++ currently supported. The 'no-php-flag' means NO Penultimate Hop Popping that
++ allows SR node to request to its neighbor to not pop the label.
++
++.. index:: show ip ospf database segment-routing <adv-router ADVROUTER|self-originate>
++.. clicmd:: show ip ospf database segment-routing <adv-router ADVROUTER|self-originate>
++
++ Show Segment Routing Data Base, all SR nodes, specific advertized router or
++ self router.
++
+Debugging OSPF
+==============
+
+.. index:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
+.. clicmd:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
+
+.. index:: no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
+.. clicmd:: no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
+
+ Dump Packet for debugging
+
+.. index:: debug ospf ism
+.. clicmd:: debug ospf ism
+
+.. index:: debug ospf ism (status|events|timers)
+.. clicmd:: debug ospf ism (status|events|timers)
+
+.. index:: no debug ospf ism
+.. clicmd:: no debug ospf ism
+
+.. index:: no debug ospf ism (status|events|timers)
+.. clicmd:: no debug ospf ism (status|events|timers)
+
+ Show debug information of Interface State Machine
+
+.. index:: debug ospf nsm
+.. clicmd:: debug ospf nsm
+
+.. index:: debug ospf nsm (status|events|timers)
+.. clicmd:: debug ospf nsm (status|events|timers)
+
+.. index:: no debug ospf nsm
+.. clicmd:: no debug ospf nsm
+
+.. index:: no debug ospf nsm (status|events|timers)
+.. clicmd:: no debug ospf nsm (status|events|timers)
+
+ Show debug information of Network State Machine
+
+.. index:: debug ospf event
+.. clicmd:: debug ospf event
+
+.. index:: no debug ospf event
+.. clicmd:: no debug ospf event
+
+ Show debug information of OSPF event
+
+.. index:: debug ospf nssa
+.. clicmd:: debug ospf nssa
+
+.. index:: no debug ospf nssa
+.. clicmd:: no debug ospf nssa
+
+ Show debug information about Not So Stub Area
+
+.. index:: debug ospf lsa
+.. clicmd:: debug ospf lsa
+
+.. index:: debug ospf lsa (generate|flooding|refresh)
+.. clicmd:: debug ospf lsa (generate|flooding|refresh)
+
+.. index:: no debug ospf lsa
+.. clicmd:: no debug ospf lsa
+
+.. index:: no debug ospf lsa (generate|flooding|refresh)
+.. clicmd:: no debug ospf lsa (generate|flooding|refresh)
+
+ Show debug detail of Link State messages
+
+.. index:: debug ospf te
+.. clicmd:: debug ospf te
+
+.. index:: no debug ospf te
+.. clicmd:: no debug ospf te
+
+ Show debug information about Traffic Engineering LSA
+
+.. index:: debug ospf zebra
+.. clicmd:: debug ospf zebra
+
+.. index:: debug ospf zebra (interface|redistribute)
+.. clicmd:: debug ospf zebra (interface|redistribute)
+
+.. index:: no debug ospf zebra
+.. clicmd:: no debug ospf zebra
+
+.. index:: no debug ospf zebra (interface|redistribute)
+.. clicmd:: no debug ospf zebra (interface|redistribute)
+
+ Show debug information of ZEBRA API
+
+.. index:: show debugging ospf
+.. clicmd:: show debugging ospf
+
+
+OSPF Configuration Examples
+===========================
+
+A simple example, with MD5 authentication enabled:
+
+::
+
+ !
+ interface bge0
+ ip ospf authentication message-digest
+ ip ospf message-digest-key 1 md5 ABCDEFGHIJK
+ !
+ router ospf
+ network 192.168.0.0/16 area 0.0.0.1
+ area 0.0.0.1 authentication message-digest
+
+
+An :abbr:`ABR` router, with MD5 authentication and performing summarisation
+of networks between the areas:
+
+::
+
+ !
+ password ABCDEF
+ log file /var/log/frr/ospfd.log
+ service advanced-vty
+ !
+ interface eth0
+ ip ospf authentication message-digest
+ ip ospf message-digest-key 1 md5 ABCDEFGHIJK
+ !
+ interface ppp0
+ !
+ interface br0
+ ip ospf authentication message-digest
+ ip ospf message-digest-key 2 md5 XYZ12345
+ !
+ router ospf
+ ospf router-id 192.168.0.1
+ redistribute connected
+ passive interface ppp0
+ network 192.168.0.0/24 area 0.0.0.0
+ network 10.0.0.0/16 area 0.0.0.0
+ network 192.168.1.0/24 area 0.0.0.1
+ area 0.0.0.0 authentication message-digest
+ area 0.0.0.0 range 10.0.0.0/16
+ area 0.0.0.0 range 192.168.0.0/24
+ area 0.0.0.1 authentication message-digest
+ area 0.0.0.1 range 10.2.0.0/16
+ !
+
+
+A Traffic Engineering configuration, with Inter-ASv2 support.
+
+First, the 'zebra.conf' part:::
+
+ interface eth0
+ ip address 198.168.1.1/24
+ link-params
+ enable
+ admin-grp 0xa1
+ metric 100
+ max-bw 1.25e+07
+ max-rsv-bw 1.25e+06
+ unrsv-bw 0 1.25e+06
+ unrsv-bw 1 1.25e+06
+ unrsv-bw 2 1.25e+06
+ unrsv-bw 3 1.25e+06
+ unrsv-bw 4 1.25e+06
+ unrsv-bw 5 1.25e+06
+ unrsv-bw 6 1.25e+06
+ unrsv-bw 7 1.25e+06
+ !
+ interface eth1
+ ip address 192.168.2.1/24
+ link-params
+ enable
+ metric 10
+ max-bw 1.25e+07
+ max-rsv-bw 1.25e+06
+ unrsv-bw 0 1.25e+06
+ unrsv-bw 1 1.25e+06
+ unrsv-bw 2 1.25e+06
+ unrsv-bw 3 1.25e+06
+ unrsv-bw 4 1.25e+06
+ unrsv-bw 5 1.25e+06
+ unrsv-bw 6 1.25e+06
+ unrsv-bw 7 1.25e+06
+ neighbor 192.168.2.2 as 65000
+ hostname HOSTNAME
+ password PASSWORD
+ log file /var/log/zebra.log
+ !
+ interface eth0
+ ip address 198.168.1.1/24
- mpls-te on
- mpls-te link metric 10
- mpls-te link max-bw 1.25e+06
- mpls-te link max-rsv-bw 1.25e+06
- mpls-te link unrsv-bw 0 1.25e+06
- mpls-te link unrsv-bw 1 1.25e+06
- mpls-te link unrsv-bw 2 1.25e+06
- mpls-te link unrsv-bw 3 1.25e+06
- mpls-te link unrsv-bw 4 1.25e+06
- mpls-te link unrsv-bw 5 1.25e+06
- mpls-te link unrsv-bw 6 1.25e+06
- mpls-te link unrsv-bw 7 1.25e+06
- mpls-te link rsc-clsclr 0xab
- mpls-te neighbor 192.168.2.2 as 65000
++ link-params
++ enable
++ admin-grp 0xa1
++ metric 100
++ max-bw 1.25e+07
++ max-rsv-bw 1.25e+06
++ unrsv-bw 0 1.25e+06
++ unrsv-bw 1 1.25e+06
++ unrsv-bw 2 1.25e+06
++ unrsv-bw 3 1.25e+06
++ unrsv-bw 4 1.25e+06
++ unrsv-bw 5 1.25e+06
++ unrsv-bw 6 1.25e+06
++ unrsv-bw 7 1.25e+06
+ !
+ interface eth1
+ ip address 192.168.2.1/24
++ link-params
++ enable
++ metric 10
++ max-bw 1.25e+07
++ max-rsv-bw 1.25e+06
++ unrsv-bw 0 1.25e+06
++ unrsv-bw 1 1.25e+06
++ unrsv-bw 2 1.25e+06
++ unrsv-bw 3 1.25e+06
++ unrsv-bw 4 1.25e+06
++ unrsv-bw 5 1.25e+06
++ unrsv-bw 6 1.25e+06
++ unrsv-bw 7 1.25e+06
++ neighbor 192.168.2.2 as 65000
+
+Then the 'ospfd.conf' itself:::
+
+ hostname HOSTNAME
+ password PASSWORD
+ log file /var/log/ospfd.log
+ !
+ !
+ interface eth0
+ ip ospf hello-interval 60
+ ip ospf dead-interval 240
+ !
+ interface eth1
+ ip ospf hello-interval 60
+ ip ospf dead-interval 240
+ !
+ !
+ router ospf
+ ospf router-id 192.168.1.1
+ network 192.168.0.0/16 area 1
+ ospf opaque-lsa
+ mpls-te
+ mpls-te router-address 192.168.1.1
+ mpls-te inter-as area 1
+ !
+ line vty
+
+
+A router information example with PCE advsertisement:::
+
+ !
+ router ospf
+ ospf router-id 192.168.1.1
+ network 192.168.0.0/16 area 1
+ capability opaque
+ mpls-te
+ mpls-te router-address 192.168.1.1
+ router-info area 0.0.0.1
+ pce address 192.168.1.1
+ pce flag 0x80
+ pce domain as 65400
+ pce neighbor as 65500
+ pce neighbor as 65200
+ pce scope 0x80
+ !