ospfd.texi 37 KB

  1. @cindex OSPFv2
  2. @node OSPFv2
  3. @chapter OSPFv2
  4. @acronym{OSPF,Open Shortest Path First} version 2 is a routing protocol
  5. which is described in @cite{RFC2328, OSPF Version 2}. OSPF is an
  6. @acronym{IGP,Interior Gateway Protocol}. Compared with @acronym{RIP},
  7. @acronym{OSPF} can provide scalable network support and faster
  8. convergence times. OSPF is widely used in large networks such as
  9. @acronym{ISP,Internet Service Provider} backbone and enterprise
  10. networks.
  11. @menu
  12. * OSPF Fundamentals::
  13. * Configuring ospfd::
  14. * OSPF router::
  15. * OSPF area::
  16. * OSPF interface::
  17. * Redistribute routes to OSPF::
  18. * Showing OSPF information::
  19. * Opaque LSA::
  20. * OSPF Traffic Engineering::
  21. * Router Information::
  22. * Debugging OSPF::
  23. * OSPF Configuration Examples::
  24. @end menu
  25. @include ospf_fundamentals.texi
  26. @node Configuring ospfd
  27. @section Configuring ospfd
  28. There are no @command{ospfd} specific options. Common options can be
  29. specified (@pxref{Common Invocation Options}) to @command{ospfd}.
  30. @command{ospfd} needs to acquire interface information from
  31. @command{zebra} in order to function. Therefore @command{zebra} must be
  32. running before invoking @command{ospfd}. Also, if @command{zebra} is
  33. restarted then @command{ospfd} must be too.
  34. Like other daemons, @command{ospfd} configuration is done in @acronym{OSPF}
  35. specific configuration file @file{ospfd.conf}.
  36. @node OSPF router
  37. @section OSPF router
  38. To start OSPF process you have to specify the OSPF router. As of this
  39. writing, @command{ospfd} does not support multiple OSPF processes.
  40. @deffn Command {router ospf} {}
  41. @deffnx Command {no router ospf} {}
  42. Enable or disable the OSPF process. @command{ospfd} does not yet
  43. support multiple OSPF processes. So you can not specify an OSPF process
  44. number.
  45. @end deffn
  46. @deffn {OSPF Command} {ospf router-id @var{a.b.c.d}} {}
  47. @deffnx {OSPF Command} {no ospf router-id} {}
  48. @anchor{ospf router-id}This sets the router-ID of the OSPF process. The
  49. router-ID may be an IP address of the router, but need not be - it can
  50. be any arbitrary 32bit number. However it MUST be unique within the
  51. entire OSPF domain to the OSPF speaker - bad things will happen if
  52. multiple OSPF speakers are configured with the same router-ID! If one
  53. is not specified then @command{ospfd} will obtain a router-ID
  54. automatically from @command{zebra}.
  55. @end deffn
  56. @deffn {OSPF Command} {ospf abr-type @var{type}} {}
  57. @deffnx {OSPF Command} {no ospf abr-type @var{type}} {}
  58. @var{type} can be cisco|ibm|shortcut|standard. The "Cisco" and "IBM" types
  59. are equivalent.
  60. The OSPF standard for ABR behaviour does not allow an ABR to consider
  61. routes through non-backbone areas when its links to the backbone are
  62. down, even when there are other ABRs in attached non-backbone areas
  63. which still can reach the backbone - this restriction exists primarily
  64. to ensure routing-loops are avoided.
  65. With the "Cisco" or "IBM" ABR type, the default in this release of
  66. Quagga, this restriction is lifted, allowing an ABR to consider
  67. summaries learnt from other ABRs through non-backbone areas, and hence
  68. route via non-backbone areas as a last resort when, and only when,
  69. backbone links are down.
  70. Note that areas with fully-adjacent virtual-links are considered to be
  71. "transit capable" and can always be used to route backbone traffic, and
  72. hence are unaffected by this setting (@pxref{OSPF virtual-link}).
  73. More information regarding the behaviour controlled by this command can
  74. be found in @cite{RFC 3509, Alternative Implementations of OSPF Area
  75. Border Routers}, and @cite{draft-ietf-ospf-shortcut-abr-02.txt}.
  76. Quote: "Though the definition of the @acronym{ABR,Area Border Router}
  77. in the OSPF specification does not require a router with multiple
  78. attached areas to have a backbone connection, it is actually
  79. necessary to provide successful routing to the inter-area and
  80. external destinations. If this requirement is not met, all traffic
  81. destined for the areas not connected to such an ABR or out of the
  82. OSPF domain, is dropped. This document describes alternative ABR
  83. behaviors implemented in Cisco and IBM routers."
  84. @end deffn
  85. @deffn {OSPF Command} {ospf rfc1583compatibility} {}
  86. @deffnx {OSPF Command} {no ospf rfc1583compatibility} {}
  87. @cite{RFC2328}, the sucessor to @cite{RFC1583}, suggests according
  88. to section G.2 (changes) in section 16.4 a change to the path
  89. preference algorithm that prevents possible routing loops that were
  90. possible in the old version of OSPFv2. More specifically it demands
  91. that inter-area paths and intra-area backbone path are now of equal preference
  92. but still both preferred to external paths.
  93. This command should NOT be set normally.
  94. @end deffn
  95. @deffn {OSPF Command} {log-adjacency-changes [detail]} {}
  96. @deffnx {OSPF Command} {no log-adjacency-changes [detail]} {}
  97. Configures ospfd to log changes in adjacency. With the optional
  98. detail argument, all changes in adjacency status are shown. Without detail,
  99. only changes to full or regressions are shown.
  100. @end deffn
  101. @deffn {OSPF Command} {passive-interface @var{interface}} {}
  102. @deffnx {OSPF Command} {no passive-interface @var{interface}} {}
  103. @anchor{OSPF passive-interface} Do not speak OSPF interface on the
  104. given interface, but do advertise the interface as a stub link in the
  105. router-@acronym{LSA,Link State Advertisement} for this router. This
  106. allows one to advertise addresses on such connected interfaces without
  107. having to originate AS-External/Type-5 LSAs (which have global flooding
  108. scope) - as would occur if connected addresses were redistributed into
  109. OSPF (@pxref{Redistribute routes to OSPF})@. This is the only way to
  110. advertise non-OSPF links into stub areas.
  111. @end deffn
  112. @deffn {OSPF Command} {timers throttle spf @var{delay} @var{initial-holdtime} @var{max-holdtime}} {}
  113. @deffnx {OSPF Command} {no timers throttle spf} {}
  114. This command sets the initial @var{delay}, the @var{initial-holdtime}
  115. and the @var{maximum-holdtime} between when SPF is calculated and the
  116. event which triggered the calculation. The times are specified in
  117. milliseconds and must be in the range of 0 to 600000 milliseconds.
  118. The @var{delay} specifies the minimum amount of time to delay SPF
  119. calculation (hence it affects how long SPF calculation is delayed after
  120. an event which occurs outside of the holdtime of any previous SPF
  121. calculation, and also serves as a minimum holdtime).
  122. Consecutive SPF calculations will always be seperated by at least
  123. 'hold-time' milliseconds. The hold-time is adaptive and initially is
  124. set to the @var{initial-holdtime} configured with the above command.
  125. Events which occur within the holdtime of the previous SPF calculation
  126. will cause the holdtime to be increased by @var{initial-holdtime}, bounded
  127. by the @var{maximum-holdtime} configured with this command. If the adaptive
  128. hold-time elapses without any SPF-triggering event occuring then
  129. the current holdtime is reset to the @var{initial-holdtime}. The current
  130. holdtime can be viewed with @ref{show ip ospf}, where it is expressed as
  131. a multiplier of the @var{initial-holdtime}.
  132. @example
  133. @group
  134. router ospf
  135. timers throttle spf 200 400 10000
  136. @end group
  137. @end example
  138. In this example, the @var{delay} is set to 200ms, the @var{initial
  139. holdtime} is set to 400ms and the @var{maximum holdtime} to 10s. Hence
  140. there will always be at least 200ms between an event which requires SPF
  141. calculation and the actual SPF calculation. Further consecutive SPF
  142. calculations will always be seperated by between 400ms to 10s, the
  143. hold-time increasing by 400ms each time an SPF-triggering event occurs
  144. within the hold-time of the previous SPF calculation.
  145. This command supercedes the @command{timers spf} command in previous Quagga
  146. releases.
  147. @end deffn
  148. @deffn {OSPF Command} {max-metric router-lsa [on-startup|on-shutdown] <5-86400>} {}
  149. @deffnx {OSPF Command} {max-metric router-lsa administrative} {}
  150. @deffnx {OSPF Command} {no max-metric router-lsa [on-startup|on-shutdown|administrative]} {}
  151. This enables @cite{RFC3137, OSPF Stub Router Advertisement} support,
  152. where the OSPF process describes its transit links in its router-LSA as
  153. having infinite distance so that other routers will avoid calculating
  154. transit paths through the router while still being able to reach
  155. networks through the router.
  156. This support may be enabled administratively (and indefinitely) or
  157. conditionally. Conditional enabling of max-metric router-lsas can be
  158. for a period of seconds after startup and/or for a period of seconds
  159. prior to shutdown.
  160. Enabling this for a period after startup allows OSPF to converge fully
  161. first without affecting any existing routes used by other routers,
  162. while still allowing any connected stub links and/or redistributed
  163. routes to be reachable. Enabling this for a period of time in advance
  164. of shutdown allows the router to gracefully excuse itself from the OSPF
  165. domain.
  166. Enabling this feature administratively allows for administrative
  167. intervention for whatever reason, for an indefinite period of time.
  168. Note that if the configuration is written to file, this administrative
  169. form of the stub-router command will also be written to file. If
  170. @command{ospfd} is restarted later, the command will then take effect
  171. until manually deconfigured.
  172. Configured state of this feature as well as current status, such as the
  173. number of second remaining till on-startup or on-shutdown ends, can be
  174. viewed with the @ref{show ip ospf} command.
  175. @end deffn
  176. @deffn {OSPF Command} {auto-cost reference-bandwidth <1-4294967>} {}
  177. @deffnx {OSPF Command} {no auto-cost reference-bandwidth} {}
  178. @anchor{OSPF auto-cost reference-bandwidth}This sets the reference
  179. bandwidth for cost calculations, where this bandwidth is considered
  180. equivalent to an OSPF cost of 1, specified in Mbits/s. The default is
  181. 100Mbit/s (i.e. a link of bandwidth 100Mbit/s or higher will have a
  182. cost of 1. Cost of lower bandwidth links will be scaled with reference
  183. to this cost).
  184. This configuration setting MUST be consistent across all routers within the
  185. OSPF domain.
  186. @end deffn
  187. @deffn {OSPF Command} {network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
  188. @deffnx {OSPF Command} {network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
  189. @deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{a.b.c.d}} {}
  190. @deffnx {OSPF Command} {no network @var{a.b.c.d/m} area @var{<0-4294967295>}} {}
  191. @anchor{OSPF network command}
  192. This command specifies the OSPF enabled interface(s). If the interface has
  193. an address from range then the command below enables ospf
  194. on this interface so router can provide network information to the other
  195. ospf routers via this interface.
  196. @example
  197. @group
  198. router ospf
  199. network area
  200. @end group
  201. @end example
  202. Prefix length in interface must be equal or bigger (ie. smaller network) than
  203. prefix length in network statement. For example statement above doesn't enable
  204. ospf on interface with address, but it does on interface with
  205. address
  206. Note that the behavior when there is a peer address
  207. defined on an interface changed after release 0.99.7.
  208. Currently, if a peer prefix has been configured,
  209. then we test whether the prefix in the network command contains
  210. the destination prefix. Otherwise, we test whether the network command prefix
  211. contains the local address prefix of the interface.
  212. In some cases it may be more convenient to enable OSPF on a per
  213. interface/subnet basis (@pxref{OSPF ip ospf area command}).
  214. @end deffn
  215. @node OSPF area
  216. @section OSPF area
  217. @deffn {OSPF Command} {area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
  218. @deffnx {OSPF Command} {area <0-4294967295> range @var{a.b.c.d/m}} {}
  219. @deffnx {OSPF Command} {no area @var{a.b.c.d} range @var{a.b.c.d/m}} {}
  220. @deffnx {OSPF Command} {no area <0-4294967295> range @var{a.b.c.d/m}} {}
  221. Summarize intra area paths from specified area into one Type-3 summary-LSA
  222. announced to other areas. This command can be used only in ABR and ONLY
  223. router-LSAs (Type-1) and network-LSAs (Type-2) (ie. LSAs with scope area) can
  224. be summarized. Type-5 AS-external-LSAs can't be summarized - their scope is AS.
  225. Summarizing Type-7 AS-external-LSAs isn't supported yet by Quagga.
  226. @example
  227. @group
  228. router ospf
  229. network area
  230. network area
  231. area range
  232. @end group
  233. @end example
  234. With configuration above one Type-3 Summary-LSA with routing info is
  235. announced into backbone area if area contains at least one intra-area
  236. network (ie. described with router or network LSA) from this range.
  237. @end deffn
  238. @deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
  239. @deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX not-advertise} {}
  240. Instead of summarizing intra area paths filter them - ie. intra area paths from this
  241. range are not advertised into other areas.
  242. This command makes sense in ABR only.
  243. @end deffn
  244. @deffn {OSPF Command} {area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
  245. @deffnx {OSPF Command} {no area @var{a.b.c.d} range IPV4_PREFIX substitute IPV4_PREFIX} {}
  246. Substitute summarized prefix with another prefix.
  247. @example
  248. @group
  249. router ospf
  250. network area
  251. network area
  252. area range substitute
  253. @end group
  254. @end example
  255. One Type-3 summary-LSA with routing info is announced into backbone area if
  256. area contains at least one intra-area network (ie. described with router-LSA or
  257. network-LSA) from range
  258. This command makes sense in ABR only.
  259. @end deffn
  260. @deffn {OSPF Command} {area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
  261. @deffnx {OSPF Command} {area <0-4294967295> virtual-link @var{a.b.c.d}} {}
  262. @deffnx {OSPF Command} {no area @var{a.b.c.d} virtual-link @var{a.b.c.d}} {}
  263. @deffnx {OSPF Command} {no area <0-4294967295> virtual-link @var{a.b.c.d}} {}
  264. @anchor{OSPF virtual-link}
  265. @end deffn
  266. @deffn {OSPF Command} {area @var{a.b.c.d} shortcut} {}
  267. @deffnx {OSPF Command} {area <0-4294967295> shortcut} {}
  268. @deffnx {OSPF Command} {no area @var{a.b.c.d} shortcut} {}
  269. @deffnx {OSPF Command} {no area <0-4294967295> shortcut} {}
  270. Configure the area as Shortcut capable. See @cite{RFC3509}. This requires
  271. that the 'abr-type' be set to 'shortcut'.
  272. @end deffn
  273. @deffn {OSPF Command} {area @var{a.b.c.d} stub} {}
  274. @deffnx {OSPF Command} {area <0-4294967295> stub} {}
  275. @deffnx {OSPF Command} {no area @var{a.b.c.d} stub} {}
  276. @deffnx {OSPF Command} {no area <0-4294967295> stub} {}
  277. Configure the area to be a stub area. That is, an area where no router
  278. originates routes external to OSPF and hence an area where all external
  279. routes are via the ABR(s). Hence, ABRs for such an area do not need
  280. to pass AS-External LSAs (type-5s) or ASBR-Summary LSAs (type-4) into the
  281. area. They need only pass Network-Summary (type-3) LSAs into such an area,
  282. along with a default-route summary.
  283. @end deffn
  284. @deffn {OSPF Command} {area @var{a.b.c.d} stub no-summary} {}
  285. @deffnx {OSPF Command} {area <0-4294967295> stub no-summary} {}
  286. @deffnx {OSPF Command} {no area @var{a.b.c.d} stub no-summary} {}
  287. @deffnx {OSPF Command} {no area <0-4294967295> stub no-summary} {}
  288. Prevents an @command{ospfd} ABR from injecting inter-area
  289. summaries into the specified stub area.
  290. @end deffn
  291. @deffn {OSPF Command} {area @var{a.b.c.d} default-cost <0-16777215>} {}
  292. @deffnx {OSPF Command} {no area @var{a.b.c.d} default-cost <0-16777215>} {}
  293. Set the cost of default-summary LSAs announced to stubby areas.
  294. @end deffn
  295. @deffn {OSPF Command} {area @var{a.b.c.d} export-list NAME} {}
  296. @deffnx {OSPF Command} {area <0-4294967295> export-list NAME} {}
  297. @deffnx {OSPF Command} {no area @var{a.b.c.d} export-list NAME} {}
  298. @deffnx {OSPF Command} {no area <0-4294967295> export-list NAME} {}
  299. Filter Type-3 summary-LSAs announced to other areas originated from intra-
  300. area paths from specified area.
  301. @example
  302. @group
  303. router ospf
  304. network area
  305. network area
  306. area export-list foo
  307. !
  308. access-list foo permit
  309. access-list foo deny any
  310. @end group
  311. @end example
  312. With example above any intra-area paths from area and from range
  313. (for example and are announced into
  314. other areas as Type-3 summary-LSA's, but any others (for example
  315. or aren't.
  316. This command is only relevant if the router is an ABR for the specified
  317. area.
  318. @end deffn
  319. @deffn {OSPF Command} {area @var{a.b.c.d} import-list NAME} {}
  320. @deffnx {OSPF Command} {area <0-4294967295> import-list NAME} {}
  321. @deffnx {OSPF Command} {no area @var{a.b.c.d} import-list NAME} {}
  322. @deffnx {OSPF Command} {no area <0-4294967295> import-list NAME} {}
  323. Same as export-list, but it applies to paths announced into specified area as
  324. Type-3 summary-LSAs.
  325. @end deffn
  326. @deffn {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME in} {}
  327. @deffnx {OSPF Command} {area @var{a.b.c.d} filter-list prefix NAME out} {}
  328. @deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME in} {}
  329. @deffnx {OSPF Command} {area <0-4294967295> filter-list prefix NAME out} {}
  330. @deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME in} {}
  331. @deffnx {OSPF Command} {no area @var{a.b.c.d} filter-list prefix NAME out} {}
  332. @deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME in} {}
  333. @deffnx {OSPF Command} {no area <0-4294967295> filter-list prefix NAME out} {}
  334. Filtering Type-3 summary-LSAs to/from area using prefix lists. This command
  335. makes sense in ABR only.
  336. @end deffn
  337. @deffn {OSPF Command} {area @var{a.b.c.d} authentication} {}
  338. @deffnx {OSPF Command} {area <0-4294967295> authentication} {}
  339. @deffnx {OSPF Command} {no area @var{a.b.c.d} authentication} {}
  340. @deffnx {OSPF Command} {no area <0-4294967295> authentication} {}
  341. Specify that simple password authentication should be used for the given
  342. area.
  343. @end deffn
  344. @deffn {OSPF Command} {area @var{a.b.c.d} authentication message-digest} {}
  345. @deffnx {OSPF Command} {area <0-4294967295> authentication message-digest} {}
  346. @anchor{area authentication message-digest}Specify that OSPF packets
  347. must be authenticated with MD5 HMACs within the given area. Keying
  348. material must also be configured on a per-interface basis (@pxref{ip
  349. ospf message-digest-key}).
  350. MD5 authentication may also be configured on a per-interface basis
  351. (@pxref{ip ospf authentication message-digest}). Such per-interface
  352. settings will override any per-area authentication setting.
  353. @end deffn
  354. @node OSPF interface
  355. @section OSPF interface
  356. @deffn {Interface Command} {ip ospf area @var{AREA} [@var{ADDR}]} {}
  357. @deffnx {Interface Command} {no ip ospf area [@var{ADDR}]} {}
  358. @anchor{OSPF ip ospf area command}
  359. Enable OSPF on the interface, optionally restricted to just the IP address
  360. given by @var{ADDR}, putting it in the @var{AREA} area. Per interface area
  361. settings take precedence to network commands (@pxref{OSPF network command}).
  362. If you have a lot of interfaces, and/or a lot of subnets, then enabling OSPF
  363. via this command may result in a slight performance improvement.
  364. @end deffn
  365. @deffn {Interface Command} {ip ospf authentication-key @var{AUTH_KEY}} {}
  366. @deffnx {Interface Command} {no ip ospf authentication-key} {}
  367. Set OSPF authentication key to a simple password. After setting @var{AUTH_KEY},
  368. all OSPF packets are authenticated. @var{AUTH_KEY} has length up to 8 chars.
  369. Simple text password authentication is insecure and deprecated in favour of
  370. MD5 HMAC authentication (@pxref{ip ospf authentication message-digest}).
  371. @end deffn
  372. @deffn {Interface Command} {ip ospf authentication message-digest} {}
  373. @anchor{ip ospf authentication message-digest}Specify that MD5 HMAC
  374. authentication must be used on this interface. MD5 keying material must
  375. also be configured (@pxref{ip ospf message-digest-key}). Overrides any
  376. authentication enabled on a per-area basis (@pxref{area
  377. authentication message-digest}).
  378. Note that OSPF MD5 authentication requires that time never go backwards
  379. (correct time is NOT important, only that it never goes backwards), even
  380. across resets, if ospfd is to be able to promptly reestabish adjacencies
  381. with its neighbours after restarts/reboots. The host should have system
  382. time be set at boot from an external or non-volatile source (eg battery backed clock, NTP,
  383. etc.) or else the system clock should be periodically saved to non-volative
  384. storage and restored at boot if MD5 authentication is to be expected to work
  385. reliably.
  386. @end deffn
  387. @deffn {Interface Command} {ip ospf message-digest-key KEYID md5 KEY} {}
  388. @deffnx {Interface Command} {no ip ospf message-digest-key} {}
  389. @anchor{ip ospf message-digest-key}Set OSPF authentication key to a
  390. cryptographic password. The cryptographic algorithm is MD5.
  391. KEYID identifies secret key used to create the message digest. This ID
  392. is part of the protocol and must be consistent across routers on a
  393. link.
  394. KEY is the actual message digest key, of up to 16 chars (larger strings
  395. will be truncated), and is associated with the given KEYID.
  396. @end deffn
  397. @deffn {Interface Command} {ip ospf cost <1-65535>} {}
  398. @deffnx {Interface Command} {no ip ospf cost} {}
  399. Set link cost for the specified interface. The cost value is set to router-LSA's
  400. metric field and used for SPF calculation.
  401. @end deffn
  402. @deffn {Interface Command} {ip ospf dead-interval <1-65535>} {}
  403. @deffnx {Interface Command} {ip ospf dead-interval minimal hello-multiplier <2-20>} {}
  404. @deffnx {Interface Command} {no ip ospf dead-interval} {}
  405. @anchor{ip ospf dead-interval minimal} Set number of seconds for
  406. RouterDeadInterval timer value used for Wait Timer and Inactivity
  407. Timer. This value must be the same for all routers attached to a
  408. common network. The default value is 40 seconds.
  409. If 'minimal' is specified instead, then the dead-interval is set to 1
  410. second and one must specify a hello-multiplier. The hello-multiplier
  411. specifies how many Hellos to send per second, from 2 (every 500ms) to
  412. 20 (every 50ms). Thus one can have 1s convergence time for OSPF. If this form
  413. is specified, then the hello-interval advertised in Hello packets is set to
  414. 0 and the hello-interval on received Hello packets is not checked, thus
  415. the hello-multiplier need NOT be the same across multiple routers on a common
  416. link.
  417. @end deffn
  418. @deffn {Interface Command} {ip ospf hello-interval <1-65535>} {}
  419. @deffnx {Interface Command} {no ip ospf hello-interval} {}
  420. Set number of seconds for HelloInterval timer value. Setting this value,
  421. Hello packet will be sent every timer value seconds on the specified interface.
  422. This value must be the same for all routers attached to a common network.
  423. The default value is 10 seconds.
  424. This command has no effect if @ref{ip ospf dead-interval minimal} is also
  425. specified for the interface.
  426. @end deffn
  427. @deffn {Interface Command} {ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)} {}
  428. @deffnx {Interface Command} {no ip ospf network} {}
  429. Set explicitly network type for specifed interface.
  430. @end deffn
  431. @deffn {Interface Command} {ip ospf priority <0-255>} {}
  432. @deffnx {Interface Command} {no ip ospf priority} {}
  433. Set RouterPriority integer value. The router with the highest priority
  434. will be more eligible to become Designated Router. Setting the value
  435. to 0, makes the router ineligible to become Designated Router. The
  436. default value is 1.
  437. @end deffn
  438. @deffn {Interface Command} {ip ospf retransmit-interval <1-65535>} {}
  439. @deffnx {Interface Command} {no ip ospf retransmit interval} {}
  440. Set number of seconds for RxmtInterval timer value. This value is used
  441. when retransmitting Database Description and Link State Request packets.
  442. The default value is 5 seconds.
  443. @end deffn
  444. @deffn {Interface Command} {ip ospf transmit-delay} {}
  445. @deffnx {Interface Command} {no ip ospf transmit-delay} {}
  446. Set number of seconds for InfTransDelay value. LSAs' age should be
  447. incremented by this value when transmitting.
  448. The default value is 1 seconds.
  449. @end deffn
  450. @node Redistribute routes to OSPF
  451. @section Redistribute routes to OSPF
  452. @deffn {OSPF Command} {redistribute (kernel|connected|static|rip|bgp)} {}
  453. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) @var{route-map}} {}
  454. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)} {}
  455. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map @var{word}} {}
  456. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>} {}
  457. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map @var{word}} {}
  458. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>} {}
  459. @deffnx {OSPF Command} {redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map @var{word}} {}
  460. @deffnx {OSPF Command} {no redistribute (kernel|connected|static|rip|bgp)} {}
  461. @anchor{OSPF redistribute}Redistribute routes of the specified protocol
  462. or kind into OSPF, with the metric type and metric set if specified,
  463. filtering the routes using the given route-map if specified.
  464. Redistributed routes may also be filtered with distribute-lists, see
  465. @ref{ospf distribute-list}.
  466. Redistributed routes are distributed as into OSPF as Type-5 External
  467. LSAs into links to areas that accept external routes, Type-7 External LSAs
  468. for NSSA areas and are not redistributed at all into Stub areas, where
  469. external routes are not permitted.
  470. Note that for connected routes, one may instead use
  471. @dfn{passive-interface}, see @ref{OSPF passive-interface}.
  472. @end deffn
  473. @deffn {OSPF Command} {default-information originate} {}
  474. @deffnx {OSPF Command} {default-information originate metric <0-16777214>} {}
  475. @deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2)} {}
  476. @deffnx {OSPF Command} {default-information originate metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
  477. @deffnx {OSPF Command} {default-information originate always} {}
  478. @deffnx {OSPF Command} {default-information originate always metric <0-16777214>} {}
  479. @deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2)} {}
  480. @deffnx {OSPF Command} {default-information originate always metric <0-16777214> metric-type (1|2) route-map @var{word}} {}
  481. @deffnx {OSPF Command} {no default-information originate} {}
  482. Originate an AS-External (type-5) LSA describing a default route into
  483. all external-routing capable areas, of the specified metric and metric
  484. type. If the 'always' keyword is given then the default is always
  485. advertised, even when there is no default present in the routing table.
  486. @end deffn
  487. @deffn {OSPF Command} {distribute-list NAME out (kernel|connected|static|rip|ospf} {}
  488. @deffnx {OSPF Command} {no distribute-list NAME out (kernel|connected|static|rip|ospf} {}
  489. @anchor{ospf distribute-list}Apply the access-list filter, NAME, to
  490. redistributed routes of the given type before allowing the routes to
  491. redistributed into OSPF (@pxref{OSPF redistribute}).
  492. @end deffn
  493. @deffn {OSPF Command} {default-metric <0-16777214>} {}
  494. @deffnx {OSPF Command} {no default-metric} {}
  495. @end deffn
  496. @deffn {OSPF Command} {distance <1-255>} {}
  497. @deffnx {OSPF Command} {no distance <1-255>} {}
  498. @end deffn
  499. @deffn {OSPF Command} {distance ospf (intra-area|inter-area|external) <1-255>} {}
  500. @deffnx {OSPF Command} {no distance ospf} {}
  501. @end deffn
  502. @node Showing OSPF information
  503. @section Showing OSPF information
  504. @deffn {Command} {show ip ospf} {}
  505. @anchor{show ip ospf}Show information on a variety of general OSPF and
  506. area state and configuration information.
  507. @end deffn
  508. @deffn {Command} {show ip ospf interface [INTERFACE]} {}
  509. Show state and configuration of OSPF the specified interface, or all
  510. interfaces if no interface is given.
  511. @end deffn
  512. @deffn {Command} {show ip ospf neighbor} {}
  513. @deffnx {Command} {show ip ospf neighbor INTERFACE} {}
  514. @deffnx {Command} {show ip ospf neighbor detail} {}
  515. @deffnx {Command} {show ip ospf neighbor INTERFACE detail} {}
  516. @end deffn
  517. @deffn {Command} {show ip ospf database} {}
  518. @deffnx {Command} {show ip ospf database asbr-summary} {}
  519. @deffnx {Command} {show ip ospf database external} {}
  520. @deffnx {Command} {show ip ospf database network} {}
  521. @deffnx {Command} {show ip ospf database asbr-router} {}
  522. @deffnx {Command} {show ip ospf database summary} {}
  523. @deffnx {Command} {show ip ospf database @dots{} @var{link-state-id}} {}
  524. @deffnx {Command} {show ip ospf database @dots{} @var{link-state-id} adv-router @var{adv-router}} {}
  525. @deffnx {Command} {show ip ospf database @dots{} adv-router @var{adv-router}} {}
  526. @deffnx {Command} {show ip ospf database @dots{} @var{link-state-id} self-originate} {}
  527. @deffnx {Command} {show ip ospf database @dots{} self-originate} {}
  528. @end deffn
  529. @deffn {Command} {show ip ospf database max-age} {}
  530. @end deffn
  531. @deffn {Command} {show ip ospf database self-originate} {}
  532. @end deffn
  533. @deffn {Command} {show ip ospf route} {}
  534. Show the OSPF routing table, as determined by the most recent SPF calculation.
  535. @end deffn
  536. @node Opaque LSA
  537. @section Opaque LSA
  538. @deffn {OSPF Command} {ospf opaque-lsa} {}
  539. @deffnx {OSPF Command} {capability opaque} {}
  540. @deffnx {OSPF Command} {no ospf opaque-lsa} {}
  541. @deffnx {OSPF Command} {no capability opaque} {}
  542. @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}).
  543. @end deffn
  544. @deffn {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external)} {}
  545. @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id}} {}
  546. @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id} adv-router @var{adv-router}} {}
  547. @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) adv-router @var{adv-router}} {}
  548. @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) @var{link-state-id} self-originate} {}
  549. @deffnx {Command} {show ip ospf database (opaque-link|opaque-area|opaque-external) self-originate} {}
  550. Show Opaque LSA from the database.
  551. @end deffn
  552. @node OSPF Traffic Engineering
  553. @section Traffic Engineering
  554. @deffn {OSPF Command} {mpls-te on} {}
  555. @deffnx {OSPF Command} {no mpls-te} {}
  556. Enable Traffic Engineering LSA flooding.
  557. @end deffn
  558. @deffn {OSPF Command} {mpls-te router-address <A.B.C.D>} {}
  559. @deffnx {OSPF Command} {no mpls-te} {}
  560. Configure stable IP address for MPLS-TE. This IP address is then advertise in Opaque LSA Type-10 TLV=1 (TE)
  561. option 1 (Router-Address).
  562. @end deffn
  563. @deffn {OSPF Command} {mpls-te inter-as area <area-id>|as} {}
  564. @deffnx {OSPF Command} {no mpls-te inter-as} {}
  565. Enable RFC5392 suuport - Inter-AS TE v2 - to flood Traffic Engineering parameters of Inter-AS link.
  566. 2 modes are supported: AREA and AS; LSA are flood in AREA <area-id> with Opaque Type-10,
  567. respectively in AS with Opaque Type-11. In all case, Opaque-LSA TLV=6.
  568. @end deffn
  569. @deffn {Command} {show ip ospf mpls-te interface} {}
  570. @deffnx {Command} {show ip ospf mpls-te interface @var{interface}} {}
  571. Show MPLS Traffic Engineering parameters for all or specified interface.
  572. @end deffn
  573. @deffn {Command} {show ip ospf mpls-te router} {}
  574. Show Traffic Engineering router parameters.
  575. @end deffn
  576. @node Router Information
  577. @section Router Information
  578. @deffn {OSPF Command} {router-info [as | area <A.B.C.D>]} {}
  579. @deffnx {OSPF Command} {no router-info} {}
  580. Enable Router Information (RFC4970) LSA advertisement with AS scope (default) or Area scope flooding
  581. when area is specified.
  582. @end deffn
  583. @deffn {OSPF Command} {pce address <A.B.C.D>} {}
  584. @deffnx {OSPF Command} {no pce address} {}
  585. @deffnx {OSPF Command} {pce domain as <0-65535>} {}
  586. @deffnx {OSPF Command} {no pce domain as <0-65535>} {}
  587. @deffnx {OSPF Command} {pce neighbor as <0-65535>} {}
  588. @deffnx {OSPF Command} {no pce neighbor as <0-65535>} {}
  589. @deffnx {OSPF Command} {pce flag BITPATTERN} {}
  590. @deffnx {OSPF Command} {no pce flag} {}
  591. @deffnx {OSPF Command} {pce scope BITPATTERN} {}
  592. @deffnx {OSPF Command} {no pce scope} {}
  593. The commands are conform to RFC 5088 and allow OSPF router announce Path Compuatation Elemenent (PCE) capabilities
  594. through the Router Information (RI) LSA. Router Information must be enable prior to this. The command set/unset
  595. respectively the PCE IP adress, Autonomous System (AS) numbers of controlled domains, neighbor ASs, flag and scope.
  596. For flag and scope, please refer to RFC5088 for the BITPATTERN recognition. Multiple 'pce neighbor' command could
  597. be specified in order to specify all PCE neighbours.
  598. @end deffn
  599. @deffn {Command} {show ip ospf router-info} {}
  600. Show Router Capabilities flag.
  601. @end deffn
  602. @deffn {Command} {show ip ospf router-info pce} {}
  603. Show Router Capabilities PCE parameters.
  604. @end deffn
  605. @node Debugging OSPF
  606. @section Debugging OSPF
  607. @deffn {Command} {debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
  608. @deffnx {Command} {no debug ospf packet (hello|dd|ls-request|ls-update|ls-ack|all) (send|recv) [detail]} {}
  609. Dump Packet for debugging
  610. @end deffn
  611. @deffn {Command} {debug ospf ism} {}
  612. @deffnx {Command} {debug ospf ism (status|events|timers)} {}
  613. @deffnx {Command} {no debug ospf ism} {}
  614. @deffnx {Command} {no debug ospf ism (status|events|timers)} {}
  615. Show debug information of Interface State Machine
  616. @end deffn
  617. @deffn {Command} {debug ospf nsm} {}
  618. @deffnx {Command} {debug ospf nsm (status|events|timers)} {}
  619. @deffnx {Command} {no debug ospf nsm} {}
  620. @deffnx {Command} {no debug ospf nsm (status|events|timers)} {}
  621. Show debug information of Network State Machine
  622. @end deffn
  623. @deffn {Command} {debug ospf event} {}
  624. @deffnx {Command} {no debug ospf event} {}
  625. Show debug information of OSPF event
  626. @end deffn
  627. @deffn {Command} {debug ospf nssa} {}
  628. @deffnx {Command} {no debug ospf nssa} {}
  629. Show debug information about Not So Stub Area
  630. @end deffn
  631. @deffn {Command} {debug ospf lsa} {}
  632. @deffnx {Command} {debug ospf lsa (generate|flooding|refresh)} {}
  633. @deffnx {Command} {no debug ospf lsa} {}
  634. @deffnx {Command} {no debug ospf lsa (generate|flooding|refresh)} {}
  635. Show debug detail of Link State messages
  636. @end deffn
  637. @deffn {Command} {debug ospf te} {}
  638. @deffnx {Command} {no debug ospf te} {}
  639. Show debug information about Traffic Engineering LSA
  640. @end deffn
  641. @deffn {Command} {debug ospf zebra} {}
  642. @deffnx {Command} {debug ospf zebra (interface|redistribute)} {}
  643. @deffnx {Command} {no debug ospf zebra} {}
  644. @deffnx {Command} {no debug ospf zebra (interface|redistribute)} {}
  645. Show debug information of ZEBRA API
  646. @end deffn
  647. @deffn {Command} {show debugging ospf} {}
  648. @end deffn
  649. @node OSPF Configuration Examples
  650. @section OSPF Configuration Examples
  651. A simple example, with MD5 authentication enabled:
  652. @example
  653. @group
  654. !
  655. interface bge0
  656. ip ospf authentication message-digest
  657. ip ospf message-digest-key 1 md5 ABCDEFGHIJK
  658. !
  659. router ospf
  660. network area
  661. area authentication message-digest
  662. @end group
  663. @end example
  664. An @acronym{ABR} router, with MD5 authentication and performing summarisation
  665. of networks between the areas:
  666. @example
  667. @group
  668. !
  669. password ABCDEF
  670. log file /var/log/quagga/ospfd.log
  671. service advanced-vty
  672. !
  673. interface eth0
  674. ip ospf authentication message-digest
  675. ip ospf message-digest-key 1 md5 ABCDEFGHIJK
  676. !
  677. interface ppp0
  678. !
  679. interface br0
  680. ip ospf authentication message-digest
  681. ip ospf message-digest-key 2 md5 XYZ12345
  682. !
  683. router ospf
  684. ospf router-id
  685. redistribute connected
  686. passive interface ppp0
  687. network area
  688. network area
  689. network area
  690. area authentication message-digest
  691. area range
  692. area range
  693. area authentication message-digest
  694. area range
  695. !
  696. @end group
  697. @end example
  698. A Traffic Engineering configuration, with Inter-ASv2 support.
  699. - First, the 'zebra.conf' part:
  700. @example
  701. @group
  702. hostname HOSTNAME
  703. password PASSWORD
  704. log file /var/log/zebra.log
  705. !
  706. interface eth0
  707. ip address
  708. mpls-te on
  709. mpls-te link metric 10
  710. mpls-te link max-bw 1.25e+06
  711. mpls-te link max-rsv-bw 1.25e+06
  712. mpls-te link unrsv-bw 0 1.25e+06
  713. mpls-te link unrsv-bw 1 1.25e+06
  714. mpls-te link unrsv-bw 2 1.25e+06
  715. mpls-te link unrsv-bw 3 1.25e+06
  716. mpls-te link unrsv-bw 4 1.25e+06
  717. mpls-te link unrsv-bw 5 1.25e+06
  718. mpls-te link unrsv-bw 6 1.25e+06
  719. mpls-te link unrsv-bw 7 1.25e+06
  720. mpls-te link rsc-clsclr 0xab
  721. !
  722. interface eth1
  723. ip address
  724. mpls-te on
  725. mpls-te link metric 10
  726. mpls-te link max-bw 1.25e+06
  727. mpls-te link max-rsv-bw 1.25e+06
  728. mpls-te link unrsv-bw 0 1.25e+06
  729. mpls-te link unrsv-bw 1 1.25e+06
  730. mpls-te link unrsv-bw 2 1.25e+06
  731. mpls-te link unrsv-bw 3 1.25e+06
  732. mpls-te link unrsv-bw 4 1.25e+06
  733. mpls-te link unrsv-bw 5 1.25e+06
  734. mpls-te link unrsv-bw 6 1.25e+06
  735. mpls-te link unrsv-bw 7 1.25e+06
  736. mpls-te link rsc-clsclr 0xab
  737. mpls-te neighbor as 65000
  738. @end group
  739. @end example
  740. - Then the 'ospfd.conf' itself:
  741. @example
  742. @group
  743. hostname HOSTNAME
  744. password PASSWORD
  745. log file /var/log/ospfd.log
  746. !
  747. !
  748. interface eth0
  749. ip ospf hello-interval 60
  750. ip ospf dead-interval 240
  751. !
  752. interface eth1
  753. ip ospf hello-interval 60
  754. ip ospf dead-interval 240
  755. !
  756. !
  757. router ospf
  758. ospf router-id
  759. network area 1
  760. ospf opaque-lsa
  761. mpls-te
  762. mpls-te router-address
  763. mpls-te inter-as area 1
  764. !
  765. line vty
  766. @end group
  767. @end example
  768. A router information example with PCE advsertisement:
  769. @example
  770. @group
  771. !
  772. router ospf
  773. ospf router-id
  774. network area 1
  775. capability opaque
  776. mpls-te
  777. mpls-te router-address
  778. router-info area
  779. pce address
  780. pce flag 0x80
  781. pce domain as 65400
  782. pce neighbor as 65500
  783. pce neighbor as 65200
  784. pce scope 0x80
  785. !
  786. @end group
  787. @end example