blob: 7ddc9db8e9d4de8eab8163cf5911d20bfc609554 [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
14* Configuring ospfd::
15* OSPF router::
16* OSPF area::
17* OSPF interface::
18* Redistribute routes to OSPF::
19* Showing OSPF information::
20* Debugging OSPF::
paule5b308d2005-10-29 20:19:49 +000021* OSPF Configuration Examples::
paul718e3742002-12-13 20:15:29 +000022@end menu
23
paul76b89b42004-11-06 17:13:09 +000024@node Configuring ospfd
paul718e3742002-12-13 20:15:29 +000025@section Configuring ospfd
26
paule5b308d2005-10-29 20:19:49 +000027There are no @command{ospfd} specific options. Common options can be
paul718e3742002-12-13 20:15:29 +000028specified (@pxref{Common Invocation Options}) to @command{ospfd}.
paule5b308d2005-10-29 20:19:49 +000029@command{ospfd} needs to acquire interface information from
30@command{zebra} in order to function. Therefore @command{zebra} must be
31running before invoking @command{ospfd}. Also, if @command{zebra} is
32restarted then @command{ospfd} must be too.
paul718e3742002-12-13 20:15:29 +000033
paule5b308d2005-10-29 20:19:49 +000034Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
paul718e3742002-12-13 20:15:29 +000035specific configuration file @file{ospfd.conf}.
36
paul76b89b42004-11-06 17:13:09 +000037@node OSPF router
paul718e3742002-12-13 20:15:29 +000038@section OSPF router
39
40To start OSPF process you have to specify the OSPF router. As of this
41writing, @command{ospfd} does not support multiple OSPF processes.
42
43@deffn Command {router ospf} {}
44@deffnx Command {no router ospf} {}
45Enable or disable the OSPF process. @command{ospfd} does not yet
46support multiple OSPF processes. So you can not specify an OSPF process
47number.
48@end deffn
49
50@deffn {OSPF Command} {ospf router-id @var{a.b.c.d}} {}
51@deffnx {OSPF Command} {no ospf router-id} {}
Paul Jakmac3eab602006-07-28 04:42:39 +000052@anchor{ospf router-id}This sets the router-ID of the OSPF process. The
53router-ID may be an IP address of the router, but need not be - it can
54be any arbitrary 32bit number. However it MUST be unique within the
55entire OSPF domain to the OSPF speaker - bad things will happen if
56multiple OSPF speakers are configured with the same router-ID! If one
57is not specified then @command{ospfd} will obtain a router-ID
58automatically from @command{zebra}.
paul718e3742002-12-13 20:15:29 +000059@end deffn
60
61@deffn {OSPF Command} {ospf abr-type @var{type}} {}
62@deffnx {OSPF Command} {no ospf abr-type @var{type}} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +000063@var{type} can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
64are equivalent.
65
66The OSPF standard for ABR behaviour does not allow an ABR to consider
67routes through non-backbone areas when its links to the backbone are
68down, even when there are other ABRs in attached non-backbone areas
69which still can reach the backbone - this restriction exists primarily
70to ensure routing-loops are avoided.
71
72With the "Cisco" or "IBM" ABR type, the default in this release of
73Quagga, this restriction is lifted, allowing an ABR to consider
74summaries learnt from other ABRs through non-backbone areas, and hence
75route via non-backbone areas as a last resort when, and only when,
76backbone links are down.
77
78Note that areas with fully-adjacent virtual-links are considered to be
79"transit capable" and can always be used to route backbone traffic, and
80hence are unaffected by this setting (@pxref{OSPF virtual-link}).
paule5b308d2005-10-29 20:19:49 +000081
pauld4f50312003-01-22 19:26:00 +000082More information regarding the behaviour controlled by this command can
paule5b308d2005-10-29 20:19:49 +000083be found in @cite{RFC 3509, Alternative Implementations of OSPF Area
84Border Routers}, and @cite{draft-ietf-ospf-shortcut-abr-02.txt}.
85
86Quote: "Though the definition of the @acronym{ABR,Area Border Router}
pauld4f50312003-01-22 19:26:00 +000087in the OSPF specification does not require a router with multiple
88attached areas to have a backbone connection, it is actually
89necessary to provide successful routing to the inter-area and
90external destinations. If this requirement is not met, all traffic
91destined for the areas not connected to such an ABR or out of the
92OSPF domain, is dropped. This document describes alternative ABR
93behaviors implemented in Cisco and IBM routers."
paul718e3742002-12-13 20:15:29 +000094@end deffn
95
96@deffn {OSPF Command} {ospf rfc1583compatibility} {}
97@deffnx {OSPF Command} {no ospf rfc1583compatibility} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +000098@cite{RFC2328}, the sucessor to @cite{RFC1583}, suggests according
paule5b308d2005-10-29 20:19:49 +000099to section G.2 (changes) in section 16.4 a change to the path
100preference algorithm that prevents possible routing loops that were
101possible in the old version of OSPFv2. More specifically it demands
Alexandre Chappuis37075da2011-09-13 16:33:45 +0400102that inter-area paths and intra-area backbone path are now of equal preference
paule5b308d2005-10-29 20:19:49 +0000103but still both preferred to external paths.
104
105This command should NOT be set normally.
paul718e3742002-12-13 20:15:29 +0000106@end deffn
107
Andrew J. Schorrd7e60dd2006-06-29 20:20:52 +0000108@deffn {OSPF Command} {log-adjacency-changes [detail]} {}
109@deffnx {OSPF Command} {no log-adjacency-changes [detail]} {}
110Configures ospfd to log changes in adjacency. With the optional
111detail argument, all changes in adjacency status are shown. Without detail,
112only changes to full or regressions are shown.
113@end deffn
114
Paul Jakmaf912cb42006-07-27 23:30:16 +0000115@deffn {OSPF Command} {passive-interface @var{interface}} {}
116@deffnx {OSPF Command} {no passive-interface @var{interface}} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000117@anchor{OSPF passive-interface} Do not speak OSPF interface on the
118given interface, but do advertise the interface as a stub link in the
119router-@acronym{LSA,Link State Advertisement} for this router. This
120allows one to advertise addresses on such connected interfaces without
121having to originate AS-External/Type-5 LSAs (which have global flooding
122scope) - as would occur if connected addresses were redistributed into
123OSPF (@pxref{Redistribute routes to OSPF})@. This is the only way to
124advertise non-OSPF links into stub areas.
paul718e3742002-12-13 20:15:29 +0000125@end deffn
126
paule5b308d2005-10-29 20:19:49 +0000127@deffn {OSPF Command} {timers throttle spf @var{delay} @var{initial-holdtime} @var{max-holdtime}} {}
128@deffnx {OSPF Command} {no timers throttle spf} {}
129This command sets the initial @var{delay}, the @var{initial-holdtime}
130and the @var{maximum-holdtime} between when SPF is calculated and the
131event which triggered the calculation. The times are specified in
132milliseconds and must be in the range of 0 to 600000 milliseconds.
133
134The @var{delay} specifies the minimum amount of time to delay SPF
135calculation (hence it affects how long SPF calculation is delayed after
136an event which occurs outside of the holdtime of any previous SPF
137calculation, and also serves as a minimum holdtime).
138
139Consecutive SPF calculations will always be seperated by at least
140'hold-time' milliseconds. The hold-time is adaptive and initially is
141set to the @var{initial-holdtime} configured with the above command.
142Events which occur within the holdtime of the previous SPF calculation
143will cause the holdtime to be increased by @var{initial-holdtime}, bounded
144by the @var{maximum-holdtime} configured with this command. If the adaptive
145hold-time elapses without any SPF-triggering event occuring then
146the current holdtime is reset to the @var{initial-holdtime}. The current
147holdtime can be viewed with @ref{show ip ospf}, where it is expressed as
148a multiplier of the @var{initial-holdtime}.
149
150@example
151@group
152router ospf
153 timers throttle spf 200 400 10000
154@end group
155@end example
156
157In this example, the @var{delay} is set to 200ms, the @var{initial
158holdtime} is set to 400ms and the @var{maximum holdtime} to 10s. Hence
159there will always be at least 200ms between an event which requires SPF
160calculation and the actual SPF calculation. Further consecutive SPF
161calculations will always be seperated by between 400ms to 10s, the
162hold-time increasing by 400ms each time an SPF-triggering event occurs
163within the hold-time of the previous SPF calculation.
164
165This command supercedes the @command{timers spf} command in previous Quagga
166releases.
paul718e3742002-12-13 20:15:29 +0000167@end deffn
168
paule5b308d2005-10-29 20:19:49 +0000169@deffn {OSPF Command} {max-metric router-lsa [on-startup|on-shutdown] <5-86400>} {}
170@deffnx {OSPF Command} {max-metric router-lsa administrative} {}
171@deffnx {OSPF Command} {no max-metric router-lsa [on-startup|on-shutdown|administrative]} {}
172This enables @cite{RFC3137, OSPF Stub Router Advertisement} support,
173where the OSPF process describes its transit links in its router-LSA as
174having infinite distance so that other routers will avoid calculating
175transit paths through the router while still being able to reach
176networks through the router.
177
178This support may be enabled administratively (and indefinitely) or
179conditionally. Conditional enabling of max-metric router-lsas can be
180for a period of seconds after startup and/or for a period of seconds
181prior to shutdown.
182
183Enabling this for a period after startup allows OSPF to converge fully
184first without affecting any existing routes used by other routers,
185while still allowing any connected stub links and/or redistributed
186routes to be reachable. Enabling this for a period of time in advance
187of shutdown allows the router to gracefully excuse itself from the OSPF
188domain.
189
190Enabling this feature administratively allows for administrative
191intervention for whatever reason, for an indefinite period of time.
192Note that if the configuration is written to file, this administrative
193form of the stub-router command will also be written to file. If
194@command{ospfd} is restarted later, the command will then take effect
195until manually deconfigured.
196
197Configured state of this feature as well as current status, such as the
198number of second remaining till on-startup or on-shutdown ends, can be
199viewed with the @ref{show ip ospf} command.
paul718e3742002-12-13 20:15:29 +0000200@end deffn
201
paule5b308d2005-10-29 20:19:49 +0000202@deffn {OSPF Command} {auto-cost reference-bandwidth <1-4294967>} {}
203@deffnx {OSPF Command} {no auto-cost reference-bandwidth} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000204@anchor{OSPF auto-cost reference-bandwidth}This sets the reference
205bandwidth for cost calculations, where this bandwidth is considered
206equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
207100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
208cost of 1. Cost of lower bandwidth links will be scaled with reference
209to this cost).
paule5b308d2005-10-29 20:19:49 +0000210
211This configuration setting MUST be consistent across all routers within the
212OSPF domain.
paul718e3742002-12-13 20:15:29 +0000213@end deffn
214
215@deffn {OSPF Command} {network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
216@deffnx {OSPF Command} {network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
217@deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
218@deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
Paul Jakma8a667cf2009-08-27 16:51:42 +0100219@anchor{OSPF network command}
hassoa5b2b592004-04-17 10:09:29 +0000220This command specifies the OSPF enabled interface(s). If the interface has
221an address from range 192.168.1.0/24 then the command below enables ospf
222on this interface so router can provide network information to the other
223ospf routers via this interface.
paule5b308d2005-10-29 20:19:49 +0000224
paul718e3742002-12-13 20:15:29 +0000225@example
226@group
227router ospf
hassoa5b2b592004-04-17 10:09:29 +0000228 network 192.168.1.0/24 area 0.0.0.0
paul718e3742002-12-13 20:15:29 +0000229@end group
230@end example
paule5b308d2005-10-29 20:19:49 +0000231
hassoa5b2b592004-04-17 10:09:29 +0000232Prefix length in interface must be equal or bigger (ie. smaller network) than
233prefix length in network statement. For example statement above doesn't enable
234ospf on interface with address 192.168.1.1/23, but it does on interface with
235address 192.168.1.129/25.
Andrew J. Schorrf0ec8322007-04-30 16:52:05 +0000236
237Note that the behavior when there is a peer address
238defined on an interface changed after release 0.99.7.
239Currently, if a peer prefix has been configured,
240then we test whether the prefix in the network command contains
241the destination prefix. Otherwise, we test whether the network command prefix
242contains the local address prefix of the interface.
Paul Jakma8a667cf2009-08-27 16:51:42 +0100243
244In some cases it may be more convenient to enable OSPF on a per
245interface/subnet basis (@pxref{OSPF ip ospf area command}).
246
paul718e3742002-12-13 20:15:29 +0000247@end deffn
248
paul76b89b42004-11-06 17:13:09 +0000249@node OSPF area
paul718e3742002-12-13 20:15:29 +0000250@section OSPF area
251
252@deffn {OSPF Command} {area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
253@deffnx {OSPF Command} {area <0-4294967295> range @var{a.b.c.d/m}} {}
254@deffnx {OSPF Command} {no area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
255@deffnx {OSPF Command} {no area <0-4294967295> range @var{a.b.c.d/m}} {}
hasso63869f12004-04-19 14:43:46 +0000256Summarize intra area paths from specified area into one Type-3 summary-LSA
257announced to other areas. This command can be used only in ABR and ONLY
258router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
259be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
260Summarizing Type-7 AS-external-LSAs isn't supported yet by Quagga.
paule5b308d2005-10-29 20:19:49 +0000261
hasso63869f12004-04-19 14:43:46 +0000262@example
263@group
264router ospf
265 network 192.168.1.0/24 area 0.0.0.0
266 network 10.0.0.0/8 area 0.0.0.10
267 area 0.0.0.10 range 10.0.0.0/8
268@end group
269@end example
paule5b308d2005-10-29 20:19:49 +0000270
hasso63869f12004-04-19 14:43:46 +0000271With configuration above one Type-3 Summary-LSA with routing info 10.0.0.0/8 is
272announced into backbone area if area 0.0.0.10 contains at least one intra-area
273network (ie. described with router or network LSA) from this range.
paul718e3742002-12-13 20:15:29 +0000274@end deffn
275
hasso63869f12004-04-19 14:43:46 +0000276@deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
277@deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
278Instead of summarizing intra area paths filter them - ie. intra area paths from this
279range are not advertised into other areas.
280This command makes sense in ABR only.
281@end deffn
282
hasso6b3fac02004-04-20 04:11:36 +0000283@deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
paul718e3742002-12-13 20:15:29 +0000284@deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
hasso63869f12004-04-19 14:43:46 +0000285Substitute summarized prefix with another prefix.
paule5b308d2005-10-29 20:19:49 +0000286
hasso63869f12004-04-19 14:43:46 +0000287@example
288@group
289router ospf
290 network 192.168.1.0/24 area 0.0.0.0
291 network 10.0.0.0/8 area 0.0.0.10
292 area 0.0.0.10 range 10.0.0.0/8 substitute 11.0.0.0/8
293@end group
294@end example
paule5b308d2005-10-29 20:19:49 +0000295
hasso63869f12004-04-19 14:43:46 +0000296One Type-3 summary-LSA with routing info 11.0.0.0/8 is announced into backbone area if
297area 0.0.0.10 contains at least one intra-area network (ie. described with router-LSA or
298network-LSA) from range 10.0.0.0/8.
299This command makes sense in ABR only.
paul718e3742002-12-13 20:15:29 +0000300@end deffn
301
302@deffn {OSPF Command} {area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
303@deffnx {OSPF Command} {area <0-4294967295> virtual-link @var{a.b.c.d}} {}
304@deffnx {OSPF Command} {no area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
305@deffnx {OSPF Command} {no area <0-4294967295> virtual-link @var{a.b.c.d}} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000306@anchor{OSPF virtual-link}
paul718e3742002-12-13 20:15:29 +0000307@end deffn
308
309@deffn {OSPF Command} {area @var{a.b.c.d} shortcut} {}
310@deffnx {OSPF Command} {area <0-4294967295> shortcut} {}
311@deffnx {OSPF Command} {no area @var{a.b.c.d} shortcut} {}
312@deffnx {OSPF Command} {no area <0-4294967295> shortcut} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +0000313Configure the area as Shortcut capable. See @cite{RFC3509}. This requires
paule5b308d2005-10-29 20:19:49 +0000314that the 'abr-type' be set to 'shortcut'.
paul718e3742002-12-13 20:15:29 +0000315@end deffn
316
317@deffn {OSPF Command} {area @var{a.b.c.d} stub} {}
318@deffnx {OSPF Command} {area <0-4294967295> stub} {}
319@deffnx {OSPF Command} {no area @var{a.b.c.d} stub} {}
320@deffnx {OSPF Command} {no area <0-4294967295> stub} {}
paule5b308d2005-10-29 20:19:49 +0000321Configure the area to be a stub area. That is, an area where no router
322originates routes external to OSPF and hence an area where all external
323routes are via the ABR(s). Hence, ABRs for such an area do not need
324to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
325area. They need only pass Network-Summary (type-3) LSAs into such an area,
Paul Jakmaf912cb42006-07-27 23:30:16 +0000326along with a default-route summary.
paul718e3742002-12-13 20:15:29 +0000327@end deffn
328
329@deffn {OSPF Command} {area @var{a.b.c.d} stub no-summary} {}
330@deffnx {OSPF Command} {area <0-4294967295> stub no-summary} {}
331@deffnx {OSPF Command} {no area @var{a.b.c.d} stub no-summary} {}
332@deffnx {OSPF Command} {no area <0-4294967295> stub no-summary} {}
paule5b308d2005-10-29 20:19:49 +0000333Prevents an @command{ospfd} ABR from injecting inter-area
334summaries into the specified stub area.
paul718e3742002-12-13 20:15:29 +0000335@end deffn
336
337@deffn {OSPF Command} {area @var{a.b.c.d} default-cost <0-16777215>} {}
338@deffnx {OSPF Command} {no area @var{a.b.c.d} default-cost <0-16777215>} {}
paule5b308d2005-10-29 20:19:49 +0000339Set the cost of default-summary LSAs announced to stubby areas.
paul718e3742002-12-13 20:15:29 +0000340@end deffn
341
342@deffn {OSPF Command} {area @var{a.b.c.d} export-list NAME} {}
343@deffnx {OSPF Command} {area <0-4294967295> export-list NAME} {}
344@deffnx {OSPF Command} {no area @var{a.b.c.d} export-list NAME} {}
345@deffnx {OSPF Command} {no area <0-4294967295> export-list NAME} {}
hasso63869f12004-04-19 14:43:46 +0000346Filter Type-3 summary-LSAs announced to other areas originated from intra-
347area paths from specified area.
paule5b308d2005-10-29 20:19:49 +0000348
hasso63869f12004-04-19 14:43:46 +0000349@example
350@group
351router ospf
352 network 192.168.1.0/24 area 0.0.0.0
353 network 10.0.0.0/8 area 0.0.0.10
354 area 0.0.0.10 export-list foo
355!
356access-list foo permit 10.10.0.0/16
357access-list foo deny any
358@end group
359@end example
paule5b308d2005-10-29 20:19:49 +0000360
hasso63869f12004-04-19 14:43:46 +0000361With example above any intra-area paths from area 0.0.0.10 and from range
36210.10.0.0/16 (for example 10.10.1.0/24 and 10.10.2.128/30) are announced into
363other areas as Type-3 summary-LSA's, but any others (for example 10.11.0.0/16
364or 10.128.30.16/30) aren't.
paule5b308d2005-10-29 20:19:49 +0000365
366This command is only relevant if the router is an ABR for the specified
367area.
paul718e3742002-12-13 20:15:29 +0000368@end deffn
369
370@deffn {OSPF Command} {area @var{a.b.c.d} import-list NAME} {}
371@deffnx {OSPF Command} {area <0-4294967295> import-list NAME} {}
372@deffnx {OSPF Command} {no area @var{a.b.c.d} import-list NAME} {}
373@deffnx {OSPF Command} {no area <0-4294967295> import-list NAME} {}
hasso63869f12004-04-19 14:43:46 +0000374Same as export-list, but it applies to paths announced into specified area as
375Type-3 summary-LSAs.
376@end deffn
377
hasso808c0a72004-04-19 15:10:20 +0000378@deffn {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME in} {}
379@deffnx {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME out} {}
380@deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME in} {}
381@deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME out} {}
382@deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME in} {}
383@deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME out} {}
384@deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME in} {}
385@deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME out} {}
hassoc266ac72004-04-19 17:31:00 +0000386Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
387makes sense in ABR only.
paul718e3742002-12-13 20:15:29 +0000388@end deffn
389
390@deffn {OSPF Command} {area @var{a.b.c.d} authentication} {}
391@deffnx {OSPF Command} {area <0-4294967295> authentication} {}
392@deffnx {OSPF Command} {no area @var{a.b.c.d} authentication} {}
393@deffnx {OSPF Command} {no area <0-4294967295> authentication} {}
paule5b308d2005-10-29 20:19:49 +0000394Specify that simple password authentication should be used for the given
395area.
paul718e3742002-12-13 20:15:29 +0000396@end deffn
397
398@deffn {OSPF Command} {area @var{a.b.c.d} authentication message-digest} {}
399@deffnx {OSPF Command} {area <0-4294967295> authentication message-digest} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000400
401@anchor{area authentication message-digest}Specify that OSPF packets
402must be authenticated with MD5 HMACs within the given area. Keying
403material must also be configured on a per-interface basis (@pxref{ip
404ospf message-digest-key}).
405
406MD5 authentication may also be configured on a per-interface basis
407(@pxref{ip ospf authentication message-digest}). Such per-interface
408settings will override any per-area authentication setting.
paul718e3742002-12-13 20:15:29 +0000409@end deffn
410
paul76b89b42004-11-06 17:13:09 +0000411@node OSPF interface
paul718e3742002-12-13 20:15:29 +0000412@section OSPF interface
413
Paul Jakma8a667cf2009-08-27 16:51:42 +0100414@deffn {Interface Command} {ip ospf area @var{AREA} [@var{ADDR}]} {}
415@deffnx {Interface Command} {no ip ospf area [@var{ADDR}]} {}
416@anchor{OSPF ip ospf area command}
417
418Enable OSPF on the interface, optionally restricted to just the IP address
419given by @var{ADDR}, putting it in the @var{AREA} area. Per interface area
420settings take precedence to network commands (@pxref{OSPF network command}).
421
422If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
423via this command may result in a slight performance improvement.
424
425@end deffn
426
paule5b308d2005-10-29 20:19:49 +0000427@deffn {Interface Command} {ip ospf authentication-key @var{AUTH_KEY}} {}
paul718e3742002-12-13 20:15:29 +0000428@deffnx {Interface Command} {no ip ospf authentication-key} {}
429Set OSPF authentication key to a simple password. After setting @var{AUTH_KEY},
430all OSPF packets are authenticated. @var{AUTH_KEY} has length up to 8 chars.
Paul Jakmaf912cb42006-07-27 23:30:16 +0000431
432Simple text password authentication is insecure and deprecated in favour of
Paul Jakmac3eab602006-07-28 04:42:39 +0000433MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
paul718e3742002-12-13 20:15:29 +0000434@end deffn
435
Paul Jakmac3eab602006-07-28 04:42:39 +0000436@deffn {Interface Command} {ip ospf authentication message-digest} {}
437@anchor{ip ospf authentication message-digest}Specify that MD5 HMAC
438authentication must be used on this interface. MD5 keying material must
439also be configured (@pxref{ip ospf message-digest-key}). Overrides any
440authentication enabled on a per-area basis (@pxref{area
441authentication message-digest}).
paule2ea9fe2004-10-11 14:33:23 +0000442
443Note that OSPF MD5 authentication requires that time never go backwards
paule5b308d2005-10-29 20:19:49 +0000444(correct time is NOT important, only that it never goes backwards), even
paule2ea9fe2004-10-11 14:33:23 +0000445across resets, if ospfd is to be able to promptly reestabish adjacencies
446with its neighbours after restarts/reboots. The host should have system
Paul Jakma466c9652006-06-26 12:55:58 +0000447time be set at boot from an external or non-volatile source (eg battery backed clock, NTP,
paule2ea9fe2004-10-11 14:33:23 +0000448etc.) or else the system clock should be periodically saved to non-volative
449storage and restored at boot if MD5 authentication is to be expected to work
450reliably.
paul718e3742002-12-13 20:15:29 +0000451@end deffn
452
Paul Jakmac3eab602006-07-28 04:42:39 +0000453@deffn {Interface Command} {ip ospf message-digest-key KEYID md5 KEY} {}
454@deffnx {Interface Command} {no ip ospf message-digest-key} {}
455@anchor{ip ospf message-digest-key}Set OSPF authentication key to a
456cryptographic password. The cryptographic algorithm is MD5.
457
458KEYID identifies secret key used to create the message digest. This ID
459is part of the protocol and must be consistent across routers on a
460link.
461
462KEY is the actual message digest key, of up to 16 chars (larger strings
463will be truncated), and is associated with the given KEYID.
464@end deffn
465
paul718e3742002-12-13 20:15:29 +0000466@deffn {Interface Command} {ip ospf cost <1-65535>} {}
467@deffnx {Interface Command} {no ip ospf cost} {}
468Set link cost for the specified interface. The cost value is set to router-LSA's
469metric field and used for SPF calculation.
470@end deffn
471
472@deffn {Interface Command} {ip ospf dead-interval <1-65535>} {}
paule5b308d2005-10-29 20:19:49 +0000473@deffnx {Interface Command} {ip ospf dead-interval minimal hello-multiplier <2-20>} {}
paul718e3742002-12-13 20:15:29 +0000474@deffnx {Interface Command} {no ip ospf dead-interval} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000475@anchor{ip ospf dead-interval minimal} Set number of seconds for
476RouterDeadInterval timer value used for Wait Timer and Inactivity
477Timer. This value must be the same for all routers attached to a
478common network. The default value is 40 seconds.
paule5b308d2005-10-29 20:19:49 +0000479
480If 'minimal' is specified instead, then the dead-interval is set to 1
481second and one must specify a hello-multiplier. The hello-multiplier
482specifies how many Hellos to send per second, from 2 (every 500ms) to
48320 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form
484is specified, then the hello-interval advertised in Hello packets is set to
4850 and the hello-interval on received Hello packets is not checked, thus
486the hello-multiplier need NOT be the same across multiple routers on a common
487link.
paul718e3742002-12-13 20:15:29 +0000488@end deffn
489
490@deffn {Interface Command} {ip ospf hello-interval <1-65535>} {}
491@deffnx {Interface Command} {no ip ospf hello-interval} {}
492Set number of seconds for HelloInterval timer value. Setting this value,
493Hello packet will be sent every timer value seconds on the specified interface.
494This value must be the same for all routers attached to a common network.
495The default value is 10 seconds.
paule5b308d2005-10-29 20:19:49 +0000496
497This command has no effect if @ref{ip ospf dead-interval minimal} is also
498specified for the interface.
paul718e3742002-12-13 20:15:29 +0000499@end deffn
500
501@deffn {Interface Command} {ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)} {}
502@deffnx {Interface Command} {no ip ospf network} {}
503Set explicitly network type for specifed interface.
504@end deffn
505
506@deffn {Interface Command} {ip ospf priority <0-255>} {}
507@deffnx {Interface Command} {no ip ospf priority} {}
Paul Jakmaf912cb42006-07-27 23:30:16 +0000508Set RouterPriority integer value. The router with the highest priority
509will be more eligible to become Designated Router. Setting the value
510to 0, makes the router ineligible to become Designated Router. The
511default value is 1.
paul718e3742002-12-13 20:15:29 +0000512@end deffn
513
514@deffn {Interface Command} {ip ospf retransmit-interval <1-65535>} {}
515@deffnx {Interface Command} {no ip ospf retransmit interval} {}
516Set number of seconds for RxmtInterval timer value. This value is used
517when retransmitting Database Description and Link State Request packets.
518The default value is 5 seconds.
519@end deffn
520
521@deffn {Interface Command} {ip ospf transmit-delay} {}
522@deffnx {Interface Command} {no ip ospf transmit-delay} {}
523Set number of seconds for InfTransDelay value. LSAs' age should be
524incremented by this value when transmitting.
525The default value is 1 seconds.
526@end deffn
527
paul76b89b42004-11-06 17:13:09 +0000528@node Redistribute routes to OSPF
paul718e3742002-12-13 20:15:29 +0000529@section Redistribute routes to OSPF
530
531@deffn {OSPF Command} {redistribute (kernel|connected|static|rip|bgp)} {}
532@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) @var{route-map}} {}
533@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)} {}
534@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map @var{word}} {}
535@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>} {}
536@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map @var{word}} {}
537@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>} {}
538@deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map @var{word}} {}
539@deffnx {OSPF Command} {no redistribute (kernel|connected|static|rip|bgp)} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000540@anchor{OSPF redistribute}Redistribute routes of the specified protocol
541or kind into OSPF, with the metric type and metric set if specified,
542filtering the routes using the given route-map if specified.
543Redistributed routes may also be filtered with distribute-lists, see
544@ref{ospf distribute-list}.
Paul Jakmaf912cb42006-07-27 23:30:16 +0000545
546Redistributed routes are distributed as into OSPF as Type-5 External
547LSAs into links to areas that accept external routes, Type-7 External LSAs
548for NSSA areas and are not redistributed at all into Stub areas, where
549external routes are not permitted.
550
551Note that for connected routes, one may instead use
552@dfn{passive-interface}, see @ref{OSPF passive-interface}.
paul718e3742002-12-13 20:15:29 +0000553@end deffn
554
555@deffn {OSPF Command} {default-information originate} {}
556@deffnx {OSPF Command} {default-information originate metric <0-16777214>} {}
557@deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2)} {}
558@deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
559@deffnx {OSPF Command} {default-information originate always} {}
560@deffnx {OSPF Command} {default-information originate always metric <0-16777214>} {}
561@deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2)} {}
562@deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
563@deffnx {OSPF Command} {no default-information originate} {}
paule5b308d2005-10-29 20:19:49 +0000564Originate an AS-External (type-5) LSA describing a default route into
565all external-routing capable areas, of the specified metric and metric
566type. If the 'always' keyword is given then the default is always
567advertised, even when there is no default present in the routing table.
paul718e3742002-12-13 20:15:29 +0000568@end deffn
569
570@deffn {OSPF Command} {distribute-list NAME out (kernel|connected|static|rip|ospf} {}
571@deffnx {OSPF Command} {no distribute-list NAME out (kernel|connected|static|rip|ospf} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000572@anchor{ospf distribute-list}Apply the access-list filter, NAME, to
573redistributed routes of the given type before allowing the routes to
574redistributed into OSPF (@pxref{OSPF redistribute}).
paul718e3742002-12-13 20:15:29 +0000575@end deffn
576
577@deffn {OSPF Command} {default-metric <0-16777214>} {}
578@deffnx {OSPF Command} {no default-metric} {}
579@end deffn
580
581@deffn {OSPF Command} {distance <1-255>} {}
582@deffnx {OSPF Command} {no distance <1-255>} {}
583@end deffn
584
585@deffn {OSPF Command} {distance ospf (intra-area|inter-area|external) <1-255>} {}
586@deffnx {OSPF Command} {no distance ospf} {}
587@end deffn
588
paul76b89b42004-11-06 17:13:09 +0000589@node Showing OSPF information
paul718e3742002-12-13 20:15:29 +0000590@section Showing OSPF information
591
592@deffn {Command} {show ip ospf} {}
Paul Jakmac3eab602006-07-28 04:42:39 +0000593@anchor{show ip ospf}Show information on a variety of general OSPF and
594area state and configuration information.
paul718e3742002-12-13 20:15:29 +0000595@end deffn
596
597@deffn {Command} {show ip ospf interface [INTERFACE]} {}
paule5b308d2005-10-29 20:19:49 +0000598Show state and configuration of OSPF the specified interface, or all
599interfaces if no interface is given.
paul718e3742002-12-13 20:15:29 +0000600@end deffn
601
602@deffn {Command} {show ip ospf neighbor} {}
603@deffnx {Command} {show ip ospf neighbor INTERFACE} {}
604@deffnx {Command} {show ip ospf neighbor detail} {}
605@deffnx {Command} {show ip ospf neighbor INTERFACE detail} {}
606@end deffn
607
608@deffn {Command} {show ip ospf database} {}
609@end deffn
610
611@deffn {Command} {show ip ospf database (asbr-summary|external|network|router|summary)} {}
612@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id}} {}
613@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} adv-router @var{adv-router}} {}
614@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) adv-router @var{adv-router}} {}
615@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) @var{link-state-id} self-originate} {}
616@deffnx {Command} {show ip ospf database (asbr-summary|external|network|router|summary) self-originate} {}
617@end deffn
618
619@deffn {Command} {show ip ospf database max-age} {}
620@end deffn
621
622@deffn {Command} {show ip ospf database self-originate} {}
623@end deffn
624
paul718e3742002-12-13 20:15:29 +0000625@deffn {Command} {show ip ospf route} {}
paule5b308d2005-10-29 20:19:49 +0000626Show the OSPF routing table, as determined by the most recent SPF calculation.
paul718e3742002-12-13 20:15:29 +0000627@end deffn
628
paul76b89b42004-11-06 17:13:09 +0000629@node Debugging OSPF
paul718e3742002-12-13 20:15:29 +0000630@section Debugging OSPF
631
632@deffn {Command} {debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
633@deffnx {Command} {no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
634@end deffn
635
636@deffn {Command} {debug ospf ism} {}
637@deffnx {Command} {debug ospf ism (status|events|timers)} {}
638@deffnx {Command} {no debug ospf ism} {}
639@deffnx {Command} {no debug ospf ism (status|events|timers)} {}
640@end deffn
641
642@deffn {Command} {debug ospf nsm} {}
643@deffnx {Command} {debug ospf nsm (status|events|timers)} {}
644@deffnx {Command} {no debug ospf nsm} {}
645@deffnx {Command} {no debug ospf nsm (status|events|timers)} {}
646@end deffn
647
648@deffn {Command} {debug ospf lsa} {}
649@deffnx {Command} {debug ospf lsa (generate|flooding|refresh)} {}
650@deffnx {Command} {no debug ospf lsa} {}
651@deffnx {Command} {no debug ospf lsa (generate|flooding|refresh)} {}
652@end deffn
653
654@deffn {Command} {debug ospf zebra} {}
655@deffnx {Command} {debug ospf zebra (interface|redistribute)} {}
656@deffnx {Command} {no debug ospf zebra} {}
657@deffnx {Command} {no debug ospf zebra (interface|redistribute)} {}
658@end deffn
659
660@deffn {Command} {show debugging ospf} {}
661@end deffn
662
paule5b308d2005-10-29 20:19:49 +0000663@node OSPF Configuration Examples
664@section OSPF Configuration Examples
665A simple example, with MD5 authentication enabled:
666
667@example
668@group
669!
670interface bge0
671 ip ospf authentication message-digest
672 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
673!
674router ospf
675 network 192.168.0.0/16 area 0.0.0.1
676 area 0.0.0.1 authentication message-digest
677@end group
678@end example
679
680An @acronym{ABR} router, with MD5 authentication and performing summarisation
681of networks between the areas:
682
683@example
684@group
685!
686password ABCDEF
687log file /var/log/quagga/ospfd.log
688service advanced-vty
689!
690interface eth0
691 ip ospf authentication message-digest
692 ip ospf message-digest-key 1 md5 ABCDEFGHIJK
693!
694interface ppp0
695!
696interface br0
697 ip ospf authentication message-digest
698 ip ospf message-digest-key 2 md5 XYZ12345
699!
700router ospf
701 ospf router-id 192.168.0.1
702 redistribute connected
703 passive interface ppp0
704 network 192.168.0.0/24 area 0.0.0.0
705 network 10.0.0.0/16 area 0.0.0.0
706 network 192.168.1.0/24 area 0.0.0.1
707 area 0.0.0.0 authentication message-digest
708 area 0.0.0.0 range 10.0.0.0/16
709 area 0.0.0.0 range 192.168.0.0/24
710 area 0.0.0.1 authentication message-digest
711 area 0.0.0.1 range 10.2.0.0/16
712!
713@end group
714@end example