]> git.proxmox.com Git - mirror_frr.git/blob - doc/ospfd.texi
OSPFD: Add Experimental Segment Routing support
[mirror_frr.git] / doc / ospfd.texi
1
2 @cindex OSPFv2
3 @node OSPFv2
4 @chapter OSPFv2
5
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
12 networks.
13
14 @menu
15 * OSPF Fundamentals::
16 * Configuring ospfd::
17 * OSPF router::
18 * OSPF area::
19 * OSPF interface::
20 * Redistribute routes to OSPF::
21 * Showing OSPF information::
22 * Opaque LSA::
23 * OSPF Traffic Engineering::
24 * Router Information::
25 * Segment Routing::
26 * Debugging OSPF::
27 * OSPF Configuration Examples::
28 @end menu
29
30 @include ospf_fundamentals.texi
31
32 @node Configuring ospfd
33 @section Configuring ospfd
34
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.
41
42 Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
43 specific configuration file @file{ospfd.conf}.
44
45 @node OSPF router
46 @section OSPF router
47
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.
50
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
55 number.
56 @end deffn
57
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}.
67 @end deffn
68
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
72 are equivalent.
73
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.
79
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.
85
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}).
89
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}.
93
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."
102 @end deffn
103
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.
112
113 This command should NOT be set normally.
114 @end deffn
115
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.
121 @end deffn
122
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.
133 @end deffn
134
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.
141
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).
146
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}.
157
158 @example
159 @group
160 router ospf
161 timers throttle spf 200 400 10000
162 @end group
163 @end example
164
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.
172
173 This command supercedes the @command{timers spf} command in previous Frr
174 releases.
175 @end deffn
176
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.
185
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
189 prior to shutdown.
190
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
196 domain.
197
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.
204
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.
208 @end deffn
209
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
217 to this cost).
218
219 This configuration setting MUST be consistent across all routers within the
220 OSPF domain.
221 @end deffn
222
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.
232
233 @example
234 @group
235 router ospf
236 network 192.168.1.0/24 area 0.0.0.0
237 @end group
238 @end example
239
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.
244
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.
251
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}).
254
255 @end deffn
256
257 @node OSPF area
258 @section OSPF area
259
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.
269
270 @example
271 @group
272 router ospf
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
276 @end group
277 @end example
278
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.
282 @end deffn
283
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.
289 @end deffn
290
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.
294
295 @example
296 @group
297 router ospf
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
301 @end group
302 @end example
303
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.
308 @end deffn
309
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}
315 @end deffn
316
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'.
323 @end deffn
324
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.
335 @end deffn
336
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.
343 @end deffn
344
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.
348 @end deffn
349
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.
356
357 @example
358 @group
359 router ospf
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
363 !
364 access-list foo permit 10.10.0.0/16
365 access-list foo deny any
366 @end group
367 @end example
368
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.
373
374 This command is only relevant if the router is an ABR for the specified
375 area.
376 @end deffn
377
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
383 Type-3 summary-LSAs.
384 @end deffn
385
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.
396 @end deffn
397
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
403 area.
404 @end deffn
405
406 @deffn {OSPF Command} {area @var{a.b.c.d} authentication message-digest} {}
407 @deffnx {OSPF Command} {area <0-4294967295> authentication message-digest} {}
408
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}).
413
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.
417 @end deffn
418
419 @node OSPF interface
420 @section OSPF interface
421
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}
425
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}).
429
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.
432
433 @end deffn
434
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.
439
440 Simple text password authentication is insecure and deprecated in favour of
441 MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
442 @end deffn
443
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}).
450
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
458 reliably.
459 @end deffn
460
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.
465
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
468 link.
469
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.
472 @end deffn
473
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.
478 @end deffn
479
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.
487
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
495 link.
496 @end deffn
497
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.
504
505 This command has no effect if @ref{ip ospf dead-interval minimal} is also
506 specified for the interface.
507 @end deffn
508
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.
512 @end deffn
513
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
519 default value is 1.
520 @end deffn
521
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.
527 @end deffn
528
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.
534 @end deffn
535
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.
539 @end deffn
540
541 @node Redistribute routes to OSPF
542 @section Redistribute routes to OSPF
543
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}.
558
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.
563
564 Note that for connected routes, one may instead use
565 @dfn{passive-interface}, see @ref{OSPF passive-interface}.
566 @end deffn
567
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.
581 @end deffn
582
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}).
588 @end deffn
589
590 @deffn {OSPF Command} {default-metric <0-16777214>} {}
591 @deffnx {OSPF Command} {no default-metric} {}
592 @end deffn
593
594 @deffn {OSPF Command} {distance <1-255>} {}
595 @deffnx {OSPF Command} {no distance <1-255>} {}
596 @end deffn
597
598 @deffn {OSPF Command} {distance ospf (intra-area|inter-area|external) <1-255>} {}
599 @deffnx {OSPF Command} {no distance ospf} {}
600 @end deffn
601
602 @deffn {Command} {router zebra} {}
603 @deffnx {Command} {no router zebra} {}
604 @end deffn
605
606 @node Showing OSPF information
607 @section Showing OSPF information
608
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.
612 @end deffn
613
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.
617 @end deffn
618
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} {}
623 @end deffn
624
625 @deffn {Command} {show ip ospf database} {}
626 @end deffn
627
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} {}
634 @end deffn
635
636 @deffn {Command} {show ip ospf database max-age} {}
637 @end deffn
638
639 @deffn {Command} {show ip ospf database self-originate} {}
640 @end deffn
641
642 @deffn {Command} {show ip ospf route} {}
643 Show the OSPF routing table, as determined by the most recent SPF calculation.
644 @end deffn
645
646 @node Opaque LSA
647 @section Opaque LSA
648
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}).
654 @end deffn
655
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.
663 @end deffn
664
665 @node OSPF Traffic Engineering
666 @section Traffic Engineering
667
668 @deffn {OSPF Command} {mpls-te on} {}
669 @deffnx {OSPF Command} {no mpls-te} {}
670 Enable Traffic Engineering LSA flooding.
671 @end deffn
672
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).
677 @end deffn
678
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.
684 @end deffn
685
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.
689 @end deffn
690
691 @deffn {Command} {show ip ospf mpls-te router} {}
692 Show Traffic Engineering router parameters.
693 @end deffn
694
695 @node Router Information
696 @section Router Information
697
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.
702 @end deffn
703
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.
719 @end deffn
720
721 @deffn {Command} {show ip ospf router-info} {}
722 Show Router Capabilities flag.
723 @end deffn
724 @deffn {Command} {show ip ospf router-info pce} {}
725 Show Router Capabilities PCE parameters.
726 @end deffn
727
728 @node Segment Routing
729 @section Segment Routing
730
731 This is an EXPERIMENTAL support of Segment Routing as per draft
732 draft-ietf-ospf-segment-routing-extensions-24i for MPLS dataplane.
733
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
738 Area or AS flooding.
739 @end deffn
740
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.
745 @end deffn
746
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.
751 @end deffn
752
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
757 currently supported.
758 @end deffn
759
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.
764 @end deffn
765
766 @node Debugging OSPF
767 @section Debugging OSPF
768
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
772 @end deffn
773
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
779 @end deffn
780
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
786 @end deffn
787
788 @deffn {Command} {debug ospf event} {}
789 @deffnx {Command} {no debug ospf event} {}
790 Show debug information of OSPF event
791 @end deffn
792
793 @deffn {Command} {debug ospf nssa} {}
794 @deffnx {Command} {no debug ospf nssa} {}
795 Show debug information about Not So Stub Area
796 @end deffn
797
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
803 @end deffn
804
805 @deffn {Command} {debug ospf te} {}
806 @deffnx {Command} {no debug ospf te} {}
807 Show debug information about Traffic Engineering LSA
808 @end deffn
809
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
815 @end deffn
816
817 @deffn {Command} {show debugging ospf} {}
818 @end deffn
819
820 @node OSPF Configuration Examples
821 @section OSPF Configuration Examples
822 A simple example, with MD5 authentication enabled:
823
824 @example
825 @group
826 !
827 interface bge0
828 ip ospf authentication message-digest
829 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
830 !
831 router ospf
832 network 192.168.0.0/16 area 0.0.0.1
833 area 0.0.0.1 authentication message-digest
834 @end group
835 @end example
836
837 An @acronym{ABR} router, with MD5 authentication and performing summarisation
838 of networks between the areas:
839
840 @example
841 @group
842 !
843 password ABCDEF
844 log file /var/log/frr/ospfd.log
845 service advanced-vty
846 !
847 interface eth0
848 ip ospf authentication message-digest
849 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
850 !
851 interface ppp0
852 !
853 interface br0
854 ip ospf authentication message-digest
855 ip ospf message-digest-key 2 md5 XYZ12345
856 !
857 router ospf
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
869 !
870 @end group
871 @end example
872
873 A Traffic Engineering configuration, with Inter-ASv2 support.
874
875 - First, the 'zebra.conf' part:
876
877 @example
878 @group
879 hostname HOSTNAME
880 password PASSWORD
881 log file /var/log/zebra.log
882 !
883 interface eth0
884 ip address 198.168.1.1/24
885 mpls-te on
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
898 !
899 interface eth1
900 ip address 192.168.2.1/24
901 mpls-te on
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
915 @end group
916 @end example
917
918 - Then the 'ospfd.conf' itself:
919
920 @example
921 @group
922 hostname HOSTNAME
923 password PASSWORD
924 log file /var/log/ospfd.log
925 !
926 !
927 interface eth0
928 ip ospf hello-interval 60
929 ip ospf dead-interval 240
930 !
931 interface eth1
932 ip ospf hello-interval 60
933 ip ospf dead-interval 240
934 !
935 !
936 router ospf
937 ospf router-id 192.168.1.1
938 network 192.168.0.0/16 area 1
939 ospf opaque-lsa
940 mpls-te
941 mpls-te router-address 192.168.1.1
942 mpls-te inter-as area 1
943 !
944 line vty
945 @end group
946 @end example
947
948 A router information example with PCE advsertisement:
949
950 @example
951 @group
952 !
953 router ospf
954 ospf router-id 192.168.1.1
955 network 192.168.0.0/16 area 1
956 capability opaque
957 mpls-te
958 mpls-te router-address 192.168.1.1
959 router-info area 0.0.0.1
960 pce address 192.168.1.1
961 pce flag 0x80
962 pce domain as 65400
963 pce neighbor as 65500
964 pce neighbor as 65200
965 pce scope 0x80
966 !
967 @end group
968 @end example