blob: 86cabe4096cded130cc0581cfaca78f27901a686 [file] [log] [blame]
Paul Jakmaf912cb42006-07-27 23:30:16 +00001@cindex OSPFv2
paul76b89b42004-11-06 17:13:09 +00002@node OSPFv2
paul718e3742002-12-13 20:15:29 +00003@chapter OSPFv2
4
paule5b308d2005-10-29 20:19:49 +00005@acronym{OSPF,Open Shortest Path First} version 2 is a routing protocol
6which is described in @cite{RFC2328, OSPF Version 2}. OSPF is an
Paul Jakmaf912cb42006-07-27 23:30:16 +00007@acronym{IGP,Interior Gateway Protocol}. Compared with @acronym{RIP},
paule5b308d2005-10-29 20:19:49 +00008@acronym{OSPF} can provide scalable network support and faster
9convergence times. OSPF is widely used in large networks such as
10@acronym{ISP,Internet Service Provider} backbone and enterprise
11networks.
paul718e3742002-12-13 20:15:29 +000012
13@menu
Paul Jakmae56aab92015-10-20 16:14:56 +010014* OSPF Fundamentals::
paul718e3742002-12-13 20:15:29 +000015* Configuring ospfd::
16* OSPF router::
17* OSPF area::
18* OSPF interface::
19* Redistribute routes to OSPF::
20* Showing OSPF information::
21* Debugging OSPF::
paule5b308d2005-10-29 20:19:49 +000022* OSPF Configuration Examples::
paul718e3742002-12-13 20:15:29 +000023@end menu
24
Paul Jakmae56aab92015-10-20 16:14:56 +010025@include ospf_fundamentals.texi
26
paul76b89b42004-11-06 17:13:09 +000027@node Configuring ospfd
paul718e3742002-12-13 20:15:29 +000028@section Configuring ospfd
29
paule5b308d2005-10-29 20:19:49 +000030There are no @command{ospfd} specific options. Common options can be
paul718e3742002-12-13 20:15:29 +000031specified (@pxref{Common Invocation Options}) to @command{ospfd}.
paule5b308d2005-10-29 20:19:49 +000032@command{ospfd} needs to acquire interface information from
33@command{zebra} in order to function. Therefore @command{zebra} must be
34running before invoking @command{ospfd}. Also, if @command{zebra} is
35restarted then @command{ospfd} must be too.
paul718e3742002-12-13 20:15:29 +000036
paule5b308d2005-10-29 20:19:49 +000037Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
paul718e3742002-12-13 20:15:29 +000038specific configuration file @file{ospfd.conf}.
39
paul76b89b42004-11-06 17:13:09 +000040@node OSPF router
paul718e3742002-12-13 20:15:29 +000041@section OSPF router
42
43To start OSPF process you have to specify the OSPF router. As of this
44writing, @command{ospfd} does not support multiple OSPF processes.
45
46@deffn Command {router ospf} {}
47@deffnx Command {no router ospf} {}
48Enable or disable the OSPF process. @command{ospfd} does not yet
49support multiple OSPF processes. So you can not specify an OSPF process
50number.
51@end deffn
52
53@deffn {OSPF Command} {ospf router-id @var{a.b.c.d}} {}
54@deffnx {OSPF Command} {no ospf router-id} {}
Paul Jakmac3eab602006-07-28 04:42:39 +000055@anchor{ospf router-id}This sets the router-ID of the OSPF process. The
56router-ID may be an IP address of the router, but need not be - it can
57be any arbitrary 32bit number. However it MUST be unique within the
58entire OSPF domain to the OSPF speaker - bad things will happen if
59multiple OSPF speakers are configured with the same router-ID! If one
60is not specified then @command{ospfd} will obtain a router-ID
61automatically from @command{zebra}.
paul718e3742002-12-13 20:15:29 +000062@end deffn
63
64@deffn {OSPF Command} {ospf abr-type @var{type}} {}
65@deffnx {OSPF Command} {no ospf abr-type @var{type}} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +000066@var{type} can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
67are equivalent.
68
69The OSPF standard for ABR behaviour does not allow an ABR to consider
70routes through non-backbone areas when its links to the backbone are
71down, even when there are other ABRs in attached non-backbone areas
72which still can reach the backbone - this restriction exists primarily
73to ensure routing-loops are avoided.
74
75With the "Cisco" or "IBM" ABR type, the default in this release of
76Quagga, this restriction is lifted, allowing an ABR to consider
77summaries learnt from other ABRs through non-backbone areas, and hence
78route via non-backbone areas as a last resort when, and only when,
79backbone links are down.
80
81Note that areas with fully-adjacent virtual-links are considered to be
82"transit capable" and can always be used to route backbone traffic, and
83hence are unaffected by this setting (@pxref{OSPF virtual-link}).
paule5b308d2005-10-29 20:19:49 +000084
pauld4f50312003-01-22 19:26:00 +000085More information regarding the behaviour controlled by this command can
paule5b308d2005-10-29 20:19:49 +000086be found in @cite{RFC 3509, Alternative Implementations of OSPF Area
87Border Routers}, and @cite{draft-ietf-ospf-shortcut-abr-02.txt}.
88
89Quote: "Though the definition of the @acronym{ABR,Area Border Router}
pauld4f50312003-01-22 19:26:00 +000090in the OSPF specification does not require a router with multiple
91attached areas to have a backbone connection, it is actually
92necessary to provide successful routing to the inter-area and
93external destinations. If this requirement is not met, all traffic
94destined for the areas not connected to such an ABR or out of the
95OSPF domain, is dropped. This document describes alternative ABR
96behaviors implemented in Cisco and IBM routers."
paul718e3742002-12-13 20:15:29 +000097@end deffn
98
99@deffn {OSPF Command} {ospf rfc1583compatibility} {}
100@deffnx {OSPF Command} {no ospf rfc1583compatibility} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +0000101@cite{RFC2328}, the sucessor to @cite{RFC1583}, suggests according
paule5b308d2005-10-29 20:19:49 +0000102to section G.2 (changes) in section 16.4 a change to the path
103preference algorithm that prevents possible routing loops that were
104possible in the old version of OSPFv2. More specifically it demands
Alexandre Chappuis37075da2011-09-13 16:33:45 +0400105that inter-area paths and intra-area backbone path are now of equal preference
paule5b308d2005-10-29 20:19:49 +0000106but still both preferred to external paths.
107
108This command should NOT be set normally.
paul718e3742002-12-13 20:15:29 +0000109@end deffn
110
Andrew J. Schorrd7e60dd2006-06-29 20:20:52 +0000111@deffn {OSPF Command} {log-adjacency-changes [detail]} {}
112@deffnx {OSPF Command} {no log-adjacency-changes [detail]} {}
113Configures ospfd to log changes in adjacency. With the optional
114detail argument, all changes in adjacency status are shown. Without detail,
115only changes to full or regressions are shown.
116@end deffn
117
Paul Jakmaf912cb42006-07-27 23:30:16 +0000118@deffn {OSPF Command} {passive-interface @var{interface}} {}
119@deffnx {OSPF Command} {no passive-interface @var{interface}} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000120@anchor{OSPF passive-interface} Do not speak OSPF interface on the
121given interface, but do advertise the interface as a stub link in the
122router-@acronym{LSA,Link State Advertisement} for this router. This
123allows one to advertise addresses on such connected interfaces without
124having to originate AS-External/Type-5 LSAs (which have global flooding
125scope) - as would occur if connected addresses were redistributed into
126OSPF (@pxref{Redistribute routes to OSPF})@. This is the only way to
127advertise non-OSPF links into stub areas.
paul718e3742002-12-13 20:15:29 +0000128@end deffn
129
paule5b308d2005-10-29 20:19:49 +0000130@deffn {OSPF Command} {timers throttle spf @var{delay} @var{initial-holdtime} @var{max-holdtime}} {}
131@deffnx {OSPF Command} {no timers throttle spf} {}
132This command sets the initial @var{delay}, the @var{initial-holdtime}
133and the @var{maximum-holdtime} between when SPF is calculated and the
134event which triggered the calculation. The times are specified in
135milliseconds and must be in the range of 0 to 600000 milliseconds.
136
137The @var{delay} specifies the minimum amount of time to delay SPF
138calculation (hence it affects how long SPF calculation is delayed after
139an event which occurs outside of the holdtime of any previous SPF
140calculation, and also serves as a minimum holdtime).
141
142Consecutive SPF calculations will always be seperated by at least
143'hold-time' milliseconds. The hold-time is adaptive and initially is
144set to the @var{initial-holdtime} configured with the above command.
145Events which occur within the holdtime of the previous SPF calculation
146will cause the holdtime to be increased by @var{initial-holdtime}, bounded
147by the @var{maximum-holdtime} configured with this command. If the adaptive
148hold-time elapses without any SPF-triggering event occuring then
149the current holdtime is reset to the @var{initial-holdtime}. The current
150holdtime can be viewed with @ref{show ip ospf}, where it is expressed as
151a multiplier of the @var{initial-holdtime}.
152
153@example
154@group
155router ospf
156 timers throttle spf 200 400 10000
157@end group
158@end example
159
160In this example, the @var{delay} is set to 200ms, the @var{initial
161holdtime} is set to 400ms and the @var{maximum holdtime} to 10s. Hence
162there will always be at least 200ms between an event which requires SPF
163calculation and the actual SPF calculation. Further consecutive SPF
164calculations will always be seperated by between 400ms to 10s, the
165hold-time increasing by 400ms each time an SPF-triggering event occurs
166within the hold-time of the previous SPF calculation.
167
168This command supercedes the @command{timers spf} command in previous Quagga
169releases.
paul718e3742002-12-13 20:15:29 +0000170@end deffn
171
paule5b308d2005-10-29 20:19:49 +0000172@deffn {OSPF Command} {max-metric router-lsa [on-startup|on-shutdown] <5-86400>} {}
173@deffnx {OSPF Command} {max-metric router-lsa administrative} {}
174@deffnx {OSPF Command} {no max-metric router-lsa [on-startup|on-shutdown|administrative]} {}
175This enables @cite{RFC3137, OSPF Stub Router Advertisement} support,
176where the OSPF process describes its transit links in its router-LSA as
177having infinite distance so that other routers will avoid calculating
178transit paths through the router while still being able to reach
179networks through the router.
180
181This support may be enabled administratively (and indefinitely) or
182conditionally. Conditional enabling of max-metric router-lsas can be
183for a period of seconds after startup and/or for a period of seconds
184prior to shutdown.
185
186Enabling this for a period after startup allows OSPF to converge fully
187first without affecting any existing routes used by other routers,
188while still allowing any connected stub links and/or redistributed
189routes to be reachable. Enabling this for a period of time in advance
190of shutdown allows the router to gracefully excuse itself from the OSPF
191domain.
192
193Enabling this feature administratively allows for administrative
194intervention for whatever reason, for an indefinite period of time.
195Note that if the configuration is written to file, this administrative
196form of the stub-router command will also be written to file. If
197@command{ospfd} is restarted later, the command will then take effect
198until manually deconfigured.
199
200Configured state of this feature as well as current status, such as the
201number of second remaining till on-startup or on-shutdown ends, can be
202viewed with the @ref{show ip ospf} command.
paul718e3742002-12-13 20:15:29 +0000203@end deffn
204
paule5b308d2005-10-29 20:19:49 +0000205@deffn {OSPF Command} {auto-cost reference-bandwidth <1-4294967>} {}
206@deffnx {OSPF Command} {no auto-cost reference-bandwidth} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000207@anchor{OSPF auto-cost reference-bandwidth}This sets the reference
208bandwidth for cost calculations, where this bandwidth is considered
209equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
210100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
211cost of 1. Cost of lower bandwidth links will be scaled with reference
212to this cost).
paule5b308d2005-10-29 20:19:49 +0000213
214This configuration setting MUST be consistent across all routers within the
215OSPF domain.
paul718e3742002-12-13 20:15:29 +0000216@end deffn
217
218@deffn {OSPF Command} {network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
219@deffnx {OSPF Command} {network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
220@deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
221@deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
Paul Jakma8a667cf2009-08-27 16:51:42 +0100222@anchor{OSPF network command}
hassoa5b2b592004-04-17 10:09:29 +0000223This command specifies the OSPF enabled interface(s). If the interface has
224an address from range 192.168.1.0/24 then the command below enables ospf
225on this interface so router can provide network information to the other
226ospf routers via this interface.
paule5b308d2005-10-29 20:19:49 +0000227
paul718e3742002-12-13 20:15:29 +0000228@example
229@group
230router ospf
hassoa5b2b592004-04-17 10:09:29 +0000231 network 192.168.1.0/24 area 0.0.0.0
paul718e3742002-12-13 20:15:29 +0000232@end group
233@end example
paule5b308d2005-10-29 20:19:49 +0000234
hassoa5b2b592004-04-17 10:09:29 +0000235Prefix length in interface must be equal or bigger (ie. smaller network) than
236prefix length in network statement. For example statement above doesn't enable
237ospf on interface with address 192.168.1.1/23, but it does on interface with
238address 192.168.1.129/25.
Andrew J. Schorrf0ec8322007-04-30 16:52:05 +0000239
240Note that the behavior when there is a peer address
241defined on an interface changed after release 0.99.7.
242Currently, if a peer prefix has been configured,
243then we test whether the prefix in the network command contains
244the destination prefix. Otherwise, we test whether the network command prefix
245contains the local address prefix of the interface.
Paul Jakma8a667cf2009-08-27 16:51:42 +0100246
247In some cases it may be more convenient to enable OSPF on a per
248interface/subnet basis (@pxref{OSPF ip ospf area command}).
249
paul718e3742002-12-13 20:15:29 +0000250@end deffn
251
paul76b89b42004-11-06 17:13:09 +0000252@node OSPF area
paul718e3742002-12-13 20:15:29 +0000253@section OSPF area
254
255@deffn {OSPF Command} {area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
256@deffnx {OSPF Command} {area <0-4294967295> range @var{a.b.c.d/m}} {}
257@deffnx {OSPF Command} {no area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
258@deffnx {OSPF Command} {no area <0-4294967295> range @var{a.b.c.d/m}} {}
hasso63869f12004-04-19 14:43:46 +0000259Summarize intra area paths from specified area into one Type-3 summary-LSA
260announced to other areas. This command can be used only in ABR and ONLY
261router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
262be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
263Summarizing Type-7 AS-external-LSAs isn't supported yet by Quagga.
paule5b308d2005-10-29 20:19:49 +0000264
hasso63869f12004-04-19 14:43:46 +0000265@example
266@group
267router ospf
268 network 192.168.1.0/24 area 0.0.0.0
269 network 10.0.0.0/8 area 0.0.0.10
270 area 0.0.0.10 range 10.0.0.0/8
271@end group
272@end example
paule5b308d2005-10-29 20:19:49 +0000273
hasso63869f12004-04-19 14:43:46 +0000274With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
275announced into backbone area if area 0.0.0.10 contains at least one intra-area
276network (ie. described with router or network LSA) from this range.
paul718e3742002-12-13 20:15:29 +0000277@end deffn
278
hasso63869f12004-04-19 14:43:46 +0000279@deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
280@deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
281Instead of summarizing intra area paths filter them - ie. intra area paths from this
282range are not advertised into other areas.
283This command makes sense in ABR only.
284@end deffn
285
hasso6b3fac02004-04-20 04:11:36 +0000286@deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
paul718e3742002-12-13 20:15:29 +0000287@deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
hasso63869f12004-04-19 14:43:46 +0000288Substitute summarized prefix with another prefix.
paule5b308d2005-10-29 20:19:49 +0000289
hasso63869f12004-04-19 14:43:46 +0000290@example
291@group
292router ospf
293 network 192.168.1.0/24 area 0.0.0.0
294 network 10.0.0.0/8 area 0.0.0.10
295 area 0.0.0.10 range 10.0.0.0/8 substitute 11.0.0.0/8
296@end group
297@end example
paule5b308d2005-10-29 20:19:49 +0000298
hasso63869f12004-04-19 14:43:46 +0000299One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
300area 0.0.0.10 contains at least one intra-area network (ie. described with router-LSA or
301network-LSA) from range 10.0.0.0/8.
302This command makes sense in ABR only.
paul718e3742002-12-13 20:15:29 +0000303@end deffn
304
305@deffn {OSPF Command} {area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
306@deffnx {OSPF Command} {area <0-4294967295> virtual-link @var{a.b.c.d}} {}
307@deffnx {OSPF Command} {no area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
308@deffnx {OSPF Command} {no area <0-4294967295> virtual-link @var{a.b.c.d}} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000309@anchor{OSPF virtual-link}
paul718e3742002-12-13 20:15:29 +0000310@end deffn
311
312@deffn {OSPF Command} {area @var{a.b.c.d} shortcut} {}
313@deffnx {OSPF Command} {area <0-4294967295> shortcut} {}
314@deffnx {OSPF Command} {no area @var{a.b.c.d} shortcut} {}
315@deffnx {OSPF Command} {no area <0-4294967295> shortcut} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +0000316Configure the area as Shortcut capable. See @cite{RFC3509}. This requires
paule5b308d2005-10-29 20:19:49 +0000317that the 'abr-type' be set to 'shortcut'.
paul718e3742002-12-13 20:15:29 +0000318@end deffn
319
320@deffn {OSPF Command} {area @var{a.b.c.d} stub} {}
321@deffnx {OSPF Command} {area <0-4294967295> stub} {}
322@deffnx {OSPF Command} {no area @var{a.b.c.d} stub} {}
323@deffnx {OSPF Command} {no area <0-4294967295> stub} {}
paule5b308d2005-10-29 20:19:49 +0000324Configure the area to be a stub area. That is, an area where no router
325originates routes external to OSPF and hence an area where all external
326routes are via the ABR(s). Hence, ABRs for such an area do not need
327to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
328area. They need only pass Network-Summary (type-3) LSAs into such an area,
Paul Jakmaf912cb42006-07-27 23:30:16 +0000329along with a default-route summary.
paul718e3742002-12-13 20:15:29 +0000330@end deffn
331
332@deffn {OSPF Command} {area @var{a.b.c.d} stub no-summary} {}
333@deffnx {OSPF Command} {area <0-4294967295> stub no-summary} {}
334@deffnx {OSPF Command} {no area @var{a.b.c.d} stub no-summary} {}
335@deffnx {OSPF Command} {no area <0-4294967295> stub no-summary} {}
paule5b308d2005-10-29 20:19:49 +0000336Prevents an @command{ospfd} ABR from injecting inter-area
337summaries into the specified stub area.
paul718e3742002-12-13 20:15:29 +0000338@end deffn
339
340@deffn {OSPF Command} {area @var{a.b.c.d} default-cost <0-16777215>} {}
341@deffnx {OSPF Command} {no area @var{a.b.c.d} default-cost <0-16777215>} {}
paule5b308d2005-10-29 20:19:49 +0000342Set the cost of default-summary LSAs announced to stubby areas.
paul718e3742002-12-13 20:15:29 +0000343@end deffn
344
345@deffn {OSPF Command} {area @var{a.b.c.d} export-list NAME} {}
346@deffnx {OSPF Command} {area <0-4294967295> export-list NAME} {}
347@deffnx {OSPF Command} {no area @var{a.b.c.d} export-list NAME} {}
348@deffnx {OSPF Command} {no area <0-4294967295> export-list NAME} {}
hasso63869f12004-04-19 14:43:46 +0000349Filter Type-3 summary-LSAs announced to other areas originated from intra-
350area paths from specified area.
paule5b308d2005-10-29 20:19:49 +0000351
hasso63869f12004-04-19 14:43:46 +0000352@example
353@group
354router ospf
355 network 192.168.1.0/24 area 0.0.0.0
356 network 10.0.0.0/8 area 0.0.0.10
357 area 0.0.0.10 export-list foo
358!
359access-list foo permit 10.10.0.0/16
360access-list foo deny any
361@end group
362@end example
paule5b308d2005-10-29 20:19:49 +0000363
hasso63869f12004-04-19 14:43:46 +0000364With example above any intra-area paths from area 0.0.0.10 and from range
36510.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
366other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
367or 10.128.30.16/30) aren't.
paule5b308d2005-10-29 20:19:49 +0000368
369This command is only relevant if the router is an ABR for the specified
370area.
paul718e3742002-12-13 20:15:29 +0000371@end deffn
372
373@deffn {OSPF Command} {area @var{a.b.c.d} import-list NAME} {}
374@deffnx {OSPF Command} {area <0-4294967295> import-list NAME} {}
375@deffnx {OSPF Command} {no area @var{a.b.c.d} import-list NAME} {}
376@deffnx {OSPF Command} {no area <0-4294967295> import-list NAME} {}
hasso63869f12004-04-19 14:43:46 +0000377Same as export-list, but it applies to paths announced into specified area as
378Type-3 summary-LSAs.
379@end deffn
380
hasso808c0a72004-04-19 15:10:20 +0000381@deffn {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME in} {}
382@deffnx {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME out} {}
383@deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME in} {}
384@deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME out} {}
385@deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME in} {}
386@deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME out} {}
387@deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME in} {}
388@deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME out} {}
hassoc266ac72004-04-19 17:31:00 +0000389Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
390makes sense in ABR only.
paul718e3742002-12-13 20:15:29 +0000391@end deffn
392
393@deffn {OSPF Command} {area @var{a.b.c.d} authentication} {}
394@deffnx {OSPF Command} {area <0-4294967295> authentication} {}
395@deffnx {OSPF Command} {no area @var{a.b.c.d} authentication} {}
396@deffnx {OSPF Command} {no area <0-4294967295> authentication} {}
paule5b308d2005-10-29 20:19:49 +0000397Specify that simple password authentication should be used for the given
398area.
paul718e3742002-12-13 20:15:29 +0000399@end deffn
400
401@deffn {OSPF Command} {area @var{a.b.c.d} authentication message-digest} {}
402@deffnx {OSPF Command} {area <0-4294967295> authentication message-digest} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000403
404@anchor{area authentication message-digest}Specify that OSPF packets
405must be authenticated with MD5 HMACs within the given area. Keying
406material must also be configured on a per-interface basis (@pxref{ip
407ospf message-digest-key}).
408
409MD5 authentication may also be configured on a per-interface basis
410(@pxref{ip ospf authentication message-digest}). Such per-interface
411settings will override any per-area authentication setting.
paul718e3742002-12-13 20:15:29 +0000412@end deffn
413
paul76b89b42004-11-06 17:13:09 +0000414@node OSPF interface
paul718e3742002-12-13 20:15:29 +0000415@section OSPF interface
416
Paul Jakma8a667cf2009-08-27 16:51:42 +0100417@deffn {Interface Command} {ip ospf area @var{AREA} [@var{ADDR}]} {}
418@deffnx {Interface Command} {no ip ospf area [@var{ADDR}]} {}
419@anchor{OSPF ip ospf area command}
420
421Enable OSPF on the interface, optionally restricted to just the IP address
422given by @var{ADDR}, putting it in the @var{AREA} area. Per interface area
423settings take precedence to network commands (@pxref{OSPF network command}).
424
425If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
426via this command may result in a slight performance improvement.
427
428@end deffn
429
paule5b308d2005-10-29 20:19:49 +0000430@deffn {Interface Command} {ip ospf authentication-key @var{AUTH_KEY}} {}
paul718e3742002-12-13 20:15:29 +0000431@deffnx {Interface Command} {no ip ospf authentication-key} {}
432Set OSPF authentication key to a simple password. After setting @var{AUTH_KEY},
433all OSPF packets are authenticated. @var{AUTH_KEY} has length up to 8 chars.
Paul Jakmaf912cb42006-07-27 23:30:16 +0000434
435Simple text password authentication is insecure and deprecated in favour of
Paul Jakmac3eab602006-07-28 04:42:39 +0000436MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
paul718e3742002-12-13 20:15:29 +0000437@end deffn
438
Paul Jakmac3eab602006-07-28 04:42:39 +0000439@deffn {Interface Command} {ip ospf authentication message-digest} {}
440@anchor{ip ospf authentication message-digest}Specify that MD5 HMAC
441authentication must be used on this interface. MD5 keying material must
442also be configured (@pxref{ip ospf message-digest-key}). Overrides any
443authentication enabled on a per-area basis (@pxref{area
444authentication message-digest}).
paule2ea9fe2004-10-11 14:33:23 +0000445
446Note that OSPF MD5 authentication requires that time never go backwards
paule5b308d2005-10-29 20:19:49 +0000447(correct time is NOT important, only that it never goes backwards), even
paule2ea9fe2004-10-11 14:33:23 +0000448across resets, if ospfd is to be able to promptly reestabish adjacencies
449with its neighbours after restarts/reboots. The host should have system
Paul Jakma466c9652006-06-26 12:55:58 +0000450time be set at boot from an external or non-volatile source (eg battery backed clock, NTP,
paule2ea9fe2004-10-11 14:33:23 +0000451etc.) or else the system clock should be periodically saved to non-volative
452storage and restored at boot if MD5 authentication is to be expected to work
453reliably.
paul718e3742002-12-13 20:15:29 +0000454@end deffn
455
Paul Jakmac3eab602006-07-28 04:42:39 +0000456@deffn {Interface Command} {ip ospf message-digest-key KEYID md5 KEY} {}
457@deffnx {Interface Command} {no ip ospf message-digest-key} {}
458@anchor{ip ospf message-digest-key}Set OSPF authentication key to a
459cryptographic password. The cryptographic algorithm is MD5.
460
461KEYID identifies secret key used to create the message digest. This ID
462is part of the protocol and must be consistent across routers on a
463link.
464
465KEY is the actual message digest key, of up to 16 chars (larger strings
466will be truncated), and is associated with the given KEYID.
467@end deffn
468
paul718e3742002-12-13 20:15:29 +0000469@deffn {Interface Command} {ip ospf cost <1-65535>} {}
470@deffnx {Interface Command} {no ip ospf cost} {}
471Set link cost for the specified interface. The cost value is set to router-LSA's
472metric field and used for SPF calculation.
473@end deffn
474
475@deffn {Interface Command} {ip ospf dead-interval <1-65535>} {}
paule5b308d2005-10-29 20:19:49 +0000476@deffnx {Interface Command} {ip ospf dead-interval minimal hello-multiplier <2-20>} {}
paul718e3742002-12-13 20:15:29 +0000477@deffnx {Interface Command} {no ip ospf dead-interval} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000478@anchor{ip ospf dead-interval minimal} Set number of seconds for
479RouterDeadInterval timer value used for Wait Timer and Inactivity
480Timer. This value must be the same for all routers attached to a
481common network. The default value is 40 seconds.
paule5b308d2005-10-29 20:19:49 +0000482
483If 'minimal' is specified instead, then the dead-interval is set to 1
484second and one must specify a hello-multiplier. The hello-multiplier
485specifies how many Hellos to send per second, from 2 (every 500ms) to
48620 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form
487is specified, then the hello-interval advertised in Hello packets is set to
4880 and the hello-interval on received Hello packets is not checked, thus
489the hello-multiplier need NOT be the same across multiple routers on a common
490link.
paul718e3742002-12-13 20:15:29 +0000491@end deffn
492
493@deffn {Interface Command} {ip ospf hello-interval <1-65535>} {}
494@deffnx {Interface Command} {no ip ospf hello-interval} {}
495Set number of seconds for HelloInterval timer value. Setting this value,
496Hello packet will be sent every timer value seconds on the specified interface.
497This value must be the same for all routers attached to a common network.
498The default value is 10 seconds.
paule5b308d2005-10-29 20:19:49 +0000499
500This command has no effect if @ref{ip ospf dead-interval minimal} is also
501specified for the interface.
paul718e3742002-12-13 20:15:29 +0000502@end deffn
503
504@deffn {Interface Command} {ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)} {}
505@deffnx {Interface Command} {no ip ospf network} {}
506Set explicitly network type for specifed interface.
507@end deffn
508
509@deffn {Interface Command} {ip ospf priority <0-255>} {}
510@deffnx {Interface Command} {no ip ospf priority} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +0000511Set RouterPriority integer value. The router with the highest priority
512will be more eligible to become Designated Router. Setting the value
513to 0, makes the router ineligible to become Designated Router. The
514default value is 1.
paul718e3742002-12-13 20:15:29 +0000515@end deffn
516
517@deffn {Interface Command} {ip ospf retransmit-interval <1-65535>} {}
518@deffnx {Interface Command} {no ip ospf retransmit interval} {}
519Set number of seconds for RxmtInterval timer value. This value is used
520when retransmitting Database Description and Link State Request packets.
521The default value is 5 seconds.
522@end deffn
523
524@deffn {Interface Command} {ip ospf transmit-delay} {}
525@deffnx {Interface Command} {no ip ospf transmit-delay} {}
526Set number of seconds for InfTransDelay value. LSAs' age should be
527incremented by this value when transmitting.
528The default value is 1 seconds.
529@end deffn
530
paul76b89b42004-11-06 17:13:09 +0000531@node Redistribute routes to OSPF
paul718e3742002-12-13 20:15:29 +0000532@section Redistribute routes to OSPF
533
534@deffn {OSPF Command} {redistribute (kernel|connected|static|rip|bgp)} {}
535@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) @var{route-map}} {}
536@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)} {}
537@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map @var{word}} {}
538@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>} {}
539@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map @var{word}} {}
540@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>} {}
541@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map @var{word}} {}
542@deffnx {OSPF Command} {no redistribute (kernel|connected|static|rip|bgp)} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000543@anchor{OSPF redistribute}Redistribute routes of the specified protocol
544or kind into OSPF, with the metric type and metric set if specified,
545filtering the routes using the given route-map if specified.
546Redistributed routes may also be filtered with distribute-lists, see
547@ref{ospf distribute-list}.
Paul Jakmaf912cb42006-07-27 23:30:16 +0000548
549Redistributed routes are distributed as into OSPF as Type-5 External
550LSAs into links to areas that accept external routes, Type-7 External LSAs
551for NSSA areas and are not redistributed at all into Stub areas, where
552external routes are not permitted.
553
554Note that for connected routes, one may instead use
555@dfn{passive-interface}, see @ref{OSPF passive-interface}.
paul718e3742002-12-13 20:15:29 +0000556@end deffn
557
558@deffn {OSPF Command} {default-information originate} {}
559@deffnx {OSPF Command} {default-information originate metric <0-16777214>} {}
560@deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2)} {}
561@deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
562@deffnx {OSPF Command} {default-information originate always} {}
563@deffnx {OSPF Command} {default-information originate always metric <0-16777214>} {}
564@deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2)} {}
565@deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
566@deffnx {OSPF Command} {no default-information originate} {}
paule5b308d2005-10-29 20:19:49 +0000567Originate an AS-External (type-5) LSA describing a default route into
568all external-routing capable areas, of the specified metric and metric
569type. If the 'always' keyword is given then the default is always
570advertised, even when there is no default present in the routing table.
paul718e3742002-12-13 20:15:29 +0000571@end deffn
572
573@deffn {OSPF Command} {distribute-list NAME out (kernel|connected|static|rip|ospf} {}
574@deffnx {OSPF Command} {no distribute-list NAME out (kernel|connected|static|rip|ospf} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000575@anchor{ospf distribute-list}Apply the access-list filter, NAME, to
576redistributed routes of the given type before allowing the routes to
577redistributed into OSPF (@pxref{OSPF redistribute}).
paul718e3742002-12-13 20:15:29 +0000578@end deffn
579
580@deffn {OSPF Command} {default-metric <0-16777214>} {}
581@deffnx {OSPF Command} {no default-metric} {}
582@end deffn
583
584@deffn {OSPF Command} {distance <1-255>} {}
585@deffnx {OSPF Command} {no distance <1-255>} {}
586@end deffn
587
588@deffn {OSPF Command} {distance ospf (intra-area|inter-area|external) <1-255>} {}
589@deffnx {OSPF Command} {no distance ospf} {}
590@end deffn
591
paul76b89b42004-11-06 17:13:09 +0000592@node Showing OSPF information
paul718e3742002-12-13 20:15:29 +0000593@section Showing OSPF information
594
595@deffn {Command} {show ip ospf} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000596@anchor{show ip ospf}Show information on a variety of general OSPF and
597area state and configuration information.
paul718e3742002-12-13 20:15:29 +0000598@end deffn
599
600@deffn {Command} {show ip ospf interface [INTERFACE]} {}
paule5b308d2005-10-29 20:19:49 +0000601Show state and configuration of OSPF the specified interface, or all
602interfaces if no interface is given.
paul718e3742002-12-13 20:15:29 +0000603@end deffn
604
605@deffn {Command} {show ip ospf neighbor} {}
606@deffnx {Command} {show ip ospf neighbor INTERFACE} {}
607@deffnx {Command} {show ip ospf neighbor detail} {}
608@deffnx {Command} {show ip ospf neighbor INTERFACE detail} {}
609@end deffn
610
611@deffn {Command} {show ip ospf database} {}
612@end deffn
613
614@deffn {Command} {show ip ospf database (asbr-summary|external|network|router|summary)} {}
615@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id}} {}
616@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} adv-router @var{adv-router}} {}
617@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) adv-router @var{adv-router}} {}
618@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} self-originate} {}
619@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) self-originate} {}
620@end deffn
621
622@deffn {Command} {show ip ospf database max-age} {}
623@end deffn
624
625@deffn {Command} {show ip ospf database self-originate} {}
626@end deffn
627
paul718e3742002-12-13 20:15:29 +0000628@deffn {Command} {show ip ospf route} {}
paule5b308d2005-10-29 20:19:49 +0000629Show the OSPF routing table, as determined by the most recent SPF calculation.
paul718e3742002-12-13 20:15:29 +0000630@end deffn
631
paul76b89b42004-11-06 17:13:09 +0000632@node Debugging OSPF
paul718e3742002-12-13 20:15:29 +0000633@section Debugging OSPF
634
635@deffn {Command} {debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
636@deffnx {Command} {no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
637@end deffn
638
639@deffn {Command} {debug ospf ism} {}
640@deffnx {Command} {debug ospf ism (status|events|timers)} {}
641@deffnx {Command} {no debug ospf ism} {}
642@deffnx {Command} {no debug ospf ism (status|events|timers)} {}
643@end deffn
644
645@deffn {Command} {debug ospf nsm} {}
646@deffnx {Command} {debug ospf nsm (status|events|timers)} {}
647@deffnx {Command} {no debug ospf nsm} {}
648@deffnx {Command} {no debug ospf nsm (status|events|timers)} {}
649@end deffn
650
651@deffn {Command} {debug ospf lsa} {}
652@deffnx {Command} {debug ospf lsa (generate|flooding|refresh)} {}
653@deffnx {Command} {no debug ospf lsa} {}
654@deffnx {Command} {no debug ospf lsa (generate|flooding|refresh)} {}
655@end deffn
656
657@deffn {Command} {debug ospf zebra} {}
658@deffnx {Command} {debug ospf zebra (interface|redistribute)} {}
659@deffnx {Command} {no debug ospf zebra} {}
660@deffnx {Command} {no debug ospf zebra (interface|redistribute)} {}
661@end deffn
662
663@deffn {Command} {show debugging ospf} {}
664@end deffn
665
paule5b308d2005-10-29 20:19:49 +0000666@node OSPF Configuration Examples
667@section OSPF Configuration Examples
668A simple example, with MD5 authentication enabled:
669
670@example
671@group
672!
673interface bge0
674 ip ospf authentication message-digest
675 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
676!
677router ospf
678 network 192.168.0.0/16 area 0.0.0.1
679 area 0.0.0.1 authentication message-digest
680@end group
681@end example
682
683An @acronym{ABR} router, with MD5 authentication and performing summarisation
684of networks between the areas:
685
686@example
687@group
688!
689password ABCDEF
690log file /var/log/quagga/ospfd.log
691service advanced-vty
692!
693interface eth0
694 ip ospf authentication message-digest
695 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
696!
697interface ppp0
698!
699interface br0
700 ip ospf authentication message-digest
701 ip ospf message-digest-key 2 md5 XYZ12345
702!
703router ospf
704 ospf router-id 192.168.0.1
705 redistribute connected
706 passive interface ppp0
707 network 192.168.0.0/24 area 0.0.0.0
708 network 10.0.0.0/16 area 0.0.0.0
709 network 192.168.1.0/24 area 0.0.0.1
710 area 0.0.0.0 authentication message-digest
711 area 0.0.0.0 range 10.0.0.0/16
712 area 0.0.0.0 range 192.168.0.0/24
713 area 0.0.0.1 authentication message-digest
714 area 0.0.0.1 range 10.2.0.0/16
715!
716@end group
717@end example