1.\" $OpenBSD: ospfd.conf.5,v 1.48 2015/03/11 08:05:11 sthen Exp $ 2.\" 3.\" Copyright (c) 2005 Esben Norby <norby@openbsd.org> 4.\" Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> 5.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 6.\" Copyright (c) 2002 Daniel Hartmeier <dhartmei@openbsd.org> 7.\" 8.\" Permission to use, copy, modify, and distribute this software for any 9.\" purpose with or without fee is hereby granted, provided that the above 10.\" copyright notice and this permission notice appear in all copies. 11.\" 12.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19.\" 20.Dd $Mdocdate: March 11 2015 $ 21.Dt OSPFD.CONF 5 22.Os 23.Sh NAME 24.Nm ospfd.conf 25.Nd Open Shortest Path First daemon configuration file 26.Sh DESCRIPTION 27The 28.Xr ospfd 8 29daemon implements the Open Shortest Path First protocol version 2 as described 30in RFC 2328. 31.Sh SECTIONS 32The 33.Nm 34config file is divided into three main sections. 35.Bl -tag -width xxxx 36.It Sy Macros 37User-defined variables may be defined and used later, simplifying the 38configuration file. 39.It Sy Global Configuration 40Global settings for 41.Xr ospfd 8 . 42A number of global settings can be overruled in specific areas or interfaces. 43.It Sy Areas 44An OSPF router must be a member of at least one area. 45Areas are used to group interfaces, simplifying configuration. 46.El 47.Pp 48Argument names not beginning with a letter, digit, or underscore 49must be quoted. 50.Pp 51Additional configuration files can be included with the 52.Ic include 53keyword, for example: 54.Bd -literal -offset indent 55include "/etc/ospfd.sub.conf" 56.Ed 57.Sh MACROS 58Macros can be defined that will later be expanded in context. 59Macro names must start with a letter, digit, or underscore, 60and may contain any of those characters. 61Macro names may not be reserved words (for example, 62.Ic area , 63.Ic interface , 64or 65.Ic hello-interval ) . 66Macros are not expanded inside quotes. 67.Pp 68For example: 69.Bd -literal -offset indent 70hi="5" 71area 0.0.0.0 { 72 interface em0 { 73 hello-interval $hi 74 } 75} 76.Ed 77.Pp 78The same can be accomplished by specifying the hello-interval 79globally or within the area declaration. 80.Sh GLOBAL CONFIGURATION 81All interface related settings can be configured globally, per area and per 82interface. 83The only settings that can be set globally and not overruled are listed below. 84.Pp 85.Bl -tag -width Ds -compact 86.It Xo 87.Ic fib-update 88.Pq Ic yes Ns | Ns Ic no 89.Xc 90If set to 91.Ic \&no , 92do not update the Forwarding Information Base, a.k.a. the kernel 93routing table. 94The default is 95.Ic yes . 96Setting 97.Ic fib-update 98to 99.Ic \&no 100will implicitly set the 101.Ic stub Ic router 102option to ensure that no traffic tries to transit via this router. 103.Pp 104.It Ic rdomain Ar tableid 105Specifies the routing table 106.Xr ospfd 8 107should modify. 108Table 0 is the default table. 109.Pp 110.It Xo 111.Op Ic no 112.Ic redistribute 113.Sm off 114.Po Ic static Ns | Ns Ic connected Ns | Ns 115.Ic default Pc 116.Sm on 117.Op Ic set ... 118.Xc 119.It Xo 120.Op Ic no 121.Ic redistribute Ar prefix Op Ic set ... 122.Xc 123.It Xo 124.Op Ic no 125.Ic redistribute rtlabel Ar label Op Ic set ... 126.Xc 127If set to 128.Ic connected , 129routes to directly attached networks will be announced over OSPF. 130If set to 131.Ic static , 132static routes will be announced over OSPF. 133If set to 134.Ic default , 135a default route pointing to this router will be announced over OSPF. 136It is possible to specify a network range with 137.Ar prefix ; 138networks need to be part of that range to be redistributed. 139Additionally it is possible to redistribute based on route labels 140using the 141.Ic rtlabel 142keyword. 143By default no additional routes will be announced over OSPF. 144.Pp 145.Ic redistribute 146statements are evaluated in sequential order, from first to last. 147The first matching rule decides if a route should be redistributed or not. 148Matching rules starting with 149.Ic no 150will force the route to be not announced. 151The only exception is 152.Ic default , 153which will be set no matter what, and additionally 154.Ic no 155cannot be used together with it. 156.Pp 157It is possible to set the route 158.Ic metric 159and 160.Ic type 161for each redistribute rule. 162.Ic type 163is either 1 or 2. 164The default value for 165.Ic type 166is 1 and for 167.Ic metric 168is 100. 169Setting more than one option needs curly brackets: 170.Bd -literal -offset indent 171redistribute static set { metric 300 type 2 } 172.Ed 173.Pp 174.It Xo 175.Ic rfc1583compat 176.Pq Ic yes Ns | Ns Ic no 177.Xc 178If set to 179.Ic yes , 180decisions regarding AS-external routes are evaluated according to RFC 2328. 181The default is 182.Ic no . 183.Pp 184.It Ic router-id Ar address 185Set the router ID; if not specified, the numerically lowest IP address of 186the router will be used. 187.Pp 188.It Ic rtlabel Ar label Ic external-tag Ar number 189Map route labels to external route tags and vice versa. 190The external route tag is a non-negative 32-bit number attached to 191AS-external OSPF LSAs. 192.Pp 193.It Xo 194.Ic spf-delay 195.Po Ar seconds Ns | Ns 196.Ic msec Ar milliseconds Pc 197.Xc 198Set the SPF delay. 199The delay between receiving an update to the link 200state database and starting the shortest path first calculation. 201The default value is 1 second; valid range is 10 milliseconds\-10 seconds. 202.Pp 203.It Xo 204.Ic spf-holdtime 205.Po Ar seconds Ns | Ns 206.Ic msec Ar milliseconds Pc 207.Xc 208Set the SPF holdtime. 209The minimum time between two consecutive 210shortest path first calculations. 211The default value is 5 seconds; the valid range is 10 milliseconds\-5 seconds. 212.Pp 213.It Xo 214.Ic stub Ic router 215.Pq Ic yes Ns | Ns Ic no 216.Xc 217If set to 218.Ic yes , 219all interfaces with active neighbors will have a metric of infinity. 220This ensures that the other routers prefer routes around this router while 221still being able to reach directly connected IP prefixes. 222The 223.Ic stub Ic router 224option is automatically enabled if either the 225.Xr sysctl 8 226variable 227.Va net.inet.ip.forwarding 228is set to a value other than 1 or if the FIB is not coupled. 229.El 230.Sh AREAS 231Areas are used for grouping interfaces. 232All interface-specific parameters can 233be configured per area, overruling the global settings. 234.Bl -tag -width Ds 235.It Ic area Ar address 236Specify an area section, grouping one or more interfaces. 237.Bd -literal -offset indent 238area 0.0.0.0 { 239 interface em0 240 interface em1 { 241 metric 10 242 } 243} 244.Ed 245.El 246.Pp 247Area specific parameters are listed below. 248.Bl -tag -width Ds 249.It Ic demote Ar group Op Ar count 250Increase the 251.Xr carp 4 252demotion counter by 253.Ar count 254on the given interface group, usually 255.Ar carp , 256when no neighbor in the area is in an active state. 257The demotion counter will be decreased when one neighbor in that 258area is in an active state. 259The default value for 260.Ar count 261is 1. 262.Pp 263For more information on interface groups, 264see the 265.Ic group 266keyword in 267.Xr ifconfig 8 . 268.It Xo 269.Ic stub 270.Op Ic redistribute default 271.Op Ic set ... 272.Xc 273Mark the area as 274.Ar stub . 275Stub areas will not be flooded by as-ext LSA, resulting in smaller routing 276tables. 277Area border routers should redistribute a default network LSA; this can be 278enabled by specifying the default redistribute option. 279A default summary LSA will only be redistributed if the router has an active 280connection to the backbone area 0.0.0.0. 281.El 282.Sh INTERFACES 283Each interface can have several parameters configured individually, otherwise 284they are inherited. 285An interface is specified by its name. 286If multiple networks are configured an additional IP address can be supplied. 287By default the first IP address is used. 288.Bd -literal -offset indent 289interface em0 { 290 auth-type crypt 291 auth-md 1 "yotVoo_Heypp" 292 auth-md-keyid 1 293} 294interface fxp0:192.168.1.3 295.Ed 296.Pp 297Interface-specific parameters are listed below. 298.Bl -tag -width Ds 299.It Ic auth-key Ar key 300Set the authentication key for 301.Ic simple 302authentication. 303Up to 8 characters can be specified. 304.It Ic auth-md Ar key-id key 305Set the authentication 306.Ar key-id 307and 308.Ar key 309for 310.Ic crypt 311authentication. 312The valid range for 313.Ar key-id 314is 0\-255. 315Up to 16 characters can be specified for 316.Ar key . 317Multiple keys may be specified. 318.It Ic auth-md-keyid Ar key-id 319Configure the 320.Ar key-id 321to use for 322.Ic crypt 323authentication. 324The valid range for 325.Ar key-id 326is 0\-255. 327The default key-id is 1. 328While key-id 0 is valid, it is unavailable on various other implementations. 329.It Xo 330.Ic auth-type 331.Po Ic none Ns | Ns 332.Ic simple Ns | Ns Ic crypt Pc 333.Xc 334Set the authentication type. 335The default is 336.Ic none . 337Simple authentication uses a plaintext password, up to 8 characters. 338Crypt authentication uses an MD5 hash. 339.It Ic demote Ar group 340Increase the 341.Xr carp 4 342demotion counter by 1 on the given interface group, usually 343.Ar carp , 344when the interface state is going down. 345The demotion counter will be decreased when the interface 346state is active again. 347.It Ic fast-hello-interval Ic msec Ar milliseconds 348If the interface is configured to use 349.Ic router-dead-time minimal , 350hello packets will be sent using this timer. 351The default value is 333; valid range is 50\-333 milliseconds. 352.It Ic hello-interval Ar seconds 353Set the hello interval. 354The default value is 10; valid range is 1\-65535 seconds. 355.It Ic metric Ar cost 356Set the interface metric a.k.a. cost. 357The default value is 10; valid range is 1\-65535. 358.It Ic passive 359Prevent transmission and reception of OSPF packets on this interface. 360The specified interface will be announced as a stub network. 361.It Ic retransmit-interval Ar seconds 362Set retransmit interval. 363The default value is 5 seconds; valid range is 5\-3600 seconds. 364.It Xo 365.Ic router-dead-time 366.Po Ar seconds Ns | Ns Ic minimal Pc 367.Xc 368Set the router dead time, a.k.a. neighbor inactivity timer. 369The default value is 40 seconds; valid range is 2\-2147483647 seconds. 370If the router dead time has been set to 371.Ic minimal , 372the timer is set to 1 second and hello packets are sent using the interval 373specified by 374.Ic fast-hello-interval . 375When a neighbor has been 376inactive for router-dead-time its state is set to DOWN. 377Neighbors 378that have been inactive for more than 24 hours are completely removed. 379.It Ic router-priority Ar priority 380Set the router priority. 381The default value is 1; valid range is 0\-255. 382If set 383to 0 the router is not eligible as a Designated Router or Backup Designated 384Router. 385.It Ic transmit-delay Ar seconds 386Set the transmit delay. 387The default value is 1; valid range is 1\-3600 seconds. 388.El 389.Sh FILES 390.Bl -tag -width "/etc/ospfd.conf" -compact 391.It Pa /etc/ospfd.conf 392.Xr ospfd 8 393configuration file 394.El 395.Sh SEE ALSO 396.Xr ospfctl 8 , 397.Xr ospfd 8 , 398.Xr rc.conf.local 8 399.Sh HISTORY 400The 401.Nm 402file format first appeared in 403.Ox 3.7 . 404