7 :abbr:`OSPF (Open Shortest Path First)` version 2 is a routing protocol which
8 is described in :rfc:`2328`. OSPF is an :abbr:`IGP (Interior Gateway
9 Protocol)`. Compared with :abbr:`RIP`, :abbr:`OSPF` can provide scalable
10 network support and faster convergence times. OSPF is widely used in large
11 networks such as :abbr:`ISP (Internet Service Provider)` backbone and
14 .. include:: ospf_fundamentals.rst
16 .. _configuring-ospfd:
21 There are no *ospfd* specific options. Common options can be specified
22 (:ref:`common-invocation-options`) to *ospfd*. *ospfd* needs to acquire
23 interface information from *zebra* in order to function. Therefore *zebra* must
24 be running before invoking *ospfd*. Also, if *zebra* is restarted then *ospfd*
27 Like other daemons, *ospfd* configuration is done in :abbr:`OSPF` specific
28 configuration file :file:`ospfd.conf`.
35 To start OSPF process you have to specify the OSPF router. As of this
36 writing, *ospfd* does not support multiple OSPF processes.
38 .. index:: router ospf
39 .. clicmd:: router ospf
41 .. index:: no router ospf
42 .. clicmd:: no router ospf
44 Enable or disable the OSPF process. *ospfd* does not yet
45 support multiple OSPF processes. So you can not specify an OSPF process
48 .. index:: ospf router-id A.B.C.D
49 .. clicmd:: ospf router-id A.B.C.D
51 .. index:: no ospf router-id
52 .. clicmd:: no ospf router-id
54 This sets the router-ID of the OSPF process. The
55 router-ID may be an IP address of the router, but need not be - it can
56 be any arbitrary 32bit number. However it MUST be unique within the
57 entire OSPF domain to the OSPF speaker - bad things will happen if
58 multiple OSPF speakers are configured with the same router-ID! If one
59 is not specified then *ospfd* will obtain a router-ID
60 automatically from *zebra*.
62 .. index:: ospf abr-type TYPE
63 .. clicmd:: ospf abr-type TYPE
65 .. index:: no ospf abr-type TYPE
66 .. clicmd:: no ospf abr-type TYPE
68 `type` can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
71 The OSPF standard for ABR behaviour does not allow an ABR to consider
72 routes through non-backbone areas when its links to the backbone are
73 down, even when there are other ABRs in attached non-backbone areas
74 which still can reach the backbone - this restriction exists primarily
75 to ensure routing-loops are avoided.
77 With the "Cisco" or "IBM" ABR type, the default in this release of FRR, this
78 restriction is lifted, allowing an ABR to consider summaries learned from
79 other ABRs through non-backbone areas, and hence route via non-backbone
80 areas as a last resort when, and only when, backbone links are down.
82 Note that areas with fully-adjacent virtual-links are considered to be
83 "transit capable" and can always be used to route backbone traffic, and
84 hence are unaffected by this setting (:clicmd:`area A.B.C.D virtual-link A.B.C.D`).
86 More information regarding the behaviour controlled by this command can
87 be found in :rfc:`3509`, and :t:`draft-ietf-ospf-shortcut-abr-02.txt`.
89 Quote: "Though the definition of the :abbr:`ABR (Area Border Router)`
90 in the OSPF specification does not require a router with multiple
91 attached areas to have a backbone connection, it is actually
92 necessary to provide successful routing to the inter-area and
93 external destinations. If this requirement is not met, all traffic
94 destined for the areas not connected to such an ABR or out of the
95 OSPF domain, is dropped. This document describes alternative ABR
96 behaviors implemented in Cisco and IBM routers."
98 .. index:: ospf rfc1583compatibility
99 .. clicmd:: ospf rfc1583compatibility
101 .. index:: no ospf rfc1583compatibility
102 .. clicmd:: no ospf rfc1583compatibility
104 :rfc:`2328`, the successor to :rfc:`1583`, suggests according
105 to section G.2 (changes) in section 16.4 a change to the path
106 preference algorithm that prevents possible routing loops that were
107 possible in the old version of OSPFv2. More specifically it demands
108 that inter-area paths and intra-area backbone path are now of equal preference
109 but still both preferred to external paths.
111 This command should NOT be set normally.
113 .. index:: log-adjacency-changes [detail]
114 .. clicmd:: log-adjacency-changes [detail]
116 .. index:: no log-adjacency-changes [detail]
117 .. clicmd:: no log-adjacency-changes [detail]
119 Configures ospfd to log changes in adjacency. With the optional
120 detail argument, all changes in adjacency status are shown. Without detail,
121 only changes to full or regressions are shown.
123 .. index:: passive-interface INTERFACE
124 .. clicmd:: passive-interface INTERFACE
126 .. index:: no passive-interface INTERFACE
127 .. clicmd:: no passive-interface INTERFACE
129 Do not speak OSPF interface on the
130 given interface, but do advertise the interface as a stub link in the
131 router-:abbr:`LSA (Link State Advertisement)` for this router. This
132 allows one to advertise addresses on such connected interfaces without
133 having to originate AS-External/Type-5 LSAs (which have global flooding
134 scope) - as would occur if connected addresses were redistributed into
135 OSPF (:ref:`redistribute-routes-to-ospf`). This is the only way to
136 advertise non-OSPF links into stub areas.
138 .. index:: timers throttle spf DELAY INITIAL-HOLDTIME MAX-HOLDTIME
139 .. clicmd:: timers throttle spf DELAY INITIAL-HOLDTIME MAX-HOLDTIME
141 .. index:: no timers throttle spf
142 .. clicmd:: no timers throttle spf
144 This command sets the initial `delay`, the `initial-holdtime`
145 and the `maximum-holdtime` between when SPF is calculated and the
146 event which triggered the calculation. The times are specified in
147 milliseconds and must be in the range of 0 to 600000 milliseconds.
149 The `delay` specifies the minimum amount of time to delay SPF
150 calculation (hence it affects how long SPF calculation is delayed after
151 an event which occurs outside of the holdtime of any previous SPF
152 calculation, and also serves as a minimum holdtime).
154 Consecutive SPF calculations will always be separated by at least
155 'hold-time' milliseconds. The hold-time is adaptive and initially is
156 set to the `initial-holdtime` configured with the above command.
157 Events which occur within the holdtime of the previous SPF calculation
158 will cause the holdtime to be increased by `initial-holdtime`, bounded
159 by the `maximum-holdtime` configured with this command. If the adaptive
160 hold-time elapses without any SPF-triggering event occurring then
161 the current holdtime is reset to the `initial-holdtime`. The current
162 holdtime can be viewed with :clicmd:`show ip ospf`, where it is expressed as
163 a multiplier of the `initial-holdtime`.
168 timers throttle spf 200 400 10000
171 In this example, the `delay` is set to 200ms, the initial holdtime is set to
172 400ms and the `maximum holdtime` to 10s. Hence there will always be at least
173 200ms between an event which requires SPF calculation and the actual SPF
174 calculation. Further consecutive SPF calculations will always be separated
175 by between 400ms to 10s, the hold-time increasing by 400ms each time an
176 SPF-triggering event occurs within the hold-time of the previous SPF
179 This command supercedes the *timers spf* command in previous FRR
182 .. index:: max-metric router-lsa [on-startup|on-shutdown] (5-86400)
183 .. clicmd:: max-metric router-lsa [on-startup|on-shutdown] (5-86400)
185 .. index:: max-metric router-lsa administrative
186 .. clicmd:: max-metric router-lsa administrative
188 .. index:: no max-metric router-lsa [on-startup|on-shutdown|administrative]
189 .. clicmd:: no max-metric router-lsa [on-startup|on-shutdown|administrative]
191 This enables :rfc:`3137` support, where the OSPF process describes its
192 transit links in its router-LSA as having infinite distance so that other
193 routers will avoid calculating transit paths through the router while still
194 being able to reach networks through the router.
196 This support may be enabled administratively (and indefinitely) or
197 conditionally. Conditional enabling of max-metric router-lsas can be for a
198 period of seconds after startup and/or for a period of seconds prior to
201 Enabling this for a period after startup allows OSPF to converge fully first
202 without affecting any existing routes used by other routers, while still
203 allowing any connected stub links and/or redistributed routes to be
204 reachable. Enabling this for a period of time in advance of shutdown allows
205 the router to gracefully excuse itself from the OSPF domain.
207 Enabling this feature administratively allows for administrative
208 intervention for whatever reason, for an indefinite period of time. Note
209 that if the configuration is written to file, this administrative form of
210 the stub-router command will also be written to file. If *ospfd* is
211 restarted later, the command will then take effect until manually
214 Configured state of this feature as well as current status, such as the
215 number of second remaining till on-startup or on-shutdown ends, can be
216 viewed with the :clicmd:`show ip ospf` command.
218 .. index:: auto-cost reference-bandwidth (1-4294967)
219 .. clicmd:: auto-cost reference-bandwidth (1-4294967)
221 .. index:: no auto-cost reference-bandwidth
222 .. clicmd:: no auto-cost reference-bandwidth
224 This sets the reference
225 bandwidth for cost calculations, where this bandwidth is considered
226 equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
227 100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
228 cost of 1. Cost of lower bandwidth links will be scaled with reference
231 This configuration setting MUST be consistent across all routers within the
234 .. index:: network A.B.C.D/M area A.B.C.D
235 .. clicmd:: network A.B.C.D/M area A.B.C.D
237 .. index:: network A.B.C.D/M area (0-4294967295)
238 .. clicmd:: network A.B.C.D/M area (0-4294967295)
240 .. index:: no network A.B.C.D/M area A.B.C.D
241 .. clicmd:: no network A.B.C.D/M area A.B.C.D
243 .. index:: no network A.B.C.D/M area (0-4294967295)
244 .. clicmd:: no network A.B.C.D/M area (0-4294967295)
246 This command specifies the OSPF enabled interface(s). If the interface has
247 an address from range 192.168.1.0/24 then the command below enables ospf
248 on this interface so router can provide network information to the other
249 ospf routers via this interface.
254 network 192.168.1.0/24 area 0.0.0.0
256 Prefix length in interface must be equal or bigger (i.e. smaller network) than
257 prefix length in network statement. For example statement above doesn't enable
258 ospf on interface with address 192.168.1.1/23, but it does on interface with
259 address 192.168.1.129/25.
261 Note that the behavior when there is a peer address
262 defined on an interface changed after release 0.99.7.
263 Currently, if a peer prefix has been configured,
264 then we test whether the prefix in the network command contains
265 the destination prefix. Otherwise, we test whether the network command prefix
266 contains the local address prefix of the interface.
268 In some cases it may be more convenient to enable OSPF on a per
269 interface/subnet basis (:clicmd:`ip ospf area AREA [ADDR]`).
277 .. index:: area A.B.C.D range A.B.C.D/M
278 .. clicmd:: area A.B.C.D range A.B.C.D/M
280 .. index:: area (0-4294967295) range A.B.C.D/M
281 .. clicmd:: area (0-4294967295) range A.B.C.D/M
283 .. index:: no area A.B.C.D range A.B.C.D/M
284 .. clicmd:: no area A.B.C.D range A.B.C.D/M
286 .. index:: no area (0-4294967295) range A.B.C.D/M
287 .. clicmd:: no area (0-4294967295) range A.B.C.D/M
289 Summarize intra area paths from specified area into one Type-3 summary-LSA
290 announced to other areas. This command can be used only in ABR and ONLY
291 router-LSAs (Type-1) and network-LSAs (Type-2) (i.e. LSAs with scope area) can
292 be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
293 Summarizing Type-7 AS-external-LSAs isn't supported yet by FRR.
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
303 With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
304 announced into backbone area if area 0.0.0.10 contains at least one intra-area
305 network (i.e. described with router or network LSA) from this range.
307 .. index:: area A.B.C.D range IPV4_PREFIX not-advertise
308 .. clicmd:: area A.B.C.D range IPV4_PREFIX not-advertise
310 .. index:: no area A.B.C.D range IPV4_PREFIX not-advertise
311 .. clicmd:: no area A.B.C.D range IPV4_PREFIX not-advertise
313 Instead of summarizing intra area paths filter them - i.e. intra area paths from this
314 range are not advertised into other areas.
315 This command makes sense in ABR only.
317 .. index:: area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
318 .. clicmd:: area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
320 .. index:: no area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
321 .. clicmd:: no area A.B.C.D range IPV4_PREFIX substitute IPV4_PREFIX
323 Substitute summarized prefix with another prefix.
328 network 192.168.1.0/24 area 0.0.0.0
329 network 10.0.0.0/8 area 0.0.0.10
330 area 0.0.0.10 range 10.0.0.0/8 substitute 11.0.0.0/8
333 One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
334 area 0.0.0.10 contains at least one intra-area network (i.e. described with router-LSA or
335 network-LSA) from range 10.0.0.0/8.
336 This command makes sense in ABR only.
338 .. index:: area A.B.C.D virtual-link A.B.C.D
339 .. clicmd:: area A.B.C.D virtual-link A.B.C.D
341 .. index:: area (0-4294967295) virtual-link A.B.C.D
342 .. clicmd:: area (0-4294967295) virtual-link A.B.C.D
344 .. index:: no area A.B.C.D virtual-link A.B.C.D
345 .. clicmd:: no area A.B.C.D virtual-link A.B.C.D
347 .. index:: no area (0-4294967295) virtual-link A.B.C.D
348 .. clicmd:: no area (0-4294967295) virtual-link A.B.C.D
350 .. index:: area A.B.C.D shortcut
351 .. clicmd:: area A.B.C.D shortcut
353 .. index:: area (0-4294967295) shortcut
354 .. clicmd:: area (0-4294967295) shortcut
356 .. index:: no area A.B.C.D shortcut
357 .. clicmd:: no area A.B.C.D shortcut
359 .. index:: no area (0-4294967295) shortcut
360 .. clicmd:: no area (0-4294967295) shortcut
362 Configure the area as Shortcut capable. See :rfc:`3509`. This requires
363 that the 'abr-type' be set to 'shortcut'.
365 .. index:: area A.B.C.D stub
366 .. clicmd:: area A.B.C.D stub
368 .. index:: area (0-4294967295) stub
369 .. clicmd:: area (0-4294967295) stub
371 .. index:: no area A.B.C.D stub
372 .. clicmd:: no area A.B.C.D stub
374 .. index:: no area (0-4294967295) stub
375 .. clicmd:: no area (0-4294967295) stub
377 Configure the area to be a stub area. That is, an area where no router
378 originates routes external to OSPF and hence an area where all external
379 routes are via the ABR(s). Hence, ABRs for such an area do not need
380 to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
381 area. They need only pass Network-Summary (type-3) LSAs into such an area,
382 along with a default-route summary.
384 .. index:: area A.B.C.D stub no-summary
385 .. clicmd:: area A.B.C.D stub no-summary
387 .. index:: area (0-4294967295) stub no-summary
388 .. clicmd:: area (0-4294967295) stub no-summary
390 .. index:: no area A.B.C.D stub no-summary
391 .. clicmd:: no area A.B.C.D stub no-summary
393 .. index:: no area (0-4294967295) stub no-summary
394 .. clicmd:: no area (0-4294967295) stub no-summary
396 Prevents an *ospfd* ABR from injecting inter-area
397 summaries into the specified stub area.
399 .. index:: area A.B.C.D default-cost (0-16777215)
400 .. clicmd:: area A.B.C.D default-cost (0-16777215)
402 .. index:: no area A.B.C.D default-cost (0-16777215)
403 .. clicmd:: no area A.B.C.D default-cost (0-16777215)
405 Set the cost of default-summary LSAs announced to stubby areas.
407 .. index:: area A.B.C.D export-list NAME
408 .. clicmd:: area A.B.C.D export-list NAME
410 .. index:: area (0-4294967295) export-list NAME
411 .. clicmd:: area (0-4294967295) export-list NAME
413 .. index:: no area A.B.C.D export-list NAME
414 .. clicmd:: no area A.B.C.D export-list NAME
416 .. index:: no area (0-4294967295) export-list NAME
417 .. clicmd:: no area (0-4294967295) export-list NAME
419 Filter Type-3 summary-LSAs announced to other areas originated from intra-
420 area paths from specified area.
425 network 192.168.1.0/24 area 0.0.0.0
426 network 10.0.0.0/8 area 0.0.0.10
427 area 0.0.0.10 export-list foo
429 access-list foo permit 10.10.0.0/16
430 access-list foo deny any
432 With example above any intra-area paths from area 0.0.0.10 and from range
433 10.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
434 other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
435 or 10.128.30.16/30) aren't.
437 This command is only relevant if the router is an ABR for the specified
440 .. index:: area A.B.C.D import-list NAME
441 .. clicmd:: area A.B.C.D import-list NAME
443 .. index:: area (0-4294967295) import-list NAME
444 .. clicmd:: area (0-4294967295) import-list NAME
446 .. index:: no area A.B.C.D import-list NAME
447 .. clicmd:: no area A.B.C.D import-list NAME
449 .. index:: no area (0-4294967295) import-list NAME
450 .. clicmd:: no area (0-4294967295) import-list NAME
452 Same as export-list, but it applies to paths announced into specified area
453 as Type-3 summary-LSAs.
455 .. index:: area A.B.C.D filter-list prefix NAME in
456 .. clicmd:: area A.B.C.D filter-list prefix NAME in
458 .. index:: area A.B.C.D filter-list prefix NAME out
459 .. clicmd:: area A.B.C.D filter-list prefix NAME out
461 .. index:: area (0-4294967295) filter-list prefix NAME in
462 .. clicmd:: area (0-4294967295) filter-list prefix NAME in
464 .. index:: area (0-4294967295) filter-list prefix NAME out
465 .. clicmd:: area (0-4294967295) filter-list prefix NAME out
467 .. index:: no area A.B.C.D filter-list prefix NAME in
468 .. clicmd:: no area A.B.C.D filter-list prefix NAME in
470 .. index:: no area A.B.C.D filter-list prefix NAME out
471 .. clicmd:: no area A.B.C.D filter-list prefix NAME out
473 .. index:: no area (0-4294967295) filter-list prefix NAME in
474 .. clicmd:: no area (0-4294967295) filter-list prefix NAME in
476 .. index:: no area (0-4294967295) filter-list prefix NAME out
477 .. clicmd:: no area (0-4294967295) filter-list prefix NAME out
479 Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
480 makes sense in ABR only.
482 .. index:: area A.B.C.D authentication
483 .. clicmd:: area A.B.C.D authentication
485 .. index:: area (0-4294967295) authentication
486 .. clicmd:: area (0-4294967295) authentication
488 .. index:: no area A.B.C.D authentication
489 .. clicmd:: no area A.B.C.D authentication
491 .. index:: no area (0-4294967295) authentication
492 .. clicmd:: no area (0-4294967295) authentication
494 Specify that simple password authentication should be used for the given
497 .. index:: area A.B.C.D authentication message-digest
498 .. clicmd:: area A.B.C.D authentication message-digest
500 .. index:: area (0-4294967295) authentication message-digest
501 .. clicmd:: area (0-4294967295) authentication message-digest
503 Specify that OSPF packets must be authenticated with MD5 HMACs within the
504 given area. Keying material must also be configured on a per-interface basis
505 (:clicmd:`ip ospf message-digest-key`).
507 MD5 authentication may also be configured on a per-interface basis
508 (:clicmd:`ip ospf authentication message-digest`). Such per-interface
509 settings will override any per-area authentication setting.
516 .. index:: ip ospf area AREA [ADDR]
517 .. clicmd:: ip ospf area AREA [ADDR]
519 .. index:: no ip ospf area [ADDR]
520 .. clicmd:: no ip ospf area [ADDR]
522 Enable OSPF on the interface, optionally restricted to just the IP address
523 given by `ADDR`, putting it in the `AREA` area. Per interface area settings
524 take precedence to network commands
525 (:clicmd:`network A.B.C.D/M area A.B.C.D`).
527 If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
528 via this command may result in a slight performance improvement.
530 .. index:: ip ospf authentication-key AUTH_KEY
531 .. clicmd:: ip ospf authentication-key AUTH_KEY
533 .. index:: no ip ospf authentication-key
534 .. clicmd:: no ip ospf authentication-key
536 Set OSPF authentication key to a simple password. After setting `AUTH_KEY`,
537 all OSPF packets are authenticated. `AUTH_KEY` has length up to 8 chars.
539 Simple text password authentication is insecure and deprecated in favour of
540 MD5 HMAC authentication.
542 .. index:: ip ospf authentication message-digest
543 .. clicmd:: ip ospf authentication message-digest
545 Specify that MD5 HMAC authentication must be used on this interface. MD5
546 keying material must also be configured. Overrides any authentication
547 enabled on a per-area basis
548 (:clicmd:`area A.B.C.D authentication message-digest`)
550 Note that OSPF MD5 authentication requires that time never go backwards
551 (correct time is NOT important, only that it never goes backwards), even
552 across resets, if ospfd is to be able to promptly reestablish adjacencies
553 with its neighbours after restarts/reboots. The host should have system time
554 be set at boot from an external or non-volatile source (e.g. battery backed
555 clock, NTP, etc.) or else the system clock should be periodically saved to
556 non-volatile storage and restored at boot if MD5 authentication is to be
557 expected to work reliably.
559 .. index:: ip ospf message-digest-key KEYID md5 KEY
560 .. clicmd:: ip ospf message-digest-key KEYID md5 KEY
562 .. index:: no ip ospf message-digest-key
563 .. clicmd:: no ip ospf message-digest-key
565 Set OSPF authentication key to a cryptographic password. The cryptographic
568 KEYID identifies secret key used to create the message digest. This ID is
569 part of the protocol and must be consistent across routers on a link.
571 KEY is the actual message digest key, of up to 16 chars (larger strings will
572 be truncated), and is associated with the given KEYID.
574 .. index:: ip ospf cost (1-65535)
575 .. clicmd:: ip ospf cost (1-65535)
577 .. index:: no ip ospf cost
578 .. clicmd:: no ip ospf cost
580 Set link cost for the specified interface. The cost value is set to
581 router-LSA's metric field and used for SPF calculation.
583 .. index:: ip ospf dead-interval (1-65535)
584 .. clicmd:: ip ospf dead-interval (1-65535)
586 .. index:: ip ospf dead-interval minimal hello-multiplier (2-20)
587 .. clicmd:: ip ospf dead-interval minimal hello-multiplier (2-20)
589 .. index:: no ip ospf dead-interval
590 .. clicmd:: no ip ospf dead-interval
592 Set number of seconds for RouterDeadInterval timer value used for Wait Timer
593 and Inactivity Timer. This value must be the same for all routers attached
594 to a common network. The default value is 40 seconds.
596 If 'minimal' is specified instead, then the dead-interval is set to 1 second
597 and one must specify a hello-multiplier. The hello-multiplier specifies how
598 many Hellos to send per second, from 2 (every 500ms) to 20 (every 50ms).
599 Thus one can have 1s convergence time for OSPF. If this form is specified,
600 then the hello-interval advertised in Hello packets is set to 0 and the
601 hello-interval on received Hello packets is not checked, thus the
602 hello-multiplier need NOT be the same across multiple routers on a common
605 .. index:: ip ospf hello-interval (1-65535)
606 .. clicmd:: ip ospf hello-interval (1-65535)
608 .. index:: no ip ospf hello-interval
609 .. clicmd:: no ip ospf hello-interval
611 Set number of seconds for HelloInterval timer value. Setting this value,
612 Hello packet will be sent every timer value seconds on the specified interface.
613 This value must be the same for all routers attached to a common network.
614 The default value is 10 seconds.
616 This command has no effect if
617 :clicmd:`ip ospf dead-interval minimal hello-multiplier (2-20)` is also
618 specified for the interface.
620 .. index:: ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)
621 .. clicmd:: ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)
623 .. index:: no ip ospf network
624 .. clicmd:: no ip ospf network
626 Set explicitly network type for specified interface.
628 .. index:: ip ospf priority (0-255)
629 .. clicmd:: ip ospf priority (0-255)
631 .. index:: no ip ospf priority
632 .. clicmd:: no ip ospf priority
634 Set RouterPriority integer value. The router with the highest priority will
635 be more eligible to become Designated Router. Setting the value to 0, makes
636 the router ineligible to become Designated Router. The default value is 1.
638 .. index:: ip ospf retransmit-interval (1-65535)
639 .. clicmd:: ip ospf retransmit-interval (1-65535)
641 .. index:: no ip ospf retransmit interval
642 .. clicmd:: no ip ospf retransmit interval
644 Set number of seconds for RxmtInterval timer value. This value is used when
645 retransmitting Database Description and Link State Request packets. The
646 default value is 5 seconds.
648 .. index:: ip ospf transmit-delay
649 .. clicmd:: ip ospf transmit-delay
651 .. index:: no ip ospf transmit-delay
652 .. clicmd:: no ip ospf transmit-delay
654 Set number of seconds for InfTransDelay value. LSAs' age should be
655 incremented by this value when transmitting. The default value is 1 second.
657 .. index:: ip ospf area (A.B.C.D|(0-4294967295))
658 .. clicmd:: ip ospf area (A.B.C.D|(0-4294967295))
660 .. index:: no ip ospf area
661 .. clicmd:: no ip ospf area
663 Enable ospf on an interface and set associated area.
665 .. _redistribute-routes-to-ospf:
667 Redistribute routes to OSPF
668 ===========================
670 .. index:: redistribute (kernel|connected|static|rip|bgp)
671 .. clicmd:: redistribute (kernel|connected|static|rip|bgp)
673 .. index:: redistribute (kernel|connected|static|rip|bgp) ROUTE-MAP
674 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) ROUTE-MAP
676 .. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)
677 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)
679 .. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD
680 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD
682 .. index:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214)
683 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214)
685 .. index:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214) route-map WORD
686 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric (0-16777214) route-map WORD
688 .. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214)
689 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214)
691 .. index:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214) route-map WORD
692 .. clicmd:: redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric (0-16777214) route-map WORD
694 .. index:: no redistribute (kernel|connected|static|rip|bgp)
695 .. clicmd:: no redistribute (kernel|connected|static|rip|bgp)
697 .. _ospf-redistribute:
699 Redistribute routes of the specified protocol or kind into OSPF, with the
700 metric type and metric set if specified, filtering the routes using the
701 given route-map if specified. Redistributed routes may also be filtered
702 with distribute-lists, see
703 :ref:`ospf distribute-list configuration <ospf-distribute-list>`.
705 Redistributed routes are distributed as into OSPF as Type-5 External LSAs
706 into links to areas that accept external routes, Type-7 External LSAs for
707 NSSA areas and are not redistributed at all into Stub areas, where external
708 routes are not permitted.
710 Note that for connected routes, one may instead use the `passive-interface`
715 clicmd:`passive-interface INTERFACE`.
717 .. index:: default-information originate
718 .. clicmd:: default-information originate
720 .. index:: default-information originate metric (0-16777214)
721 .. clicmd:: default-information originate metric (0-16777214)
723 .. index:: default-information originate metric (0-16777214) metric-type (1|2)
724 .. clicmd:: default-information originate metric (0-16777214) metric-type (1|2)
726 .. index:: default-information originate metric (0-16777214) metric-type (1|2) route-map WORD
727 .. clicmd:: default-information originate metric (0-16777214) metric-type (1|2) route-map WORD
729 .. index:: default-information originate always
730 .. clicmd:: default-information originate always
732 .. index:: default-information originate always metric (0-16777214)
733 .. clicmd:: default-information originate always metric (0-16777214)
735 .. index:: default-information originate always metric (0-16777214) metric-type (1|2)
736 .. clicmd:: default-information originate always metric (0-16777214) metric-type (1|2)
738 .. index:: default-information originate always metric (0-16777214) metric-type (1|2) route-map WORD
739 .. clicmd:: default-information originate always metric (0-16777214) metric-type (1|2) route-map WORD
741 .. index:: no default-information originate
742 .. clicmd:: no default-information originate
744 Originate an AS-External (type-5) LSA describing a default route into all
745 external-routing capable areas, of the specified metric and metric type. If
746 the 'always' keyword is given then the default is always advertised, even
747 when there is no default present in the routing table.
749 .. index:: distribute-list NAME out (kernel|connected|static|rip|ospf
750 .. clicmd:: distribute-list NAME out (kernel|connected|static|rip|ospf
752 .. index:: no distribute-list NAME out (kernel|connected|static|rip|ospf
753 .. clicmd:: no distribute-list NAME out (kernel|connected|static|rip|ospf
755 .. _ospf-distribute-list:
757 Apply the access-list filter, NAME, to redistributed routes of the given
758 type before allowing the routes to redistributed into OSPF
759 (:ref:`ospf redistribution <ospf-redistribute>`).
761 .. index:: default-metric (0-16777214)
762 .. clicmd:: default-metric (0-16777214)
764 .. index:: no default-metric
765 .. clicmd:: no default-metric
767 .. index:: distance (1-255)
768 .. clicmd:: distance (1-255)
770 .. index:: no distance (1-255)
771 .. clicmd:: no distance (1-255)
773 .. index:: distance ospf (intra-area|inter-area|external) (1-255)
774 .. clicmd:: distance ospf (intra-area|inter-area|external) (1-255)
776 .. index:: no distance ospf
777 .. clicmd:: no distance ospf
779 .. index:: router zebra
780 .. clicmd:: router zebra
782 .. index:: no router zebra
783 .. clicmd:: no router zebra
786 .. _showing-ospf-information:
788 Showing OSPF information
789 ========================
793 .. index:: show ip ospf
794 .. clicmd:: show ip ospf
796 Show information on a variety of general OSPF and area state and
797 configuration information.
799 .. index:: show ip ospf interface [INTERFACE]
800 .. clicmd:: show ip ospf interface [INTERFACE]
802 Show state and configuration of OSPF the specified interface, or all
803 interfaces if no interface is given.
805 .. index:: show ip ospf neighbor
806 .. clicmd:: show ip ospf neighbor
808 .. index:: show ip ospf neighbor INTERFACE
809 .. clicmd:: show ip ospf neighbor INTERFACE
811 .. index:: show ip ospf neighbor detail
812 .. clicmd:: show ip ospf neighbor detail
814 .. index:: show ip ospf neighbor INTERFACE detail
815 .. clicmd:: show ip ospf neighbor INTERFACE detail
817 .. index:: show ip ospf database
818 .. clicmd:: show ip ospf database
820 .. index:: show ip ospf database (asbr-summary|external|network|router|summary)
821 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary)
823 .. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID
824 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID
826 .. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID adv-router ADV-ROUTER
827 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID adv-router ADV-ROUTER
829 .. index:: show ip ospf database (asbr-summary|external|network|router|summary) adv-router ADV-ROUTER
830 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) adv-router ADV-ROUTER
832 .. index:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID self-originate
833 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) LINK-STATE-ID self-originate
835 .. index:: show ip ospf database (asbr-summary|external|network|router|summary) self-originate
836 .. clicmd:: show ip ospf database (asbr-summary|external|network|router|summary) self-originate
838 .. index:: show ip ospf database max-age
839 .. clicmd:: show ip ospf database max-age
841 .. index:: show ip ospf database self-originate
842 .. clicmd:: show ip ospf database self-originate
844 .. index:: show ip ospf route
845 .. clicmd:: show ip ospf route
847 Show the OSPF routing table, as determined by the most recent SPF
855 .. index:: ospf opaque-lsa
856 .. clicmd:: ospf opaque-lsa
858 .. index:: capability opaque
859 .. clicmd:: capability opaque
861 .. index:: no ospf opaque-lsa
862 .. clicmd:: no ospf opaque-lsa
864 .. index:: no capability opaque
865 .. clicmd:: no capability opaque
867 *ospfd* supports Opaque LSA (:rfc:`2370`) as fundamental for MPLS Traffic
868 Engineering LSA. Prior to used MPLS TE, opaque-lsa must be enable in the
869 configuration file. Alternate command could be "mpls-te on"
870 (:ref:`ospf-traffic-engineering`).
872 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external)
873 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external)
875 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID
876 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID
878 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID adv-router ADV-ROUTER
879 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID adv-router ADV-ROUTER
881 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router ADV-ROUTER
882 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router ADV-ROUTER
884 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID self-originate
885 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) LINK-STATE-ID self-originate
887 .. index:: show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate
888 .. clicmd:: show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate
890 Show Opaque LSA from the database.
892 .. _ospf-traffic-engineering:
897 .. index:: mpls-te on
898 .. clicmd:: mpls-te on
900 .. index:: no mpls-te
901 .. clicmd:: no mpls-te
903 Enable Traffic Engineering LSA flooding.
905 .. index:: mpls-te router-address <A.B.C.D>
906 .. clicmd:: mpls-te router-address <A.B.C.D>
908 Configure stable IP address for MPLS-TE. This IP address is then advertise
909 in Opaque LSA Type-10 TLV=1 (TE) option 1 (Router-Address).
911 .. index:: mpls-te inter-as area <area-id>|as
912 .. clicmd:: mpls-te inter-as area <area-id>|as
914 .. index:: no mpls-te inter-as
915 .. clicmd:: no mpls-te inter-as
917 Enable :rfc:`5392` support - Inter-AS TE v2 - to flood Traffic Engineering
918 parameters of Inter-AS link. 2 modes are supported: AREA and AS; LSA are
919 flood in AREA <area-id> with Opaque Type-10, respectively in AS with Opaque
920 Type-11. In all case, Opaque-LSA TLV=6.
922 .. index:: show ip ospf mpls-te interface
923 .. clicmd:: show ip ospf mpls-te interface
925 .. index:: show ip ospf mpls-te interface INTERFACE
926 .. clicmd:: show ip ospf mpls-te interface INTERFACE
928 Show MPLS Traffic Engineering parameters for all or specified interface.
930 .. index:: show ip ospf mpls-te router
931 .. clicmd:: show ip ospf mpls-te router
933 Show Traffic Engineering router parameters.
935 .. _router-information:
940 .. index:: router-info [as | area <A.B.C.D>]
941 .. clicmd:: router-info [as | area <A.B.C.D>]
943 .. index:: no router-info
944 .. clicmd:: no router-info
946 Enable Router Information (:rfc:`4970`) LSA advertisement with AS scope
947 (default) or Area scope flooding when area is specified.
949 .. index:: pce address <A.B.C.D>
950 .. clicmd:: pce address <A.B.C.D>
952 .. index:: no pce address
953 .. clicmd:: no pce address
955 .. index:: pce domain as (0-65535)
956 .. clicmd:: pce domain as (0-65535)
958 .. index:: no pce domain as (0-65535)
959 .. clicmd:: no pce domain as (0-65535)
961 .. index:: pce neighbor as (0-65535)
962 .. clicmd:: pce neighbor as (0-65535)
964 .. index:: no pce neighbor as (0-65535)
965 .. clicmd:: no pce neighbor as (0-65535)
967 .. index:: pce flag BITPATTERN
968 .. clicmd:: pce flag BITPATTERN
970 .. index:: no pce flag
971 .. clicmd:: no pce flag
973 .. index:: pce scope BITPATTERN
974 .. clicmd:: pce scope BITPATTERN
976 .. index:: no pce scope
977 .. clicmd:: no pce scope
979 The commands are conform to :rfc:`5088` and allow OSPF router announce Path
980 Computation Element (PCE) capabilities through the Router Information (RI)
981 LSA. Router Information must be enable prior to this. The command set/unset
982 respectively the PCE IP address, Autonomous System (AS) numbers of
983 controlled domains, neighbor ASs, flag and scope. For flag and scope, please
984 refer to :rfc`5088` for the BITPATTERN recognition. Multiple 'pce neighbor'
985 command could be specified in order to specify all PCE neighbours.
987 .. index:: show ip ospf router-info
988 .. clicmd:: show ip ospf router-info
990 Show Router Capabilities flag.
992 .. index:: show ip ospf router-info pce
993 .. clicmd:: show ip ospf router-info pce
995 Show Router Capabilities PCE parameters.
1002 This is an EXPERIMENTAL support of Segment Routing as per draft
1003 `draft-ietf-ospf-segment-routing-extensions-24.txt` for MPLS dataplane.
1005 .. index:: [no] segment-routing on
1006 .. clicmd:: [no] segment-routing on
1008 Enable Segment Routing. Even if this also activate routing information
1009 support, it is preferable to also activate routing information, and set
1010 accordingly the Area or AS flooding.
1012 .. index:: [no] segment-routing global-block (0-1048575) (0-1048575)
1013 .. clicmd:: [no] segment-routing global-block (0-1048575) (0-1048575)
1015 Fix the Segment Routing Global Block i.e. the label range used by MPLS to
1016 store label in the MPLS FIB.
1018 .. index:: [no] segment-routing node-msd (1-16)
1019 .. clicmd:: [no] segment-routing node-msd (1-16)
1021 Fix the Maximum Stack Depth supported by the router. The value depend of the
1022 MPLS dataplane. E.g. for Linux kernel, since version 4.13 it is 32.
1024 .. index:: [no] segment-routing prefix A.B.C.D/M index (0-65535) [no-php-flag]
1025 .. clicmd:: [no] segment-routing prefix A.B.C.D/M index (0-65535) [no-php-flag]
1027 Set the Segment Routing index for the specified prefix. Note that, only
1028 prefix with /32 corresponding to a loopback interface are currently
1029 supported. The 'no-php-flag' means NO Penultimate Hop Popping that allows SR
1030 node to request to its neighbor to not pop the label.
1032 .. index:: show ip ospf database segment-routing <adv-router ADVROUTER|self-originate> [json]
1033 .. clicmd:: show ip ospf database segment-routing <adv-router ADVROUTER|self-originate> [json]
1035 Show Segment Routing Data Base, all SR nodes, specific advertised router or
1036 self router. Optional JSON output can be obtained by appending 'json' to the
1042 .. index:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
1043 .. clicmd:: debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
1045 .. index:: no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
1046 .. clicmd:: no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]
1048 Dump Packet for debugging
1050 .. index:: debug ospf ism
1051 .. clicmd:: debug ospf ism
1053 .. index:: debug ospf ism (status|events|timers)
1054 .. clicmd:: debug ospf ism (status|events|timers)
1056 .. index:: no debug ospf ism
1057 .. clicmd:: no debug ospf ism
1059 .. index:: no debug ospf ism (status|events|timers)
1060 .. clicmd:: no debug ospf ism (status|events|timers)
1062 Show debug information of Interface State Machine
1064 .. index:: debug ospf nsm
1065 .. clicmd:: debug ospf nsm
1067 .. index:: debug ospf nsm (status|events|timers)
1068 .. clicmd:: debug ospf nsm (status|events|timers)
1070 .. index:: no debug ospf nsm
1071 .. clicmd:: no debug ospf nsm
1073 .. index:: no debug ospf nsm (status|events|timers)
1074 .. clicmd:: no debug ospf nsm (status|events|timers)
1076 Show debug information of Network State Machine
1078 .. index:: debug ospf event
1079 .. clicmd:: debug ospf event
1081 .. index:: no debug ospf event
1082 .. clicmd:: no debug ospf event
1084 Show debug information of OSPF event
1086 .. index:: debug ospf nssa
1087 .. clicmd:: debug ospf nssa
1089 .. index:: no debug ospf nssa
1090 .. clicmd:: no debug ospf nssa
1092 Show debug information about Not So Stub Area
1094 .. index:: debug ospf lsa
1095 .. clicmd:: debug ospf lsa
1097 .. index:: debug ospf lsa (generate|flooding|refresh)
1098 .. clicmd:: debug ospf lsa (generate|flooding|refresh)
1100 .. index:: no debug ospf lsa
1101 .. clicmd:: no debug ospf lsa
1103 .. index:: no debug ospf lsa (generate|flooding|refresh)
1104 .. clicmd:: no debug ospf lsa (generate|flooding|refresh)
1106 Show debug detail of Link State messages
1108 .. index:: debug ospf te
1109 .. clicmd:: debug ospf te
1111 .. index:: no debug ospf te
1112 .. clicmd:: no debug ospf te
1114 Show debug information about Traffic Engineering LSA
1116 .. index:: debug ospf zebra
1117 .. clicmd:: debug ospf zebra
1119 .. index:: debug ospf zebra (interface|redistribute)
1120 .. clicmd:: debug ospf zebra (interface|redistribute)
1122 .. index:: no debug ospf zebra
1123 .. clicmd:: no debug ospf zebra
1125 .. index:: no debug ospf zebra (interface|redistribute)
1126 .. clicmd:: no debug ospf zebra (interface|redistribute)
1128 Show debug information of ZEBRA API
1130 .. index:: show debugging ospf
1131 .. clicmd:: show debugging ospf
1134 OSPF Configuration Examples
1135 ===========================
1137 A simple example, with MD5 authentication enabled:
1143 ip ospf authentication message-digest
1144 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
1147 network 192.168.0.0/16 area 0.0.0.1
1148 area 0.0.0.1 authentication message-digest
1151 An :abbr:`ABR` router, with MD5 authentication and performing summarisation
1152 of networks between the areas:
1158 log file /var/log/frr/ospfd.log
1159 service advanced-vty
1162 ip ospf authentication message-digest
1163 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
1168 ip ospf authentication message-digest
1169 ip ospf message-digest-key 2 md5 XYZ12345
1172 ospf router-id 192.168.0.1
1173 redistribute connected
1174 passive interface ppp0
1175 network 192.168.0.0/24 area 0.0.0.0
1176 network 10.0.0.0/16 area 0.0.0.0
1177 network 192.168.1.0/24 area 0.0.0.1
1178 area 0.0.0.0 authentication message-digest
1179 area 0.0.0.0 range 10.0.0.0/16
1180 area 0.0.0.0 range 192.168.0.0/24
1181 area 0.0.0.1 authentication message-digest
1182 area 0.0.0.1 range 10.2.0.0/16
1186 A Traffic Engineering configuration, with Inter-ASv2 support.
1188 First, the :file:`zebra.conf` part:
1193 ip address 198.168.1.1/24
1210 ip address 192.168.2.1/24
1224 neighbor 192.168.2.2 as 65000
1227 log file /var/log/zebra.log
1230 ip address 198.168.1.1/24
1247 ip address 192.168.2.1/24
1261 neighbor 192.168.2.2 as 65000
1263 Then the :file:`ospfd.conf` itself:
1269 log file /var/log/ospfd.log
1273 ip ospf hello-interval 60
1274 ip ospf dead-interval 240
1277 ip ospf hello-interval 60
1278 ip ospf dead-interval 240
1282 ospf router-id 192.168.1.1
1283 network 192.168.0.0/16 area 1
1286 mpls-te router-address 192.168.1.1
1287 mpls-te inter-as area 1
1291 A router information example with PCE advertisement:
1297 ospf router-id 192.168.1.1
1298 network 192.168.0.0/16 area 1
1301 mpls-te router-address 192.168.1.1
1302 router-info area 0.0.0.1
1303 pce address 192.168.1.1
1306 pce neighbor as 65500
1307 pce neighbor as 65200