Tip

This is the documentation for the 24.06 version. Looking for the documentation of the latest version? Have a look here.

OSPF Server Configuration

To configure an OSPF server, start in config-frr-ospf mode and run the server vrf <vrf-name> command, where <vrf-name> is the name of a Virtual Routing and Forwarding instance or default for the default route table:

tnsr(config)# route dynamic ospf
tnsr(config-frr-ospf)# server vrf default
tnsr(config-ospf)#

This changes into config-ospf mode, which contains the following commands:

area <area-id>:

Configures area-specific settings in OSPF Area Configuration mode.

auto-cost reference-bandwidth <bw>:

A base value, in Mbit/s, which is used when OSPF automatically calculates cost values. The default value is 100 which means that an interface with 100Mbit/s of bandwidth or greater will have a cost of 1, with lower bandwidth values incurring higher cost values.

All routers in the same area should use the same value, otherwise automatic cost calculations would fail to accurately represent total path costs between routers.

capability opaque-lsa:

Enables support for Opaque LSAs, as described in RFC 2370.

compatible rfc-1583-compatibility:

Enables compatibility with the older OSPF standard from RFC 1583, which has been obsoleted by the newer RFC 2328. The specific change this option enables relates to external path preference calculation and routing loop prevention. See RFC 2328 section G.2 for specific details.

default-information originate [(always|metric <val>|type (1|2)|route-map <map>)]:

Enables origination of a Type 5 AS-External LSA containing default route information into all areas capable of external routing.

always:

Always advertise a default route, even when a default route is not present in the local routing table.

metric <val>:

Advertise the default route as having the given metric.

type <type>:

The type of metric, either 1 or 2. See Metric Types for details about each type operates.

route-map <map>:

Apply the given route map to the outbound route advertisement.

default-metric <val>:

Uses the given metric value as the default metric for OSPF routes when no other metric information is available.

distance [(external|inter-area|intra-area)] <dist>:

Sets an administrative distance for routes obtained via OSPF. This can be configured globally as well as for specific types of OSPF routes.

external <dist>:

Sets the administrative distance for external OSPF routes.

inter-area <dist>:

Sets the administrative distance for OSPF routes between areas.

intra-area <dist>:

Sets the administrative distance for OSPF routes inside an area.

distribution-list out <route-source> access-list <name>:

Applies the given access list <name> to routes redistributed from the specified <route-source>.

Available route sources are listed in Dynamic Routing Protocol Lists, with the exception of ospf which cannot be used with this command.

log-adjacency-changes [detail]:

Instructs the OSPF daemon to log changes in neighbor adjacencies. This is useful for tracking changes to neighbor relationships, especially during initial configuration.

The optional detail parameter increases the verbosity of the resulting log messages.

See also

See Logging for information on dynamic routing logging.

max-metric router-lsa (on-shutdown|on-startup) <seconds>:

Conditionally sets the administrative distance of routes through this router to infinity for a period of time after startup or shutdown. This allows other routers in the area to avoid using routes through this router until a full convergence is achieved.

neighbor <ip4-address> [(poll-interval <interval>|priority <prio>)]:

Defines a non-multicast neighbor statically and configures per-neighbor settings for polling and priority.

poll-interval <interval>:

Time, in seconds, between sending OSPF Hello messages to neighbors in a down state.

priority <prio>:

A priority value applied to neighbors in a down state.

Note

WireGuard VPN interfaces are non-broadcast interfaces which require static neighbor definitions. See WireGuard VPN with OSPF Dynamic Routing for details.

ospf abr-type (cisco|ibm|shortcut|standard):

Controls the behavior of Area Border Router (ABR) functionality.

cisco|ibm:

The default behavior of OSPF on TNSR, discussed in RFC 3509. This behavior allows an ABR without a backbone connection to act as an internal router for all connected areas.

shortcut:

Discussed in draft-ietf-ospf-shortcut-abr-02, this behavior allows ABRs to consider summary LSAs from all attached areas, rather than being forced to route through a suboptimal path only because it is shorter.

standard:

