]> git.proxmox.com Git - mirror_frr.git/blame - doc/ospfd.texi
ospf6d: Intra-prefix LSA update after frr restart
[mirror_frr.git] / doc / ospfd.texi
CommitLineData
4b547606 1
f912cb4f 2@cindex OSPFv2
76b89b4a 3@node OSPFv2
718e3744 4@chapter OSPFv2
5
e5b308d1 6@acronym{OSPF,Open Shortest Path First} version 2 is a routing protocol
7which is described in @cite{RFC2328, OSPF Version 2}. OSPF is an
f912cb4f 8@acronym{IGP,Interior Gateway Protocol}. Compared with @acronym{RIP},
e5b308d1 9@acronym{OSPF} can provide scalable network support and faster
10convergence times. OSPF is widely used in large networks such as
11@acronym{ISP,Internet Service Provider} backbone and enterprise
12networks.
718e3744 13
14@menu
356a55e3 15* OSPF Fundamentals::
718e3744 16* Configuring ospfd::
17* OSPF router::
18* OSPF area::
19* OSPF interface::
20* Redistribute routes to OSPF::
21* Showing OSPF information::
4b547606
OD
22* Opaque LSA::
23* OSPF Traffic Engineering::
24* Router Information::
cf9b9f77 25* Segment Routing::
718e3744 26* Debugging OSPF::
e5b308d1 27* OSPF Configuration Examples::
718e3744 28@end menu
29
356a55e3
PJ
30@include ospf_fundamentals.texi
31
76b89b4a 32@node Configuring ospfd
718e3744 33@section Configuring ospfd
34
e5b308d1 35There are no @command{ospfd} specific options. Common options can be
718e3744 36specified (@pxref{Common Invocation Options}) to @command{ospfd}.
e5b308d1 37@command{ospfd} needs to acquire interface information from
38@command{zebra} in order to function. Therefore @command{zebra} must be
39running before invoking @command{ospfd}. Also, if @command{zebra} is
40restarted then @command{ospfd} must be too.
718e3744 41
e5b308d1 42Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
718e3744 43specific configuration file @file{ospfd.conf}.
44
76b89b4a 45@node OSPF router
718e3744 46@section OSPF router
47
48To start OSPF process you have to specify the OSPF router. As of this
49writing, @command{ospfd} does not support multiple OSPF processes.
50
51@deffn Command {router ospf} {}
52@deffnx Command {no router ospf} {}
53Enable or disable the OSPF process. @command{ospfd} does not yet
54support multiple OSPF processes. So you can not specify an OSPF process
55number.
56@end deffn
57
58@deffn {OSPF Command} {ospf router-id @var{a.b.c.d}} {}
59@deffnx {OSPF Command} {no ospf router-id} {}
c3eab60e
PJ
60@anchor{ospf router-id}This sets the router-ID of the OSPF process. The
61router-ID may be an IP address of the router, but need not be - it can
62be any arbitrary 32bit number. However it MUST be unique within the
63entire OSPF domain to the OSPF speaker - bad things will happen if
64multiple OSPF speakers are configured with the same router-ID! If one
65is not specified then @command{ospfd} will obtain a router-ID
66automatically from @command{zebra}.
718e3744 67@end deffn
68
69@deffn {OSPF Command} {ospf abr-type @var{type}} {}
70@deffnx {OSPF Command} {no ospf abr-type @var{type}} {}
f912cb4f
PJ
71@var{type} can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
72are equivalent.
73
74The OSPF standard for ABR behaviour does not allow an ABR to consider
75routes through non-backbone areas when its links to the backbone are
76down, even when there are other ABRs in attached non-backbone areas
77which still can reach the backbone - this restriction exists primarily
78to ensure routing-loops are avoided.
79
80With the "Cisco" or "IBM" ABR type, the default in this release of
438f5286 81Frr, this restriction is lifted, allowing an ABR to consider
f912cb4f
PJ
82summaries learnt from other ABRs through non-backbone areas, and hence
83route via non-backbone areas as a last resort when, and only when,
84backbone links are down.
85
86Note that areas with fully-adjacent virtual-links are considered to be
87"transit capable" and can always be used to route backbone traffic, and
88hence are unaffected by this setting (@pxref{OSPF virtual-link}).
e5b308d1 89
d4f5031c 90More information regarding the behaviour controlled by this command can
e5b308d1 91be found in @cite{RFC 3509, Alternative Implementations of OSPF Area
92Border Routers}, and @cite{draft-ietf-ospf-shortcut-abr-02.txt}.
93
94Quote: "Though the definition of the @acronym{ABR,Area Border Router}
d4f5031c 95in the OSPF specification does not require a router with multiple
96attached areas to have a backbone connection, it is actually
97necessary to provide successful routing to the inter-area and
98external destinations. If this requirement is not met, all traffic
99destined for the areas not connected to such an ABR or out of the
100OSPF domain, is dropped. This document describes alternative ABR
101behaviors implemented in Cisco and IBM routers."
718e3744 102@end deffn
103
104@deffn {OSPF Command} {ospf rfc1583compatibility} {}
105@deffnx {OSPF Command} {no ospf rfc1583compatibility} {}
f912cb4f 106@cite{RFC2328}, the sucessor to @cite{RFC1583}, suggests according
e5b308d1 107to section G.2 (changes) in section 16.4 a change to the path
108preference algorithm that prevents possible routing loops that were
109possible in the old version of OSPFv2. More specifically it demands
37075da7 110that inter-area paths and intra-area backbone path are now of equal preference
e5b308d1 111but still both preferred to external paths.
112
113This command should NOT be set normally.
718e3744 114@end deffn
115
d7e60dd7
AS
116@deffn {OSPF Command} {log-adjacency-changes [detail]} {}
117@deffnx {OSPF Command} {no log-adjacency-changes [detail]} {}
118Configures ospfd to log changes in adjacency. With the optional
119detail argument, all changes in adjacency status are shown. Without detail,
120only changes to full or regressions are shown.
121@end deffn
122
f912cb4f
PJ
123@deffn {OSPF Command} {passive-interface @var{interface}} {}
124@deffnx {OSPF Command} {no passive-interface @var{interface}} {}
c3eab60e
PJ
125@anchor{OSPF passive-interface} Do not speak OSPF interface on the
126given interface, but do advertise the interface as a stub link in the
127router-@acronym{LSA,Link State Advertisement} for this router. This
128allows one to advertise addresses on such connected interfaces without
129having to originate AS-External/Type-5 LSAs (which have global flooding
130scope) - as would occur if connected addresses were redistributed into
131OSPF (@pxref{Redistribute routes to OSPF})@. This is the only way to
132advertise non-OSPF links into stub areas.
e5b308d1 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} {}
137This command sets the initial @var{delay}, the @var{initial-holdtime}
138and the @var{maximum-holdtime} between when SPF is calculated and the
139event which triggered the calculation. The times are specified in
140milliseconds and must be in the range of 0 to 600000 milliseconds.
141
142The @var{delay} specifies the minimum amount of time to delay SPF
143calculation (hence it affects how long SPF calculation is delayed after
144an event which occurs outside of the holdtime of any previous SPF
145calculation, and also serves as a minimum holdtime).
146
147Consecutive SPF calculations will always be seperated by at least
148'hold-time' milliseconds. The hold-time is adaptive and initially is
149set to the @var{initial-holdtime} configured with the above command.
150Events which occur within the holdtime of the previous SPF calculation
151will cause the holdtime to be increased by @var{initial-holdtime}, bounded
152by the @var{maximum-holdtime} configured with this command. If the adaptive
153hold-time elapses without any SPF-triggering event occuring then
154the current holdtime is reset to the @var{initial-holdtime}. The current
155holdtime can be viewed with @ref{show ip ospf}, where it is expressed as
156a multiplier of the @var{initial-holdtime}.
718e3744 157
e5b308d1 158@example
159@group
160router ospf
161 timers throttle spf 200 400 10000
162@end group
163@end example
718e3744 164
e5b308d1 165In this example, the @var{delay} is set to 200ms, the @var{initial
166holdtime} is set to 400ms and the @var{maximum holdtime} to 10s. Hence
167there will always be at least 200ms between an event which requires SPF
168calculation and the actual SPF calculation. Further consecutive SPF
169calculations will always be seperated by between 400ms to 10s, the
170hold-time increasing by 400ms each time an SPF-triggering event occurs
171within the hold-time of the previous SPF calculation.
172
438f5286 173This command supercedes the @command{timers spf} command in previous Frr
e5b308d1 174releases.
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]} {}
180This enables @cite{RFC3137, OSPF Stub Router Advertisement} support,
181where the OSPF process describes its transit links in its router-LSA as
182having infinite distance so that other routers will avoid calculating
183transit paths through the router while still being able to reach
184networks through the router.
185
186This support may be enabled administratively (and indefinitely) or
187conditionally. Conditional enabling of max-metric router-lsas can be
188for a period of seconds after startup and/or for a period of seconds
189prior to shutdown.
190
191Enabling this for a period after startup allows OSPF to converge fully
192first without affecting any existing routes used by other routers,
193while still allowing any connected stub links and/or redistributed
194routes to be reachable. Enabling this for a period of time in advance
195of shutdown allows the router to gracefully excuse itself from the OSPF
196domain.
197
198Enabling this feature administratively allows for administrative
199intervention for whatever reason, for an indefinite period of time.
200Note that if the configuration is written to file, this administrative
201form of the stub-router command will also be written to file. If
202@command{ospfd} is restarted later, the command will then take effect
203until manually deconfigured.
204
205Configured state of this feature as well as current status, such as the
206number of second remaining till on-startup or on-shutdown ends, can be
207viewed 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} {}
c3eab60e
PJ
212@anchor{OSPF auto-cost reference-bandwidth}This sets the reference
213bandwidth for cost calculations, where this bandwidth is considered
214equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
215100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
216cost of 1. Cost of lower bandwidth links will be scaled with reference
217to this cost).
e5b308d1 218
219This configuration setting MUST be consistent across all routers within the
220OSPF domain.
718e3744 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>}} {}
52c62ab8 227@anchor{OSPF network command}
a5b2b59a 228This command specifies the OSPF enabled interface(s). If the interface has
229an address from range 192.168.1.0/24 then the command below enables ospf
230on this interface so router can provide network information to the other
231ospf routers via this interface.
e5b308d1 232
718e3744 233@example
234@group
235router ospf
a5b2b59a 236 network 192.168.1.0/24 area 0.0.0.0
718e3744 237@end group
238@end example
e5b308d1 239
a5b2b59a 240Prefix length in interface must be equal or bigger (ie. smaller network) than
241prefix length in network statement. For example statement above doesn't enable
242ospf on interface with address 192.168.1.1/23, but it does on interface with
243address 192.168.1.129/25.
f0ec832a
AS
244
245Note that the behavior when there is a peer address
246defined on an interface changed after release 0.99.7.
247Currently, if a peer prefix has been configured,
248then we test whether the prefix in the network command contains
249the destination prefix. Otherwise, we test whether the network command prefix
250contains the local address prefix of the interface.
52c62ab8
JAG
251
252In some cases it may be more convenient to enable OSPF on a per
253interface/subnet basis (@pxref{OSPF ip ospf area command}).
254
718e3744 255@end deffn
256
76b89b4a 257@node OSPF area
718e3744 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}} {}
63869f11 264Summarize intra area paths from specified area into one Type-3 summary-LSA
265announced to other areas. This command can be used only in ABR and ONLY
266router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
267be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
438f5286 268Summarizing Type-7 AS-external-LSAs isn't supported yet by Frr.
e5b308d1 269
63869f11 270@example
271@group
272router 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
e5b308d1 278
63869f11 279With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
280announced into backbone area if area 0.0.0.10 contains at least one intra-area
281network (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} {}
286Instead of summarizing intra area paths filter them - ie. intra area paths from this
287range are not advertised into other areas.
288This command makes sense in ABR only.
718e3744 289@end deffn
290
6b3fac0a 291@deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
718e3744 292@deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
63869f11 293Substitute summarized prefix with another prefix.
e5b308d1 294
63869f11 295@example
296@group
297router 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
e5b308d1 303
63869f11 304One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
305area 0.0.0.10 contains at least one intra-area network (ie. described with router-LSA or
306network-LSA) from range 10.0.0.0/8.
307This command makes sense in ABR only.
718e3744 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}} {}
c3eab60e 314@anchor{OSPF virtual-link}
718e3744 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} {}
f912cb4f 321Configure the area as Shortcut capable. See @cite{RFC3509}. This requires
e5b308d1 322that the 'abr-type' be set to 'shortcut'.
718e3744 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} {}
e5b308d1 329Configure the area to be a stub area. That is, an area where no router
330originates routes external to OSPF and hence an area where all external
331routes are via the ABR(s). Hence, ABRs for such an area do not need
332to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
333area. They need only pass Network-Summary (type-3) LSAs into such an area,
f912cb4f 334along with a default-route summary.
718e3744 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} {}
e5b308d1 341Prevents an @command{ospfd} ABR from injecting inter-area
342summaries into the specified stub area.
718e3744 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>} {}
e5b308d1 347Set the cost of default-summary LSAs announced to stubby areas.
718e3744 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} {}
63869f11 354Filter Type-3 summary-LSAs announced to other areas originated from intra-
355area paths from specified area.
e5b308d1 356
63869f11 357@example
358@group
359router 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!
364access-list foo permit 10.10.0.0/16
365access-list foo deny any
366@end group
367@end example
e5b308d1 368
63869f11 369With example above any intra-area paths from area 0.0.0.10 and from range
37010.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
371other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
372or 10.128.30.16/30) aren't.
e5b308d1 373
374This command is only relevant if the router is an ABR for the specified
375area.
718e3744 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} {}
63869f11 382Same as export-list, but it applies to paths announced into specified area as
383Type-3 summary-LSAs.
384@end deffn
385
808c0a7f 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} {}
c266ac78 394Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
395makes sense in ABR only.
718e3744 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} {}
e5b308d1 402Specify that simple password authentication should be used for the given
403area.
718e3744 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} {}
c3eab60e
PJ
408
409@anchor{area authentication message-digest}Specify that OSPF packets
410must be authenticated with MD5 HMACs within the given area. Keying
411material must also be configured on a per-interface basis (@pxref{ip
412ospf message-digest-key}).
413
414MD5 authentication may also be configured on a per-interface basis
415(@pxref{ip ospf authentication message-digest}). Such per-interface
416settings will override any per-area authentication setting.
718e3744 417@end deffn
418
76b89b4a 419@node OSPF interface
718e3744 420@section OSPF interface
421
52c62ab8
JAG
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
426Enable OSPF on the interface, optionally restricted to just the IP address
427given by @var{ADDR}, putting it in the @var{AREA} area. Per interface area
428settings take precedence to network commands (@pxref{OSPF network command}).
429
430If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
431via this command may result in a slight performance improvement.
432
433@end deffn
434
e5b308d1 435@deffn {Interface Command} {ip ospf authentication-key @var{AUTH_KEY}} {}
718e3744 436@deffnx {Interface Command} {no ip ospf authentication-key} {}
437Set OSPF authentication key to a simple password. After setting @var{AUTH_KEY},
438all OSPF packets are authenticated. @var{AUTH_KEY} has length up to 8 chars.
f912cb4f
PJ
439
440Simple text password authentication is insecure and deprecated in favour of
c3eab60e 441MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
718e3744 442@end deffn
443
c3eab60e
PJ
444@deffn {Interface Command} {ip ospf authentication message-digest} {}
445@anchor{ip ospf authentication message-digest}Specify that MD5 HMAC
446authentication must be used on this interface. MD5 keying material must
447also be configured (@pxref{ip ospf message-digest-key}). Overrides any
448authentication enabled on a per-area basis (@pxref{area
449authentication message-digest}).
e2ea9fef 450
451Note that OSPF MD5 authentication requires that time never go backwards
e5b308d1 452(correct time is NOT important, only that it never goes backwards), even
e2ea9fef 453across resets, if ospfd is to be able to promptly reestabish adjacencies
454with its neighbours after restarts/reboots. The host should have system
466c9656 455time be set at boot from an external or non-volatile source (eg battery backed clock, NTP,
e2ea9fef 456etc.) or else the system clock should be periodically saved to non-volative
457storage and restored at boot if MD5 authentication is to be expected to work
458reliably.
718e3744 459@end deffn
460
c3eab60e
PJ
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
464cryptographic password. The cryptographic algorithm is MD5.
465
466KEYID identifies secret key used to create the message digest. This ID
467is part of the protocol and must be consistent across routers on a
468link.
469
470KEY is the actual message digest key, of up to 16 chars (larger strings
471will be truncated), and is associated with the given KEYID.
472@end deffn
473
718e3744 474@deffn {Interface Command} {ip ospf cost <1-65535>} {}
475@deffnx {Interface Command} {no ip ospf cost} {}
476Set link cost for the specified interface. The cost value is set to router-LSA's
477metric field and used for SPF calculation.
478@end deffn
479
480@deffn {Interface Command} {ip ospf dead-interval <1-65535>} {}
e5b308d1 481@deffnx {Interface Command} {ip ospf dead-interval minimal hello-multiplier <2-20>} {}
718e3744 482@deffnx {Interface Command} {no ip ospf dead-interval} {}
c3eab60e
PJ
483@anchor{ip ospf dead-interval minimal} Set number of seconds for
484RouterDeadInterval timer value used for Wait Timer and Inactivity
485Timer. This value must be the same for all routers attached to a
486common network. The default value is 40 seconds.
e5b308d1 487
488If 'minimal' is specified instead, then the dead-interval is set to 1
489second and one must specify a hello-multiplier. The hello-multiplier
490specifies how many Hellos to send per second, from 2 (every 500ms) to
49120 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form
492is specified, then the hello-interval advertised in Hello packets is set to
4930 and the hello-interval on received Hello packets is not checked, thus
494the hello-multiplier need NOT be the same across multiple routers on a common
495link.
718e3744 496@end deffn
497
498@deffn {Interface Command} {ip ospf hello-interval <1-65535>} {}
499@deffnx {Interface Command} {no ip ospf hello-interval} {}
500Set number of seconds for HelloInterval timer value. Setting this value,
501Hello packet will be sent every timer value seconds on the specified interface.
502This value must be the same for all routers attached to a common network.
503The default value is 10 seconds.
e5b308d1 504
505This command has no effect if @ref{ip ospf dead-interval minimal} is also
506specified for the interface.
718e3744 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} {}
511Set 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} {}
f912cb4f
PJ
516Set RouterPriority integer value. The router with the highest priority
517will be more eligible to become Designated Router. Setting the value
518to 0, makes the router ineligible to become Designated Router. The
519default value is 1.
718e3744 520@end deffn
521
522@deffn {Interface Command} {ip ospf retransmit-interval <1-65535>} {}
523@deffnx {Interface Command} {no ip ospf retransmit interval} {}
524Set number of seconds for RxmtInterval timer value. This value is used
525when retransmitting Database Description and Link State Request packets.
526The 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} {}
531Set number of seconds for InfTransDelay value. LSAs' age should be
532incremented by this value when transmitting.
533The default value is 1 seconds.
534@end deffn
535
953cde65
JT
536@deffn {Interface Command} {ip ospf area (A.B.C.D|<0-4294967295>)} {}
537@deffnx {Interface Command} {no ip ospf area} {}
538Enable ospf on an interface and set associated area.
539@end deffn
540
76b89b4a 541@node Redistribute routes to OSPF
718e3744 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)} {}
c3eab60e
PJ
553@anchor{OSPF redistribute}Redistribute routes of the specified protocol
554or kind into OSPF, with the metric type and metric set if specified,
555filtering the routes using the given route-map if specified.
556Redistributed routes may also be filtered with distribute-lists, see
557@ref{ospf distribute-list}.
f912cb4f
PJ
558
559Redistributed routes are distributed as into OSPF as Type-5 External
560LSAs into links to areas that accept external routes, Type-7 External LSAs
561for NSSA areas and are not redistributed at all into Stub areas, where
562external routes are not permitted.
563
564Note that for connected routes, one may instead use
565@dfn{passive-interface}, see @ref{OSPF passive-interface}.
718e3744 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} {}
e5b308d1 577Originate an AS-External (type-5) LSA describing a default route into
578all external-routing capable areas, of the specified metric and metric
579type. If the 'always' keyword is given then the default is always
580advertised, even when there is no default present in the routing table.
718e3744 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} {}
c3eab60e
PJ
585@anchor{ospf distribute-list}Apply the access-list filter, NAME, to
586redistributed routes of the given type before allowing the routes to
587redistributed into OSPF (@pxref{OSPF redistribute}).
718e3744 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
65efcfce
LB
602@deffn {Command} {router zebra} {}
603@deffnx {Command} {no router zebra} {}
604@end deffn
605
76b89b4a 606@node Showing OSPF information
718e3744 607@section Showing OSPF information
608
609@deffn {Command} {show ip ospf} {}
c3eab60e
PJ
610@anchor{show ip ospf}Show information on a variety of general OSPF and
611area state and configuration information.
718e3744 612@end deffn
613
614@deffn {Command} {show ip ospf interface [INTERFACE]} {}
e5b308d1 615Show state and configuration of OSPF the specified interface, or all
616interfaces if no interface is given.
718e3744 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
718e3744 642@deffn {Command} {show ip ospf route} {}
e5b308d1 643Show the OSPF routing table, as determined by the most recent SPF calculation.
718e3744 644@end deffn
645
4b547606
OD
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} {}
662Show 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} {}
670Enable 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} {}
675Configure stable IP address for MPLS-TE. This IP address is then advertise in Opaque LSA Type-10 TLV=1 (TE)
676option 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} {}
681Enable RFC5392 suuport - Inter-AS TE v2 - to flood Traffic Engineering parameters of Inter-AS link.
6822 modes are supported: AREA and AS; LSA are flood in AREA <area-id> with Opaque Type-10,
683respectively 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}} {}
688Show MPLS Traffic Engineering parameters for all or specified interface.
689@end deffn
690
691@deffn {Command} {show ip ospf mpls-te router} {}
692Show 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} {}
700Enable Router Information (RFC4970) LSA advertisement with AS scope (default) or Area scope flooding
701when 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} {}
714The commands are conform to RFC 5088 and allow OSPF router announce Path Compuatation Elemenent (PCE) capabilities
715through the Router Information (RI) LSA. Router Information must be enable prior to this. The command set/unset
716respectively the PCE IP adress, Autonomous System (AS) numbers of controlled domains, neighbor ASs, flag and scope.
717For flag and scope, please refer to RFC5088 for the BITPATTERN recognition. Multiple 'pce neighbor' command could
718be specified in order to specify all PCE neighbours.
719@end deffn
720
721@deffn {Command} {show ip ospf router-info} {}
722Show Router Capabilities flag.
723@end deffn
724@deffn {Command} {show ip ospf router-info pce} {}
725Show Router Capabilities PCE parameters.
726@end deffn
727
cf9b9f77
OD
728@node Segment Routing
729@section Segment Routing
730
731This is an EXPERIMENTAL support of Segment Routing as per draft
7743f2f8 732 draft-ietf-ospf-segment-routing-extensions-24.txt for MPLS dataplane.
cf9b9f77
OD
733
734@deffn {OSPF Command} {segment-routing on} {}
735@deffnx {OSPF Command} {no segment-routing} {}
736Enable Segment Routing. Even if this also activate routing information support,
737it is preferable to also activate routing information, and set accordingly the
738Area 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} {}
743Fix the Segment Routing Global Block i.e. the label range used by MPLS to store
744label 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} {}
7743f2f8 749Fix the Maximum Stack Depth supported by the router. The value depend of the
cf9b9f77
OD
750MPLS 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)} {}
7743f2f8 754@deffnx {OSPF Command} {segment-routing prefix A.B.C.D/M index (0-65535) no-php-flag} {}
cf9b9f77
OD
755@deffnx {OSPF Command} {no segment-routing prefix A.B.C.D/M} {}
756Set the Segment Rounting index for the specifyed prefix. Note
7743f2f8
OD
757that, only prefix with /32 corresponding to a loopback interface are
758currently supported. The 'no-php-flag' means NO Penultimate Hop Popping that
759allows SR node to request to its neighbor to not pop the label.
cf9b9f77
OD
760@end deffn
761
76665890
OD
762@deffn {Command} {show ip ospf database segment-routing [json]} {}
763@deffnx {Command} {show ip ospf database segment-routing adv-router @var{adv-router} [json]} {}
764@deffnx {Command} {show ip ospf database segment-routing self-originate [json]} {}
cf9b9f77 765Show Segment Routing Data Base, all SR nodes, specific advertized router or self router.
76665890 766Optional Json output could be obtain by adding 'json' at the end of the command.
cf9b9f77
OD
767@end deffn
768
76b89b4a 769@node Debugging OSPF
718e3744 770@section Debugging OSPF
771
772@deffn {Command} {debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
773@deffnx {Command} {no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
4b547606 774Dump Packet for debugging
718e3744 775@end deffn
776
777@deffn {Command} {debug ospf ism} {}
778@deffnx {Command} {debug ospf ism (status|events|timers)} {}
779@deffnx {Command} {no debug ospf ism} {}
780@deffnx {Command} {no debug ospf ism (status|events|timers)} {}
4b547606 781Show debug information of Interface State Machine
718e3744 782@end deffn
783
784@deffn {Command} {debug ospf nsm} {}
785@deffnx {Command} {debug ospf nsm (status|events|timers)} {}
786@deffnx {Command} {no debug ospf nsm} {}
787@deffnx {Command} {no debug ospf nsm (status|events|timers)} {}
4b547606
OD
788Show debug information of Network State Machine
789@end deffn
790
791@deffn {Command} {debug ospf event} {}
792@deffnx {Command} {no debug ospf event} {}
793Show debug information of OSPF event
794@end deffn
795
796@deffn {Command} {debug ospf nssa} {}
797@deffnx {Command} {no debug ospf nssa} {}
798Show debug information about Not So Stub Area
718e3744 799@end deffn
800
801@deffn {Command} {debug ospf lsa} {}
802@deffnx {Command} {debug ospf lsa (generate|flooding|refresh)} {}
803@deffnx {Command} {no debug ospf lsa} {}
804@deffnx {Command} {no debug ospf lsa (generate|flooding|refresh)} {}
4b547606
OD
805Show debug detail of Link State messages
806@end deffn
807
808@deffn {Command} {debug ospf te} {}
809@deffnx {Command} {no debug ospf te} {}
810Show debug information about Traffic Engineering LSA
718e3744 811@end deffn
812
813@deffn {Command} {debug ospf zebra} {}
814@deffnx {Command} {debug ospf zebra (interface|redistribute)} {}
815@deffnx {Command} {no debug ospf zebra} {}
816@deffnx {Command} {no debug ospf zebra (interface|redistribute)} {}
4b547606 817Show debug information of ZEBRA API
718e3744 818@end deffn
819
820@deffn {Command} {show debugging ospf} {}
821@end deffn
822
e5b308d1 823@node OSPF Configuration Examples
824@section OSPF Configuration Examples
825A simple example, with MD5 authentication enabled:
826
827@example
828@group
829!
830interface bge0
831 ip ospf authentication message-digest
832 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
833!
834router ospf
835 network 192.168.0.0/16 area 0.0.0.1
836 area 0.0.0.1 authentication message-digest
837@end group
838@end example
839
840An @acronym{ABR} router, with MD5 authentication and performing summarisation
841of networks between the areas:
842
843@example
844@group
845!
846password ABCDEF
438f5286 847log file /var/log/frr/ospfd.log
e5b308d1 848service advanced-vty
849!
850interface eth0
851 ip ospf authentication message-digest
852 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
853!
854interface ppp0
855!
856interface br0
857 ip ospf authentication message-digest
858 ip ospf message-digest-key 2 md5 XYZ12345
859!
860router ospf
861 ospf router-id 192.168.0.1
862 redistribute connected
863 passive interface ppp0
864 network 192.168.0.0/24 area 0.0.0.0
865 network 10.0.0.0/16 area 0.0.0.0
866 network 192.168.1.0/24 area 0.0.0.1
867 area 0.0.0.0 authentication message-digest
868 area 0.0.0.0 range 10.0.0.0/16
869 area 0.0.0.0 range 192.168.0.0/24
870 area 0.0.0.1 authentication message-digest
871 area 0.0.0.1 range 10.2.0.0/16
872!
873@end group
874@end example
4b547606
OD
875
876A Traffic Engineering configuration, with Inter-ASv2 support.
877
878 - First, the 'zebra.conf' part:
879
880@example
881@group
882hostname HOSTNAME
883password PASSWORD
884log file /var/log/zebra.log
885!
886interface eth0
887 ip address 198.168.1.1/24
ee65c55e
OD
888 link-params
889 enable
890 admin-grp 0xa1
891 metric 100
892 max-bw 1.25e+07
893 max-rsv-bw 1.25e+06
894 unrsv-bw 0 1.25e+06
895 unrsv-bw 1 1.25e+06
896 unrsv-bw 2 1.25e+06
897 unrsv-bw 3 1.25e+06
898 unrsv-bw 4 1.25e+06
899 unrsv-bw 5 1.25e+06
900 unrsv-bw 6 1.25e+06
901 unrsv-bw 7 1.25e+06
4b547606
OD
902!
903interface eth1
904 ip address 192.168.2.1/24
ee65c55e
OD
905 link-params
906 enable
907 metric 10
908 max-bw 1.25e+07
909 max-rsv-bw 1.25e+06
910 unrsv-bw 0 1.25e+06
911 unrsv-bw 1 1.25e+06
912 unrsv-bw 2 1.25e+06
913 unrsv-bw 3 1.25e+06
914 unrsv-bw 4 1.25e+06
915 unrsv-bw 5 1.25e+06
916 unrsv-bw 6 1.25e+06
917 unrsv-bw 7 1.25e+06
918 neighbor 192.168.2.2 as 65000
4b547606
OD
919@end group
920@end example
921
922 - Then the 'ospfd.conf' itself:
923
924@example
925@group
926hostname HOSTNAME
927password PASSWORD
928log file /var/log/ospfd.log
929!
930!
931interface eth0
932 ip ospf hello-interval 60
933 ip ospf dead-interval 240
934!
935interface eth1
936 ip ospf hello-interval 60
937 ip ospf dead-interval 240
938!
939!
940router ospf
941 ospf router-id 192.168.1.1
942 network 192.168.0.0/16 area 1
943 ospf opaque-lsa
944 mpls-te
945 mpls-te router-address 192.168.1.1
946 mpls-te inter-as area 1
947!
948line vty
949@end group
950@end example
951
952A router information example with PCE advsertisement:
953
954@example
955@group
956!
957router ospf
958 ospf router-id 192.168.1.1
959 network 192.168.0.0/16 area 1
960 capability opaque
961 mpls-te
962 mpls-te router-address 192.168.1.1
963 router-info area 0.0.0.1
964 pce address 192.168.1.1
965 pce flag 0x80
966 pce domain as 65400
967 pce neighbor as 65500
968 pce neighbor as 65200
969 pce scope 0x80
970!
971@end group
972@end example