1.\" $OpenBSD: ospf6d.conf.5,v 1.26 2023/03/02 17:09:54 jmc 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 2 2023 $ 21.Dt OSPF6D.CONF 5 22.Os 23.Sh NAME 24.Nm ospf6d.conf 25.Nd OSPF for IPv6 routing daemon configuration file 26.Sh DESCRIPTION 27The 28.Xr ospf6d 8 29daemon implements the Open Shortest Path First protocol version 3 as described 30in RFC 5340. 31.Pp 32The 33.Nm 34config file is divided into the following 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 ospf6d 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/ospf6d.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 Ic fib-priority Ar prio 87Set the routing priority to 88.Ar prio . 89The default is 32. 90.Pp 91.It Xo 92.Ic fib-update 93.Pq Ic yes Ns | Ns Ic no 94.Xc 95If set to 96.Ic \&no , 97do not update the Forwarding Information Base, a.k.a. the kernel 98routing table. 99The default is 100.Ic yes . 101Setting 102.Ic fib-update 103to 104.Ic \&no 105will implicitly set the 106.Ic stub router 107option to ensure that no traffic tries to transit via this router. 108.Pp 109.It Ic rdomain Ar tableid 110Specifies the routing table 111.Xr ospfd 8 112should modify. 113Table 0 is the default table. 114.Pp 115.It Xo 116.Op Ic no 117.Ic redistribute 118.Sm off 119.Po Ic static Ns | Ns Ic connected Ns | Ns 120.Ic default Pc 121.Sm on 122.Op Ic set ...\& 123.Bk -words 124.Op Ic depend on Ar interface 125.Ek 126.Xc 127.It Xo 128.Op Ic no 129.Ic redistribute Ar prefix Op Ic set ...\& 130.Op Ic depend on Ar interface 131.Xc 132.It Xo 133.Op Ic no 134.Ic redistribute rtlabel Ar label Op Ic set ...\& 135.Op Ic depend on Ar interface 136.Xc 137If set to 138.Ic connected , 139routes to directly attached networks will be announced over OSPF. 140If set to 141.Ic static , 142static routes will be announced over OSPF. 143If set to 144.Ic default , 145a default route pointing to this router will be announced over OSPF. 146It is possible to specify a network range with 147.Ar prefix ; 148networks need to be part of that range to be redistributed. 149Additionally it is possible to redistribute based on route labels 150using the 151.Ic rtlabel 152keyword. 153By default no additional routes will be announced over OSPF. 154.Pp 155.Ic redistribute 156statements are evaluated in sequential order, from first to last. 157The first matching rule decides if a route should be redistributed or not. 158Matching rules starting with 159.Ic no 160will force the route to be not announced. 161The only exception is 162.Ic default , 163which will be set no matter what, and additionally 164.Ic no 165cannot be used together with it. 166.Pp 167With the 168.Ic depend on 169option, redistributed routes will have a metric of 65535 if the specified 170.Ar interface 171is down or in state backup. 172This is especially useful on a carp cluster to ensure all traffic goes to 173the carp master. 174.Pp 175It is possible to set the route 176.Ic metric 177and 178.Ic type 179for each redistribute rule. 180.Ic type 181is either 1 or 2. 182The default value for 183.Ic type 184is 1 and for 185.Ic metric 186is 100. 187Setting more than one option needs curly brackets: 188.Bd -literal -offset indent 189redistribute static set { metric 300 type 2 } 190.Ed 191.Pp 192.It Ic router-id Ar address 193Set the router ID; if not specified, the lowest IPv4 address of 194the interfaces used by 195.Xr ospf6d 8 196will be used. 197A router ID must be specified if no IPv4 address is configured on 198any interfaces used by 199.Xr ospf6d 8 . 200.Pp 201.It Ic rtlabel Ar label Ic external-tag Ar number 202Map route labels to external route tags and vice versa. 203The external route tag is a non-negative 32-bit number attached to 204AS-external OSPF LSAs. 205.Pp 206.It Ic spf-delay Ar seconds 207Set SPF delay in seconds. 208The delay between receiving an update to the link 209state database and starting the shortest path first calculation. 210The default value is 1; valid range is 1\-10 seconds. 211.Pp 212.It Ic spf-holdtime Ar seconds 213Set the SPF holdtime in seconds. 214The minimum time between two consecutive 215shortest path first calculations. 216The default value is 5 seconds; the valid range is 1\-5 seconds. 217.Pp 218.It Xo 219.Ic stub router 220.Pq Ic yes Ns | Ns Ic no 221.Xc 222If set to 223.Ic yes , 224all interfaces with active neighbors will have a metric of infinity. 225This ensures that the other routers prefer routes around this router while 226still being able to reach directly connected IP prefixes. 227The 228.Ic stub router 229option is automatically enabled if either the 230.Xr sysctl 8 231variable 232.Va net.inet6.ip6.forwarding 233is set to a value different to 1 or if the FIB is not coupled. 234.El 235.Sh AREAS 236Areas are used for grouping interfaces. 237All interface-specific parameters can 238be configured per area, overruling the global settings. 239These interface-specific parameters need to be defined before the interfaces. 240.Bl -tag -width Ds 241.It Ic area Ar address Ns | Ns Ar id 242Specify an area section, grouping one or more interfaces. 243.Bd -literal -offset indent 244area 0.0.0.0 { 245 hello-interval 3 246 interface em0 247 interface em1 { 248 metric 10 249 } 250} 251.Ed 252.El 253.Pp 254Area specific parameters are listed below. 255.Bl -tag -width Ds 256.It Ic demote Ar group Op Ar count 257Increase the 258.Xr carp 4 259demotion counter by 260.Ar count 261on the given interface group, usually 262.Ar carp , 263when no neighbor in the area is in an active state. 264The demotion counter will be decreased when one neighbor in that 265area is in an active state. 266The default value for 267.Ar count 268is 1. 269.Pp 270For more information on interface groups, 271see the 272.Ic group 273keyword in 274.Xr ifconfig 8 . 275.El 276.Sh INTERFACES 277Each interface can have several parameters configured individually, otherwise 278they are inherited. 279An interface is specified by its name. 280.Bd -literal -offset indent 281interface em0 { 282 ... 283} 284.Ed 285.Pp 286Interface-specific parameters are listed below. 287.Bl -tag -width Ds 288.It Ic demote Ar group 289Increase the 290.Xr carp 4 291demotion counter by 1 on the given interface group, usually 292.Ar carp , 293when the interface state is going down. 294The demotion counter will be decreased when the interface 295state is active again. 296.It Ic depend on Ar interface 297A metric of 65535 is used if the specified interface is down or in status 298backup. 299.It Ic hello-interval Ar seconds 300Set the hello interval. 301The default value is 10; valid range is 1\-65535 seconds. 302.It Ic metric Ar cost 303Set the interface metric a.k.a. cost. 304The default value is 10; valid range is 1\-65535. 305A metric of 65535 is used for 306.Xr carp 4 307interfaces with status backup. 308.It Ic passive 309Prevent transmission and reception of OSPF packets on this interface. 310The specified interface will be announced as a stub network. 311Passive mode is enforced for 312.Xr carp 4 313interfaces. 314.It Ic retransmit-interval Ar seconds 315Set retransmit interval. 316The default value is 5 seconds; valid range is 5\-3600 seconds. 317.It Ic router-dead-time Ar seconds 318Set the router dead time, a.k.a. neighbor inactivity timer. 319The default value is 40 seconds; valid range is 2\-65535 seconds. 320When a neighbor has been 321inactive for router-dead-time, its state is set to DOWN. 322Neighbors 323that have been inactive for more than 24 hours are completely removed. 324.It Ic router-priority Ar priority 325Set the router priority. 326The default value is 1; valid range is 0\-255. 327If set 328to 0, the router is not eligible as a Designated Router or Backup Designated 329Router. 330.It Ic transmit-delay Ar seconds 331Set the transmit delay. 332The default value is 1; valid range is 1\-3600 seconds. 333.It Ic type p2p 334Set the interface type to point to point. 335This disables the election of a DR and BDR for the given interface. 336.El 337.Sh FILES 338.Bl -tag -width /etc/examples/ospf6d.conf -compact 339.It Pa /etc/ospf6d.conf 340.Xr ospf6d 8 341configuration file. 342.It Pa /etc/examples/ospf6d.conf 343Example configuration file. 344.El 345.Sh SEE ALSO 346.Xr ospf6ctl 8 , 347.Xr ospf6d 8 , 348.Xr rc.conf.local 8 349.Sh HISTORY 350The 351.Nm 352file format first appeared in 353.Ox 4.2 . 354