The ABR behavior described in the original OSPF standard. When set, a router attached to multiple areas requires a connection to a backbone. If no backbone is available, traffic attempting to cross areas will be dropped.

ospf router-id <router-id>:

Sets the router ID for the OSPF daemon. This is typically set to an IP address unique to this router, and commonly is set to a local private address.

ospf write-multiplier <write>:

Number of interfaces processed per write operation, from 1-100. Default value is 20.

passive-interface <if-name> [<ip4-address>]:

Configures the specified interface as passive. This prevents the interface from actively participating in OSPF, while still allowing OSPF to operate on networks connected to that interface. This is commonly used for local interfaces without other routers attached. OSPF will announce networks attached to passive interfaces as stub links.

pce address (<ip4-address>|domain <asn>|flags <bits>|neighbor <asn>|scope <bits>):

Configures RFC 5088 Path Computation Element (PCE) Discovery for OSPF. When active, this router will advertise support for PCE to neighbors via router information (RI) announcements. Requires router-info as to also be enabled.

<ip4-address>:

The IP address used to reach the PCE

domain <asn>:

AS numbers of domains controlled by the PCE, meaning it can compute paths for the autonomous systems and has visibility into them.

flags <bits>:

Capability flags for the PCE, expressed as a bit pattern. The bits meanings are defined in RFC 5088 section 4.5:

PCE Capability Flags

Bit

Capability

0

Path computation with GMPLS link constraints

1

Bidirectional path computation

2

Diverse path computation

3

Load-balanced path computation

4

Synchronized path computation

5

Support for multiple objective functions

6

Support for additive path constraints (max hop count, etc.)

7

Support for request prioritization

8

Support for multiple requests per message

neighbor <asn>:

AS numbers of neighboring domains for which the PCE can compute paths.

scope <bits>:

Scope for path computation, such as intra-area, inter-area, inter-AS, or inter-layer, expressed as a bit mask. The bits meanings are defined in RFC 5088 section 4.2:

PCE Scope

Bit

Path Scope

0

L bit: Can compute intra-area paths.

1

R bit: Can act as PCE for inter-area TE LSP computation.

2

Rd bit: Can act as a default PCE for inter-area TE LSP computation.

3

S bit: Can act as PCE for inter-AS TE LSP computation.

4

Sd bit: Can act as a default PCE for inter-AS TE LSP computation.

5

Y bit: Can act as PCE for inter-layer TE LSP computation.

redistribute <route-source> [(metric <val>|route-map <map>|type <type>)]:

Enables redistribution of routes from another source. Available route sources are listed in Dynamic Routing Protocol Lists.

metric <val>:

Advertise the default route as having the given metric.

type <type>:

The type of metric, either 1 or 2. See Metric Types for details about each type operates.

route-map <map>:

Apply the given route map to the redistributed route advertisements.

refresh timer <time>:

Time, in seconds from 10-1800, between refreshing LSA information. Default value is 10.

router-info as:

Enables advertisement of optional router capabilities to neighbors, as described in RFC 4970. This adds information about enabled features, such as PCE, to Router Information (RI) LSA messages.

timers lsa min-arrival <min>:

The minimum time allowed between advertisements by neighbors, from 0-600000, in milliseconds. Default is 1000.

timers throttle lsa all <delay>:

Time between LSA transmissions from this router, in milliseconds, from 0-5000. Default is 5000.

timers throttle spf (delay|initial-hold|maximum-hold) <val>:

Controls timers that determine when the router will make SPF routing decisions.

delay <val>:

Minimum time after an event occurs before allowing SPF calculation. Lower values will react faster to changes, but can be less stable. Specified in milliseconds from 0-600000, with a default value of 0.

initial-hold <val>:

Lowest time allowed between SPF calculations. Specified in milliseconds from 0-600000, with a default value of 50.

maximum-hold <val>:

Highest time allowed between SPF calculations. Specified in milliseconds from 0-600000, with a default value of 5000.

SPF calculations are adaptive, and if a new event occurs which would otherwise trigger a calculation before the hold timer expires, then the hold is increased by the initial-hold value, up to the specified maximum-hold. This avoids excessive consecutive recalculations.