OSPF
This chapter covers some aspects related to the 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 protocols ospf
or in an interface using , interfaces * * ip ospf, for example,
interfaces dummy <txt> ip ospf
or interfaces ethernet <txt> 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 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 beplain-text
ormd5
.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 includescost
, metric for this range;not-advertise
; andsubstitute
, to announce area range as another prefix.shortcut
: Area’s shortcut mode. This parameter includesdefault
,enable
anddisable
.virtual-link
: Provides backbone area consistency by establishing a virtual-link. This parameter includesauthentication
;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; andtransmit-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 includesalways
, to always advertise default route;metric
, default metric;metric-type
, metric type for default routes; androute-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 forexternal
routes,inter-area
routes andintra-area
routes.
log-adjacency-changes
: Allows log changes in adjacency state. With the optional argumentdetail
, 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 areon-shutdown
, to advertise stub-router prior to full shutdown of OSPF; andon-startup
, to automatically advertise stub Router-LSA on startup of OSPF.
mpls-te
: MultiProtocol Label Switching-Traffic Engineering (MPLS-TE) parameters. This parameter includesenable
, to enable MPLS-TE functionality androuter-address
, a stable IP address of the advertising router.neighbor
: Specifies the IP address of the neighbor device. Includespoll-interval
, to specify the time period in seconds between dead neighbor polling interval, andpriority
, 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; andstandard
, 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). Includesall
, to suppress routing updates on all interfaces;interface
, to suppress routing updates on an interface; andinterface-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
andstatic
. These five arguments includecopy-metric
, to use current metric for redistributed routes;metric
, the metric for redistributed routes;metric-type
, OSPF metric type; androute-map
, a route map reference.refresh
: Adjusts refresh parameters. Includes the argumenttimer
, 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; andmax-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. Includesmd5
and its parameters, anencrypted-password
and aplaintext-password
.bandwidth
: Bandwidth of interface in kilobits/sec.bfd
: Enables Bidirectional Forwarding Detection on an interface. Includes the optional argumentprofile
.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
orpoint-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:
protocols ospf show
to monitor OSPF protocol.
Examples
Here you can find examples related to OSPF.
Command Summary
Configuration commands
protocols ospf area <u32|ipv4> area-type nssa default-cost <u32>
protocols ospf area <u32|ipv4> area-type nssa translate <txt>
protocols ospf area <u32|ipv4> area-type stub default-cost <u32>
protocols ospf area <u32|ipv4> range <ipv4net> not-advertise
protocols ospf area <u32|ipv4> range <ipv4net> substitute <ipv4net>
protocols ospf area <u32|ipv4> virtual-link <ipv4> authentication
protocols ospf area <u32|ipv4> virtual-link <ipv4> authentication encrypted-password <password>
protocols ospf area <u32|ipv4> virtual-link <ipv4> authentication message-digest <id>
protocols ospf area <u32|ipv4> virtual-link <ipv4> authentication message-digest <id> password <txt>
protocols ospf area <u32|ipv4> virtual-link <ipv4> authentication password <txt>
protocols ospf area <u32|ipv4> virtual-link <ipv4> dead-interval <u32>
protocols ospf area <u32|ipv4> virtual-link <ipv4> hello-interval <u32>
protocols ospf area <u32|ipv4> virtual-link <ipv4> retransmit-interval <u32>
protocols ospf area <u32|ipv4> virtual-link <ipv4> transmit-delay <u32>
protocols ospf default-information originate metric-type <u32>
protocols ospf default-information originate route-map <txt>
interfaces bridge <txt> ip ospf authentication encrypted-password <password>
interfaces bridge <txt> ip ospf authentication message-digest <id>
interfaces bridge <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces bridge <txt> ip ospf authentication message-digest <id> password <txt>
interfaces bridge <txt> ip ospf authentication password <txt>
interfaces bridge <txt> vif <u32> ip ospf authentication encrypted-password <password>
interfaces bridge <txt> vif <u32> ip ospf authentication message-digest <id>
interfaces bridge <txt> vif <u32> ip ospf authentication message-digest <id> password <txt>
interfaces bridge <txt> vif <u32> ip ospf authentication password <txt>
interfaces bridge <txt> vif <u32> ip ospf dead-interval <u32>
interfaces bridge <txt> vif <u32> ip ospf hello-interval <u32>
interfaces bridge <txt> vif <u32> ip ospf retransmit-interval <u32>
interfaces bridge <txt> vif <u32> ip ospf transmit-delay <u32>
interfaces dummy <txt> ip ospf authentication encrypted-password <password>
interfaces dummy <txt> ip ospf authentication message-digest <id>
interfaces dummy <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces dummy <txt> ip ospf authentication message-digest <id> password <txt>
interfaces dummy <txt> ip ospf authentication password <txt>
interfaces ethernet <txt> ip ospf authentication encrypted-password <password>
interfaces ethernet <txt> ip ospf authentication message-digest <id>
interfaces ethernet <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces ethernet <txt> ip ospf authentication message-digest <id> password <txt>
interfaces ethernet <txt> ip ospf authentication password <txt>
interfaces ethernet <txt> vif <u32> ip ospf authentication encrypted-password <password>
interfaces ethernet <txt> vif <u32> ip ospf authentication message-digest <id>
interfaces ethernet <txt> vif <u32> ip ospf authentication message-digest <id> password <txt>
interfaces ethernet <txt> vif <u32> ip ospf authentication password <txt>
interfaces ethernet <txt> vif <u32> ip ospf bfd profile <txt>
interfaces ethernet <txt> vif <u32> ip ospf dead-interval <u32>
interfaces ethernet <txt> vif <u32> ip ospf hello-interval <u32>
interfaces ethernet <txt> vif <u32> ip ospf retransmit-interval <u32>
interfaces ethernet <txt> vif <u32> ip ospf transmit-delay <u32>
interfaces openvpn <txt> ip ospf authentication encrypted-password <password>
interfaces openvpn <txt> ip ospf authentication message-digest <id>
interfaces openvpn <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces openvpn <txt> ip ospf authentication message-digest <id> password <txt>
interfaces openvpn <txt> ip ospf authentication password <txt>
interfaces tunnel <id> ip ospf authentication encrypted-password <password>
interfaces tunnel <id> ip ospf authentication message-digest <id>
interfaces tunnel <id> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces tunnel <id> ip ospf authentication message-digest <id> password <txt>
interfaces tunnel <id> ip ospf authentication password <txt>
interfaces vti <txt> ip ospf authentication encrypted-password <password>
interfaces vti <txt> ip ospf authentication message-digest <id>
interfaces vti <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces vti <txt> ip ospf authentication message-digest <id> password <txt>
interfaces vxlan <txt> ip ospf authentication encrypted-password <password>
interfaces vxlan <txt> ip ospf authentication message-digest <id>
interfaces vxlan <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces vxlan <txt> ip ospf authentication message-digest <id> password <txt>
interfaces vxlan <txt> ip ospf authentication password <txt>
interfaces wlan <txt> ip ospf authentication encrypted-password <password>
interfaces wlan <txt> ip ospf authentication message-digest <id>
interfaces wlan <txt> ip ospf authentication message-digest <id> encrypted-password <password>
interfaces wlan <txt> ip ospf authentication message-digest <id> password <txt>
Operational commands
protocols ospf show database asbr-summary <ipv4> self-originate
protocols ospf show database asbr-summary <ipv4> adv-router <ipv4>
protocols ospf show database external <ipv4> adv-router <ipv4>
protocols ospf show database network <ipv4> adv-router <ipv4>
protocols ospf show database nssa-external adv-router <ipv4>
protocols ospf show database nssa-external <ipv4> self-originate
protocols ospf show database nssa-external <ipv4> adv-router <ipv4>
protocols ospf show database opaque-area <ipv4> self-originate
protocols ospf show database opaque-area <ipv4> adv-router <ipv4>
protocols ospf show database opaque-as <ipv4> self-originate
protocols ospf show database opaque-as <ipv4> adv-router <ipv4>
protocols ospf show database opaque-link <ipv4> self-originate
protocols ospf show database opaque-link <ipv4> adv-router <ipv4>
protocols ospf show database router <ipv4> adv-router <ipv4>
protocols ospf show database segment-routing adv-router <ipv4>
protocols ospf show database segment-routing <ipv4> self-originate
protocols ospf show database segment-routing <ipv4> adv-router <ipv4>
protocols ospf show database summary <ipv4> adv-router <ipv4>