==== OSPF ==== .. sidebar:: Contents .. contents:: :depth: 2 :local: This chapter covers some aspects related to the :osdx:cfg:`protocols ospf` which is a feature that allows users to **manage and monitor** the OSPF protocol. OSPF (Open Shortest Path First) is a routing protocol described in RFC 2328. OSPF can provide scalable network support and faster convergence times. It is widely used in large networks. OSPF is a link-state routing protocol, in link-state protocols routers describe the state of their links to their neighboring routers. Each router describes their link-state information in a message called LSA (Link State Advertisement), which is propagated to other routers. Each router builds up a database of all the link-sate messages. From this collection of LSAs in the database, each router can then calculate the shortest path to any other router. Configuration ============= The OSPF protocol can be configured either using :osdx:cfg:`protocols ospf` or in an interface using , `interfaces * * ip ospf`, for example, :osdx:cfg:`interfaces dummy * ip ospf` or :osdx:cfg:`interfaces ethernet * ip ospf`. In OSDx, the OSPF configuration allows various parameters to be set to fine-tune the protocol's behavior. An explanation of each configurable parameter in :osdx:cfg:`protocols ospf` configuration is provided below: * ``area``: OSPF provides for the protocol to be broken up into multiple smaller and independent link-state areas. Each area must be connected to a common backbone area by an ABR (Area Boundary Router). * ``area-type``: The area can be NSSA or stub. * ``nssa``: Not-So-Stubby Area. This is an area that allows OSPF to import external routes into a stub area via a new LSA type. * ``stub``: This is an area where no router originates routes external to OSPF and hence an area where all external routes are via the ABR(s). * ``authentication``: OSPF area authentication type. Can either be ``plain-text`` or ``md5``. * ``network``: OSPF network. This specifies the interfaces enabled for OSPF. If the interface has an address within the defined range, the command enables OSPF on this interface so that the router can provide network information to other OSPF routers through this interface. This parameter is required when an area is configured. * ``range``: It summarizes routes matching prefix (border routers only). This parameter includes ``cost``, metric for this range; ``not-advertise``; and ``substitute``, to announce area range as another prefix. * ``shortcut``: Area's shortcut mode. This parameter includes ``default``, ``enable`` and ``disable``. * ``virtual-link``: Provides backbone area consistency by establishing a virtual-link. This parameter includes ``authentication``; ``dead-interval``, interval after which a neighbor is declared dead; ``hello-interval``, interval between hello packets; ``retransmit-interval``, interval between retransmitting lost link state advertisements; and ``transmit-delay``, link state transmit delay. * ``auto-cost``: Calculate OSPF interface cost according to bandwidth. * ``reference-bandwidth``: Reference bandwidth method to assign OSPF cost in Mbits/sec. * ``default-information``: Control distribution of default information. * ``originate``: Distribute a default route. This parameter includes ``always``, to always advertise default route; ``metric``, default metric; ``metric-type``, metric type for default routes; and ``route-map``, route map reference. * ``default-metric``: Metric of redistributed routes. * ``distance``: Administrative distance. * ``global``: Changes the OSPF distance value globally. * ``ospf``: Changes the OSPF distance value. The arguments are the distance values for ``external`` routes, ``inter-area`` routes and ``intra-area`` routes. * ``log-adjacency-changes``: Allows log changes in adjacency state. With the optional argument ``detail``, all adjacency state changes are displayed, without it, only full changes or regressions are shown. * ``max-metric``: OSPF maximum/infinite-distance metric. * ``router-lsa``: Advertise own Router-LSA with infinite distance (stub router). It can be administratively applied, for an indefinite period (``administrative``). Other possible arguments are ``on-shutdown``, to advertise stub-router prior to full shutdown of OSPF; and ``on-startup``, to automatically advertise stub Router-LSA on startup of OSPF. * ``mpls-te``: MultiProtocol Label Switching-Traffic Engineering (MPLS-TE) parameters. This parameter includes ``enable``, to enable MPLS-TE functionality and ``router-address``, a stable IP address of the advertising router. * ``neighbor``: Specifies the IP address of the neighbor device. Includes ``poll-interval``, to specify the time period in seconds between dead neighbor polling interval, and ``priority``, to specify the priority value of the neighbor router associated with the IP address. * ``paremeters``: OSPF specific parameters. * ``abr-type``: Selects the ABR model. The OSPF router supports four ABR models: ``cisco``, a router is considered an ABR if it has multiple links configured to networks in different areas, one of which is a backbone area, the link to the backbone area must be active; ``ibm``, i dentical to the cisco model, but in this case, a backbone area link may not be active; ``shortcut``, the router has multiple active links to different areas; and ``standard``, identical to standard, but in this model, a router is allowed to use a connected area topology without involving a backbone area for inter-area connections. * ``opaque-lsa``: Enable the Opaque-LSA capability (rfc2370) as partial support for MPLS Traffic Engineering LSA. * ``rfc1583-compatibility``: Enable rfc1583 criteria for handling AS external routes. * ``router-id``: Override the default router identifier. * ``passive``: Suppress routing updates on interface(s). Includes ``all``, to suppress routing updates on all interfaces; ``interface``, to suppress routing updates on an interface; and ``interface-exclude``, to exclude an interface when using 'passive all'. * ``redistribute``: Redistribute information from another routing protocol. This parameter includes the following arguments: ``bgp``, ``connected``, ``kernel``, ``rip`` and ``static``. These five arguments include ``copy-metric``, to use current metric for redistributed routes; ``metric``, the metric for redistributed routes; ``metric-type``, OSPF metric type; and ``route-map``, a route map reference. * ``refresh``: Adjusts refresh parameters. Includes the argument ``timer``, valued in seconds. * ``route-map``: Filter routes installed in local route map. * ``timers``: Adjusts routing timers. * ``throttle``: Throttling adaptive timers. * ``spf``: OSPF SPF timers. This parameter includes the following arguments: ``delay``, the delay, in msec, from first change received till SPF calculation; ``initial-holdtime``, the initial hold time , in msec, between consecutive SPF calculations; and ``max-holdtime``, the maximum hold time in msec. An explanation of each configurable parameter of OSPF in an interface configuration is provided below: * ``authentication``: OSPF interface authentication. Includes ``md5`` and its parameters, an ``encrypted-password`` and a ``plaintext-password``. * ``bandwidth``: Bandwidth of interface in kilobits/sec. * ``bfd``: Enables Bidirectional Forwarding Detection on an interface. Includes the optional argument ``profile``. * ``cost``: Specifies an interface cost. * ``dead-interval``: Interval after which neighbor is dead. * ``hello-interval``: Interval between hello packets. * ``mtu-ignore``: Disables Maximum Transmission Unit (MTU) mismatch detection. * ``network``: Specifies network type: ``broadcast``, ``non-broadcast``, ``point-to-multipoint`` or ``point-to-point``. * ``priority``: Router priority. * ``retransmit-interval``: Interval between retransmitting lost link state advertisements. * ``transmit-delay``: Link state transmit delay in seconds. Monitoring ========== To monitor the status and configuration of OSPF protocol, you can use the following commands: * :osdx:op:`protocols ospf show` to monitor OSPF protocol. .. _ospf_examples: Examples ======== :doc:`Here ` you can find examples related to OSPF. Command Summary =============== .. osdx:cmdtree:: cfg protocols ospf interfaces bridge * ip ospf interfaces bridge * vif * ip ospf interfaces dummy * ip ospf interfaces ethernet * ip ospf interfaces ethernet * vif * ip ospf interfaces openvpn * ip ospf interfaces tunnel * ip ospf interfaces vti * ip ospf interfaces vxlan * ip ospf interfaces wlan * ip ospf .. osdx:cmdtree:: op protocols ospf show