6 @acronym{OSPF,Open Shortest Path First} version 2 is a routing protocol
7 which is described in @cite{RFC2328, OSPF Version 2}. OSPF is an
8 @acronym{IGP,Interior Gateway Protocol}. Compared with @acronym{RIP},
9 @acronym{OSPF} can provide scalable network support and faster
10 convergence times. OSPF is widely used in large networks such as
11 @acronym{ISP,Internet Service Provider} backbone and enterprise
20 * Redistribute routes to OSPF::
21 * Showing OSPF information::
23 * OSPF Traffic Engineering::
24 * Router Information::
27 * OSPF Configuration Examples::
30 @include ospf_fundamentals.texi
32 @node Configuring ospfd
33 @section Configuring ospfd
35 There are no @command{ospfd} specific options. Common options can be
36 specified (@pxref{Common Invocation Options}) to @command{ospfd}.
37 @command{ospfd} needs to acquire interface information from
38 @command{zebra} in order to function. Therefore @command{zebra} must be
39 running before invoking @command{ospfd}. Also, if @command{zebra} is
40 restarted then @command{ospfd} must be too.
42 Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
43 specific configuration file @file{ospfd.conf}.
48 To start OSPF process you have to specify the OSPF router. As of this
49 writing, @command{ospfd} does not support multiple OSPF processes.
51 @deffn Command {router ospf} {}
52 @deffnx Command {no router ospf} {}
53 Enable or disable the OSPF process. @command{ospfd} does not yet
54 support multiple OSPF processes. So you can not specify an OSPF process
58 @deffn {OSPF Command} {ospf router-id @var{a.b.c.d}} {}
59 @deffnx {OSPF Command} {no ospf router-id} {}
60 @anchor{ospf router-id}This sets the router-ID of the OSPF process. The
61 router-ID may be an IP address of the router, but need not be - it can
62 be any arbitrary 32bit number. However it MUST be unique within the
63 entire OSPF domain to the OSPF speaker - bad things will happen if
64 multiple OSPF speakers are configured with the same router-ID! If one
65 is not specified then @command{ospfd} will obtain a router-ID
66 automatically from @command{zebra}.
69 @deffn {OSPF Command} {ospf abr-type @var{type}} {}
70 @deffnx {OSPF Command} {no ospf abr-type @var{type}} {}
71 @var{type} can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
74 The OSPF standard for ABR behaviour does not allow an ABR to consider
75 routes through non-backbone areas when its links to the backbone are
76 down, even when there are other ABRs in attached non-backbone areas
77 which still can reach the backbone - this restriction exists primarily
78 to ensure routing-loops are avoided.
80 With the "Cisco" or "IBM" ABR type, the default in this release of
81 Frr, this restriction is lifted, allowing an ABR to consider
82 summaries learnt from other ABRs through non-backbone areas, and hence
83 route via non-backbone areas as a last resort when, and only when,
84 backbone links are down.
86 Note that areas with fully-adjacent virtual-links are considered to be
87 "transit capable" and can always be used to route backbone traffic, and
88 hence are unaffected by this setting (@pxref{OSPF virtual-link}).
90 More information regarding the behaviour controlled by this command can
91 be found in @cite{RFC 3509, Alternative Implementations of OSPF Area
92 Border Routers}, and @cite{draft-ietf-ospf-shortcut-abr-02.txt}.
94 Quote: "Though the definition of the @acronym{ABR,Area Border Router}
95 in the OSPF specification does not require a router with multiple
96 attached areas to have a backbone connection, it is actually
97 necessary to provide successful routing to the inter-area and
98 external destinations. If this requirement is not met, all traffic
99 destined for the areas not connected to such an ABR or out of the
100 OSPF domain, is dropped. This document describes alternative ABR
101 behaviors implemented in Cisco and IBM routers."
104 @deffn {OSPF Command} {ospf rfc1583compatibility} {}
105 @deffnx {OSPF Command} {no ospf rfc1583compatibility} {}
106 @cite{RFC2328}, the sucessor to @cite{RFC1583}, suggests according
107 to section G.2 (changes) in section 16.4 a change to the path
108 preference algorithm that prevents possible routing loops that were
109 possible in the old version of OSPFv2. More specifically it demands
110 that inter-area paths and intra-area backbone path are now of equal preference
111 but still both preferred to external paths.
113 This command should NOT be set normally.
116 @deffn {OSPF Command} {log-adjacency-changes [detail]} {}
117 @deffnx {OSPF Command} {no log-adjacency-changes [detail]} {}
118 Configures ospfd to log changes in adjacency. With the optional
119 detail argument, all changes in adjacency status are shown. Without detail,
120 only changes to full or regressions are shown.
123 @deffn {OSPF Command} {passive-interface @var{interface}} {}
124 @deffnx {OSPF Command} {no passive-interface @var{interface}} {}
125 @anchor{OSPF passive-interface} Do not speak OSPF interface on the
126 given interface, but do advertise the interface as a stub link in the
127 router-@acronym{LSA,Link State Advertisement} for this router. This
128 allows one to advertise addresses on such connected interfaces without
129 having to originate AS-External/Type-5 LSAs (which have global flooding
130 scope) - as would occur if connected addresses were redistributed into
131 OSPF (@pxref{Redistribute routes to OSPF})@. This is the only way to
132 advertise non-OSPF links into stub areas.
135 @deffn {OSPF Command} {timers throttle spf @var{delay} @var{initial-holdtime} @var{max-holdtime}} {}
136 @deffnx {OSPF Command} {no timers throttle spf} {}
137 This command sets the initial @var{delay}, the @var{initial-holdtime}
138 and the @var{maximum-holdtime} between when SPF is calculated and the
139 event which triggered the calculation. The times are specified in
140 milliseconds and must be in the range of 0 to 600000 milliseconds.
142 The @var{delay} specifies the minimum amount of time to delay SPF
143 calculation (hence it affects how long SPF calculation is delayed after
144 an event which occurs outside of the holdtime of any previous SPF
145 calculation, and also serves as a minimum holdtime).
147 Consecutive SPF calculations will always be seperated by at least
148 'hold-time' milliseconds. The hold-time is adaptive and initially is
149 set to the @var{initial-holdtime} configured with the above command.
150 Events which occur within the holdtime of the previous SPF calculation
151 will cause the holdtime to be increased by @var{initial-holdtime}, bounded
152 by the @var{maximum-holdtime} configured with this command. If the adaptive
153 hold-time elapses without any SPF-triggering event occuring then
154 the current holdtime is reset to the @var{initial-holdtime}. The current
155 holdtime can be viewed with @ref{show ip ospf}, where it is expressed as
156 a multiplier of the @var{initial-holdtime}.
161 timers throttle spf 200 400 10000
165 In this example, the @var{delay} is set to 200ms, the @var{initial
166 holdtime} is set to 400ms and the @var{maximum holdtime} to 10s. Hence
167 there will always be at least 200ms between an event which requires SPF
168 calculation and the actual SPF calculation. Further consecutive SPF
169 calculations will always be seperated by between 400ms to 10s, the
170 hold-time increasing by 400ms each time an SPF-triggering event occurs
171 within the hold-time of the previous SPF calculation.
173 This command supercedes the @command{timers spf} command in previous Frr
177 @deffn {OSPF Command} {max-metric router-lsa [on-startup|on-shutdown] <5-86400>} {}
178 @deffnx {OSPF Command} {max-metric router-lsa administrative} {}
179 @deffnx {OSPF Command} {no max-metric router-lsa [on-startup|on-shutdown|administrative]} {}
180 This enables @cite{RFC3137, OSPF Stub Router Advertisement} support,
181 where the OSPF process describes its transit links in its router-LSA as
182 having infinite distance so that other routers will avoid calculating
183 transit paths through the router while still being able to reach
184 networks through the router.
186 This support may be enabled administratively (and indefinitely) or
187 conditionally. Conditional enabling of max-metric router-lsas can be
188 for a period of seconds after startup and/or for a period of seconds
191 Enabling this for a period after startup allows OSPF to converge fully
192 first without affecting any existing routes used by other routers,
193 while still allowing any connected stub links and/or redistributed
194 routes to be reachable. Enabling this for a period of time in advance
195 of shutdown allows the router to gracefully excuse itself from the OSPF
198 Enabling this feature administratively allows for administrative
199 intervention for whatever reason, for an indefinite period of time.
200 Note that if the configuration is written to file, this administrative
201 form of the stub-router command will also be written to file. If
202 @command{ospfd} is restarted later, the command will then take effect
203 until manually deconfigured.
205 Configured state of this feature as well as current status, such as the
206 number of second remaining till on-startup or on-shutdown ends, can be
207 viewed with the @ref{show ip ospf} command.
210 @deffn {OSPF Command} {auto-cost reference-bandwidth <1-4294967>} {}
211 @deffnx {OSPF Command} {no auto-cost reference-bandwidth} {}
212 @anchor{OSPF auto-cost reference-bandwidth}This sets the reference
213 bandwidth for cost calculations, where this bandwidth is considered
214 equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
215 100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
216 cost of 1. Cost of lower bandwidth links will be scaled with reference
219 This configuration setting MUST be consistent across all routers within the
223 @deffn {OSPF Command} {network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
224 @deffnx {OSPF Command} {network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
225 @deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
226 @deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
227 @anchor{OSPF network command}
228 This command specifies the OSPF enabled interface(s). If the interface has
229 an address from range 192.168.1.0/24 then the command below enables ospf
230 on this interface so router can provide network information to the other
231 ospf routers via this interface.
236 network 192.168.1.0/24 area 0.0.0.0
240 Prefix length in interface must be equal or bigger (ie. smaller network) than
241 prefix length in network statement. For example statement above doesn't enable
242 ospf on interface with address 192.168.1.1/23, but it does on interface with
243 address 192.168.1.129/25.
245 Note that the behavior when there is a peer address
246 defined on an interface changed after release 0.99.7.
247 Currently, if a peer prefix has been configured,
248 then we test whether the prefix in the network command contains
249 the destination prefix. Otherwise, we test whether the network command prefix
250 contains the local address prefix of the interface.
252 In some cases it may be more convenient to enable OSPF on a per
253 interface/subnet basis (@pxref{OSPF ip ospf area command}).
260 @deffn {OSPF Command} {area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
261 @deffnx {OSPF Command} {area <0-4294967295> range @var{a.b.c.d/m}} {}
262 @deffnx {OSPF Command} {no area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
263 @deffnx {OSPF Command} {no area <0-4294967295> range @var{a.b.c.d/m}} {}
264 Summarize intra area paths from specified area into one Type-3 summary-LSA
265 announced to other areas. This command can be used only in ABR and ONLY
266 router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
267 be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
268 Summarizing Type-7 AS-external-LSAs isn't supported yet by Frr.
273 network 192.168.1.0/24 area 0.0.0.0
274 network 10.0.0.0/8 area 0.0.0.10
275 area 0.0.0.10 range 10.0.0.0/8
279 With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
280 announced into backbone area if area 0.0.0.10 contains at least one intra-area
281 network (ie. described with router or network LSA) from this range.
284 @deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
285 @deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
286 Instead of summarizing intra area paths filter them - ie. intra area paths from this
287 range are not advertised into other areas.
288 This command makes sense in ABR only.
291 @deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
292 @deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
293 Substitute summarized prefix with another prefix.
298 network 192.168.1.0/24 area 0.0.0.0
299 network 10.0.0.0/8 area 0.0.0.10
300 area 0.0.0.10 range 10.0.0.0/8 substitute 11.0.0.0/8
304 One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
305 area 0.0.0.10 contains at least one intra-area network (ie. described with router-LSA or
306 network-LSA) from range 10.0.0.0/8.
307 This command makes sense in ABR only.
310 @deffn {OSPF Command} {area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
311 @deffnx {OSPF Command} {area <0-4294967295> virtual-link @var{a.b.c.d}} {}
312 @deffnx {OSPF Command} {no area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
313 @deffnx {OSPF Command} {no area <0-4294967295> virtual-link @var{a.b.c.d}} {}
314 @anchor{OSPF virtual-link}
317 @deffn {OSPF Command} {area @var{a.b.c.d} shortcut} {}
318 @deffnx {OSPF Command} {area <0-4294967295> shortcut} {}
319 @deffnx {OSPF Command} {no area @var{a.b.c.d} shortcut} {}
320 @deffnx {OSPF Command} {no area <0-4294967295> shortcut} {}
321 Configure the area as Shortcut capable. See @cite{RFC3509}. This requires
322 that the 'abr-type' be set to 'shortcut'.
325 @deffn {OSPF Command} {area @var{a.b.c.d} stub} {}
326 @deffnx {OSPF Command} {area <0-4294967295> stub} {}
327 @deffnx {OSPF Command} {no area @var{a.b.c.d} stub} {}
328 @deffnx {OSPF Command} {no area <0-4294967295> stub} {}
329 Configure the area to be a stub area. That is, an area where no router
330 originates routes external to OSPF and hence an area where all external
331 routes are via the ABR(s). Hence, ABRs for such an area do not need
332 to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
333 area. They need only pass Network-Summary (type-3) LSAs into such an area,
334 along with a default-route summary.
337 @deffn {OSPF Command} {area @var{a.b.c.d} stub no-summary} {}
338 @deffnx {OSPF Command} {area <0-4294967295> stub no-summary} {}
339 @deffnx {OSPF Command} {no area @var{a.b.c.d} stub no-summary} {}
340 @deffnx {OSPF Command} {no area <0-4294967295> stub no-summary} {}
341 Prevents an @command{ospfd} ABR from injecting inter-area
342 summaries into the specified stub area.
345 @deffn {OSPF Command} {area @var{a.b.c.d} default-cost <0-16777215>} {}
346 @deffnx {OSPF Command} {no area @var{a.b.c.d} default-cost <0-16777215>} {}
347 Set the cost of default-summary LSAs announced to stubby areas.
350 @deffn {OSPF Command} {area @var{a.b.c.d} export-list NAME} {}
351 @deffnx {OSPF Command} {area <0-4294967295> export-list NAME} {}
352 @deffnx {OSPF Command} {no area @var{a.b.c.d} export-list NAME} {}
353 @deffnx {OSPF Command} {no area <0-4294967295> export-list NAME} {}
354 Filter Type-3 summary-LSAs announced to other areas originated from intra-
355 area paths from specified area.
360 network 192.168.1.0/24 area 0.0.0.0
361 network 10.0.0.0/8 area 0.0.0.10
362 area 0.0.0.10 export-list foo
364 access-list foo permit 10.10.0.0/16
365 access-list foo deny any
369 With example above any intra-area paths from area 0.0.0.10 and from range
370 10.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
371 other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
372 or 10.128.30.16/30) aren't.
374 This command is only relevant if the router is an ABR for the specified
378 @deffn {OSPF Command} {area @var{a.b.c.d} import-list NAME} {}
379 @deffnx {OSPF Command} {area <0-4294967295> import-list NAME} {}
380 @deffnx {OSPF Command} {no area @var{a.b.c.d} import-list NAME} {}
381 @deffnx {OSPF Command} {no area <0-4294967295> import-list NAME} {}
382 Same as export-list, but it applies to paths announced into specified area as
386 @deffn {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME in} {}
387 @deffnx {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME out} {}
388 @deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME in} {}
389 @deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME out} {}
390 @deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME in} {}
391 @deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME out} {}
392 @deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME in} {}
393 @deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME out} {}
394 Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
395 makes sense in ABR only.
398 @deffn {OSPF Command} {area @var{a.b.c.d} authentication} {}
399 @deffnx {OSPF Command} {area <0-4294967295> authentication} {}
400 @deffnx {OSPF Command} {no area @var{a.b.c.d} authentication} {}
401 @deffnx {OSPF Command} {no area <0-4294967295> authentication} {}
402 Specify that simple password authentication should be used for the given
406 @deffn {OSPF Command} {area @var{a.b.c.d} authentication message-digest} {}
407 @deffnx {OSPF Command} {area <0-4294967295> authentication message-digest} {}
409 @anchor{area authentication message-digest}Specify that OSPF packets
410 must be authenticated with MD5 HMACs within the given area. Keying
411 material must also be configured on a per-interface basis (@pxref{ip
412 ospf message-digest-key}).
414 MD5 authentication may also be configured on a per-interface basis
415 (@pxref{ip ospf authentication message-digest}). Such per-interface
416 settings will override any per-area authentication setting.
420 @section OSPF interface
422 @deffn {Interface Command} {ip ospf area @var{AREA} [@var{ADDR}]} {}
423 @deffnx {Interface Command} {no ip ospf area [@var{ADDR}]} {}
424 @anchor{OSPF ip ospf area command}
426 Enable OSPF on the interface, optionally restricted to just the IP address
427 given by @var{ADDR}, putting it in the @var{AREA} area. Per interface area
428 settings take precedence to network commands (@pxref{OSPF network command}).
430 If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
431 via this command may result in a slight performance improvement.
435 @deffn {Interface Command} {ip ospf authentication-key @var{AUTH_KEY}} {}
436 @deffnx {Interface Command} {no ip ospf authentication-key} {}
437 Set OSPF authentication key to a simple password. After setting @var{AUTH_KEY},
438 all OSPF packets are authenticated. @var{AUTH_KEY} has length up to 8 chars.
440 Simple text password authentication is insecure and deprecated in favour of
441 MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
444 @deffn {Interface Command} {ip ospf authentication message-digest} {}
445 @anchor{ip ospf authentication message-digest}Specify that MD5 HMAC
446 authentication must be used on this interface. MD5 keying material must
447 also be configured (@pxref{ip ospf message-digest-key}). Overrides any
448 authentication enabled on a per-area basis (@pxref{area
449 authentication message-digest}).
451 Note that OSPF MD5 authentication requires that time never go backwards
452 (correct time is NOT important, only that it never goes backwards), even
453 across resets, if ospfd is to be able to promptly reestabish adjacencies
454 with its neighbours after restarts/reboots. The host should have system
455 time be set at boot from an external or non-volatile source (eg battery backed clock, NTP,
456 etc.) or else the system clock should be periodically saved to non-volative
457 storage and restored at boot if MD5 authentication is to be expected to work
461 @deffn {Interface Command} {ip ospf message-digest-key KEYID md5 KEY} {}
462 @deffnx {Interface Command} {no ip ospf message-digest-key} {}
463 @anchor{ip ospf message-digest-key}Set OSPF authentication key to a
464 cryptographic password. The cryptographic algorithm is MD5.
466 KEYID identifies secret key used to create the message digest. This ID
467 is part of the protocol and must be consistent across routers on a
470 KEY is the actual message digest key, of up to 16 chars (larger strings
471 will be truncated), and is associated with the given KEYID.
474 @deffn {Interface Command} {ip ospf cost <1-65535>} {}
475 @deffnx {Interface Command} {no ip ospf cost} {}
476 Set link cost for the specified interface. The cost value is set to router-LSA's
477 metric field and used for SPF calculation.
480 @deffn {Interface Command} {ip ospf dead-interval <1-65535>} {}
481 @deffnx {Interface Command} {ip ospf dead-interval minimal hello-multiplier <2-20>} {}
482 @deffnx {Interface Command} {no ip ospf dead-interval} {}
483 @anchor{ip ospf dead-interval minimal} Set number of seconds for
484 RouterDeadInterval timer value used for Wait Timer and Inactivity
485 Timer. This value must be the same for all routers attached to a
486 common network. The default value is 40 seconds.
488 If 'minimal' is specified instead, then the dead-interval is set to 1
489 second and one must specify a hello-multiplier. The hello-multiplier
490 specifies how many Hellos to send per second, from 2 (every 500ms) to
491 20 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form
492 is specified, then the hello-interval advertised in Hello packets is set to
493 0 and the hello-interval on received Hello packets is not checked, thus
494 the hello-multiplier need NOT be the same across multiple routers on a common
498 @deffn {Interface Command} {ip ospf hello-interval <1-65535>} {}
499 @deffnx {Interface Command} {no ip ospf hello-interval} {}
500 Set number of seconds for HelloInterval timer value. Setting this value,
501 Hello packet will be sent every timer value seconds on the specified interface.
502 This value must be the same for all routers attached to a common network.
503 The default value is 10 seconds.
505 This command has no effect if @ref{ip ospf dead-interval minimal} is also
506 specified for the interface.
509 @deffn {Interface Command} {ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)} {}
510 @deffnx {Interface Command} {no ip ospf network} {}
511 Set explicitly network type for specifed interface.
514 @deffn {Interface Command} {ip ospf priority <0-255>} {}
515 @deffnx {Interface Command} {no ip ospf priority} {}
516 Set RouterPriority integer value. The router with the highest priority
517 will be more eligible to become Designated Router. Setting the value
518 to 0, makes the router ineligible to become Designated Router. The
522 @deffn {Interface Command} {ip ospf retransmit-interval <1-65535>} {}
523 @deffnx {Interface Command} {no ip ospf retransmit interval} {}
524 Set number of seconds for RxmtInterval timer value. This value is used
525 when retransmitting Database Description and Link State Request packets.
526 The default value is 5 seconds.
529 @deffn {Interface Command} {ip ospf transmit-delay} {}
530 @deffnx {Interface Command} {no ip ospf transmit-delay} {}
531 Set number of seconds for InfTransDelay value. LSAs' age should be
532 incremented by this value when transmitting.
533 The default value is 1 seconds.
536 @deffn {Interface Command} {ip ospf area (A.B.C.D|<0-4294967295>)} {}
537 @deffnx {Interface Command} {no ip ospf area} {}
538 Enable ospf on an interface and set associated area.
541 @node Redistribute routes to OSPF
542 @section Redistribute routes to OSPF
544 @deffn {OSPF Command} {redistribute (kernel|connected|static|rip|bgp)} {}
545 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) @var{route-map}} {}
546 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)} {}
547 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map @var{word}} {}
548 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>} {}
549 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map @var{word}} {}
550 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>} {}
551 @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map @var{word}} {}
552 @deffnx {OSPF Command} {no redistribute (kernel|connected|static|rip|bgp)} {}
553 @anchor{OSPF redistribute}Redistribute routes of the specified protocol
554 or kind into OSPF, with the metric type and metric set if specified,
555 filtering the routes using the given route-map if specified.
556 Redistributed routes may also be filtered with distribute-lists, see
557 @ref{ospf distribute-list}.
559 Redistributed routes are distributed as into OSPF as Type-5 External
560 LSAs into links to areas that accept external routes, Type-7 External LSAs
561 for NSSA areas and are not redistributed at all into Stub areas, where
562 external routes are not permitted.
564 Note that for connected routes, one may instead use
565 @dfn{passive-interface}, see @ref{OSPF passive-interface}.
568 @deffn {OSPF Command} {default-information originate} {}
569 @deffnx {OSPF Command} {default-information originate metric <0-16777214>} {}
570 @deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2)} {}
571 @deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
572 @deffnx {OSPF Command} {default-information originate always} {}
573 @deffnx {OSPF Command} {default-information originate always metric <0-16777214>} {}
574 @deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2)} {}
575 @deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
576 @deffnx {OSPF Command} {no default-information originate} {}
577 Originate an AS-External (type-5) LSA describing a default route into
578 all external-routing capable areas, of the specified metric and metric
579 type. If the 'always' keyword is given then the default is always
580 advertised, even when there is no default present in the routing table.
583 @deffn {OSPF Command} {distribute-list NAME out (kernel|connected|static|rip|ospf} {}
584 @deffnx {OSPF Command} {no distribute-list NAME out (kernel|connected|static|rip|ospf} {}
585 @anchor{ospf distribute-list}Apply the access-list filter, NAME, to
586 redistributed routes of the given type before allowing the routes to
587 redistributed into OSPF (@pxref{OSPF redistribute}).
590 @deffn {OSPF Command} {default-metric <0-16777214>} {}
591 @deffnx {OSPF Command} {no default-metric} {}
594 @deffn {OSPF Command} {distance <1-255>} {}
595 @deffnx {OSPF Command} {no distance <1-255>} {}
598 @deffn {OSPF Command} {distance ospf (intra-area|inter-area|external) <1-255>} {}
599 @deffnx {OSPF Command} {no distance ospf} {}
602 @deffn {Command} {router zebra} {}
603 @deffnx {Command} {no router zebra} {}
606 @node Showing OSPF information
607 @section Showing OSPF information
609 @deffn {Command} {show ip ospf} {}
610 @anchor{show ip ospf}Show information on a variety of general OSPF and
611 area state and configuration information.
614 @deffn {Command} {show ip ospf interface [INTERFACE]} {}
615 Show state and configuration of OSPF the specified interface, or all
616 interfaces if no interface is given.
619 @deffn {Command} {show ip ospf neighbor} {}
620 @deffnx {Command} {show ip ospf neighbor INTERFACE} {}
621 @deffnx {Command} {show ip ospf neighbor detail} {}
622 @deffnx {Command} {show ip ospf neighbor INTERFACE detail} {}
625 @deffn {Command} {show ip ospf database} {}
628 @deffn {Command} {show ip ospf database (asbr-summary|external|network|router|summary)} {}
629 @deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id}} {}
630 @deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} adv-router @var{adv-router}} {}
631 @deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) adv-router @var{adv-router}} {}
632 @deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} self-originate} {}
633 @deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) self-originate} {}
636 @deffn {Command} {show ip ospf database max-age} {}
639 @deffn {Command} {show ip ospf database self-originate} {}
642 @deffn {Command} {show ip ospf route} {}
643 Show the OSPF routing table, as determined by the most recent SPF calculation.
649 @deffn {OSPF Command} {ospf opaque-lsa} {}
650 @deffnx {OSPF Command} {capability opaque} {}
651 @deffnx {OSPF Command} {no ospf opaque-lsa} {}
652 @deffnx {OSPF Command} {no capability opaque} {}
653 @command{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}).
656 @deffn {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external)} {}
657 @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id}} {}
658 @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id} adv-router @var{adv-router}} {}
659 @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router @var{adv-router}} {}
660 @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id} self-originate} {}
661 @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate} {}
662 Show Opaque LSA from the database.
665 @node OSPF Traffic Engineering
666 @section Traffic Engineering
668 @deffn {OSPF Command} {mpls-te on} {}
669 @deffnx {OSPF Command} {no mpls-te} {}
670 Enable Traffic Engineering LSA flooding.
673 @deffn {OSPF Command} {mpls-te router-address <A.B.C.D>} {}
674 @deffnx {OSPF Command} {no mpls-te} {}
675 Configure stable IP address for MPLS-TE. This IP address is then advertise in Opaque LSA Type-10 TLV=1 (TE)
676 option 1 (Router-Address).
679 @deffn {OSPF Command} {mpls-te inter-as area <area-id>|as} {}
680 @deffnx {OSPF Command} {no mpls-te inter-as} {}
681 Enable RFC5392 suuport - Inter-AS TE v2 - to flood Traffic Engineering parameters of Inter-AS link.
682 2 modes are supported: AREA and AS; LSA are flood in AREA <area-id> with Opaque Type-10,
683 respectively in AS with Opaque Type-11. In all case, Opaque-LSA TLV=6.
686 @deffn {Command} {show ip ospf mpls-te interface} {}
687 @deffnx {Command} {show ip ospf mpls-te interface @var{interface}} {}
688 Show MPLS Traffic Engineering parameters for all or specified interface.
691 @deffn {Command} {show ip ospf mpls-te router} {}
692 Show Traffic Engineering router parameters.
695 @node Router Information
696 @section Router Information
698 @deffn {OSPF Command} {router-info [as | area <A.B.C.D>]} {}
699 @deffnx {OSPF Command} {no router-info} {}
700 Enable Router Information (RFC4970) LSA advertisement with AS scope (default) or Area scope flooding
701 when area is specified.
704 @deffn {OSPF Command} {pce address <A.B.C.D>} {}
705 @deffnx {OSPF Command} {no pce address} {}
706 @deffnx {OSPF Command} {pce domain as <0-65535>} {}
707 @deffnx {OSPF Command} {no pce domain as <0-65535>} {}
708 @deffnx {OSPF Command} {pce neighbor as <0-65535>} {}
709 @deffnx {OSPF Command} {no pce neighbor as <0-65535>} {}
710 @deffnx {OSPF Command} {pce flag BITPATTERN} {}
711 @deffnx {OSPF Command} {no pce flag} {}
712 @deffnx {OSPF Command} {pce scope BITPATTERN} {}
713 @deffnx {OSPF Command} {no pce scope} {}
714 The commands are conform to RFC 5088 and allow OSPF router announce Path Compuatation Elemenent (PCE) capabilities
715 through the Router Information (RI) LSA. Router Information must be enable prior to this. The command set/unset
716 respectively the PCE IP adress, Autonomous System (AS) numbers of controlled domains, neighbor ASs, flag and scope.
717 For flag and scope, please refer to RFC5088 for the BITPATTERN recognition. Multiple 'pce neighbor' command could
718 be specified in order to specify all PCE neighbours.
721 @deffn {Command} {show ip ospf router-info} {}
722 Show Router Capabilities flag.
724 @deffn {Command} {show ip ospf router-info pce} {}
725 Show Router Capabilities PCE parameters.
728 @node Segment Routing
729 @section Segment Routing
731 This is an EXPERIMENTAL support of Segment Routing as per draft
732 draft-ietf-ospf-segment-routing-extensions-24i for MPLS dataplane.
734 @deffn {OSPF Command} {segment-routing on} {}
735 @deffnx {OSPF Command} {no segment-routing} {}
736 Enable Segment Routing. Even if this also activate routing information support,
737 it is preferable to also activate routing information, and set accordingly the
741 @deffn {OSPF Command} {segment-routing global-block (0-1048575) (0-1048575)} {}
742 @deffnx {OSPF Command} {no segment-routing global-block} {}
743 Fix the Segment Routing Global Block i.e. the label range used by MPLS to store
744 label in the MPLS FIB.
747 @deffn {OSPF Command} {segment-routing node-msd (1-16)} {}
748 @deffnx {OSPF Command} {no segment-routing node-msd} {}
749 Fix the Maximum Stack Depth supported by the router. The value depend of the
750 MPLS dataplane. E.g. for Linux kernel, since version 4.13 it is 32.
753 @deffn {OSPF Command} {segment-routing prefix A.B.C.D/M index (0-65535)} {}
754 @deffnx {OSPF Command} {no segment-routing prefix A.B.C.D/M} {}
755 Set the Segment Rounting index for the specifyed prefix. Note
756 that, only prefix with /32 corresponding to a loopback interface are
760 @deffn {Command} {show ip ospf database segment-routing} {}
761 @deffnx {Command} {show ip ospf database segment-routing adv-router @var{adv-router}} {}
762 @deffnx {Command} {show ip ospf database segment-routing self-originate} {}
763 Show Segment Routing Data Base, all SR nodes, specific advertized router or self router.
767 @section Debugging OSPF
769 @deffn {Command} {debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
770 @deffnx {Command} {no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
771 Dump Packet for debugging
774 @deffn {Command} {debug ospf ism} {}
775 @deffnx {Command} {debug ospf ism (status|events|timers)} {}
776 @deffnx {Command} {no debug ospf ism} {}
777 @deffnx {Command} {no debug ospf ism (status|events|timers)} {}
778 Show debug information of Interface State Machine
781 @deffn {Command} {debug ospf nsm} {}
782 @deffnx {Command} {debug ospf nsm (status|events|timers)} {}
783 @deffnx {Command} {no debug ospf nsm} {}
784 @deffnx {Command} {no debug ospf nsm (status|events|timers)} {}
785 Show debug information of Network State Machine
788 @deffn {Command} {debug ospf event} {}
789 @deffnx {Command} {no debug ospf event} {}
790 Show debug information of OSPF event
793 @deffn {Command} {debug ospf nssa} {}
794 @deffnx {Command} {no debug ospf nssa} {}
795 Show debug information about Not So Stub Area
798 @deffn {Command} {debug ospf lsa} {}
799 @deffnx {Command} {debug ospf lsa (generate|flooding|refresh)} {}
800 @deffnx {Command} {no debug ospf lsa} {}
801 @deffnx {Command} {no debug ospf lsa (generate|flooding|refresh)} {}
802 Show debug detail of Link State messages
805 @deffn {Command} {debug ospf te} {}
806 @deffnx {Command} {no debug ospf te} {}
807 Show debug information about Traffic Engineering LSA
810 @deffn {Command} {debug ospf zebra} {}
811 @deffnx {Command} {debug ospf zebra (interface|redistribute)} {}
812 @deffnx {Command} {no debug ospf zebra} {}
813 @deffnx {Command} {no debug ospf zebra (interface|redistribute)} {}
814 Show debug information of ZEBRA API
817 @deffn {Command} {show debugging ospf} {}
820 @node OSPF Configuration Examples
821 @section OSPF Configuration Examples
822 A simple example, with MD5 authentication enabled:
828 ip ospf authentication message-digest
829 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
832 network 192.168.0.0/16 area 0.0.0.1
833 area 0.0.0.1 authentication message-digest
837 An @acronym{ABR} router, with MD5 authentication and performing summarisation
838 of networks between the areas:
844 log file /var/log/frr/ospfd.log
848 ip ospf authentication message-digest
849 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
854 ip ospf authentication message-digest
855 ip ospf message-digest-key 2 md5 XYZ12345
858 ospf router-id 192.168.0.1
859 redistribute connected
860 passive interface ppp0
861 network 192.168.0.0/24 area 0.0.0.0
862 network 10.0.0.0/16 area 0.0.0.0
863 network 192.168.1.0/24 area 0.0.0.1
864 area 0.0.0.0 authentication message-digest
865 area 0.0.0.0 range 10.0.0.0/16
866 area 0.0.0.0 range 192.168.0.0/24
867 area 0.0.0.1 authentication message-digest
868 area 0.0.0.1 range 10.2.0.0/16
873 A Traffic Engineering configuration, with Inter-ASv2 support.
875 - First, the 'zebra.conf' part:
881 log file /var/log/zebra.log
884 ip address 198.168.1.1/24
886 mpls-te link metric 10
887 mpls-te link max-bw 1.25e+06
888 mpls-te link max-rsv-bw 1.25e+06
889 mpls-te link unrsv-bw 0 1.25e+06
890 mpls-te link unrsv-bw 1 1.25e+06
891 mpls-te link unrsv-bw 2 1.25e+06
892 mpls-te link unrsv-bw 3 1.25e+06
893 mpls-te link unrsv-bw 4 1.25e+06
894 mpls-te link unrsv-bw 5 1.25e+06
895 mpls-te link unrsv-bw 6 1.25e+06
896 mpls-te link unrsv-bw 7 1.25e+06
897 mpls-te link rsc-clsclr 0xab
900 ip address 192.168.2.1/24
902 mpls-te link metric 10
903 mpls-te link max-bw 1.25e+06
904 mpls-te link max-rsv-bw 1.25e+06
905 mpls-te link unrsv-bw 0 1.25e+06
906 mpls-te link unrsv-bw 1 1.25e+06
907 mpls-te link unrsv-bw 2 1.25e+06
908 mpls-te link unrsv-bw 3 1.25e+06
909 mpls-te link unrsv-bw 4 1.25e+06
910 mpls-te link unrsv-bw 5 1.25e+06
911 mpls-te link unrsv-bw 6 1.25e+06
912 mpls-te link unrsv-bw 7 1.25e+06
913 mpls-te link rsc-clsclr 0xab
914 mpls-te neighbor 192.168.2.2 as 65000
918 - Then the 'ospfd.conf' itself:
924 log file /var/log/ospfd.log
928 ip ospf hello-interval 60
929 ip ospf dead-interval 240
932 ip ospf hello-interval 60
933 ip ospf dead-interval 240
937 ospf router-id 192.168.1.1
938 network 192.168.0.0/16 area 1
941 mpls-te router-address 192.168.1.1
942 mpls-te inter-as area 1
948 A router information example with PCE advsertisement:
954 ospf router-id 192.168.1.1
955 network 192.168.0.0/16 area 1
958 mpls-te router-address 192.168.1.1
959 router-info area 0.0.0.1
960 pce address 192.168.1.1
963 pce neighbor as 65500
964 pce neighbor as 65200